Wednesday, March 27, 2013

How to Change DBSNMP Password in Database 10g and 11g Monitored by DB Control

To change the password of the user DBSNMP you must strictly follow the steps below, otherwise the 10g or 11g DB Control used to manage your database will not function properly.

1. Stop the standalone dbconsole
On Unix - DB Control Release up to 11.1.x
$ export ORACLE_SID=
$ emctl stop dbconsole

On Unix - DB Control Release 11.2.x and higher
$ export ORACLE_SID=
$ export ORACLE_UNQNAME=

$ emctl stop dbconsole
On Windows - DB Control Release up to 11.1.x
Stop the Windows Service OracleDBConsole orOpen a DOS Command Window and type
C:> set ORACLE_SID=
C:> set ORACLE_HOME=

C:> cd %ORACLE_HOME%/bin
C:> emctl stop dbconsole
On Windows - DB Control Release 11.2.x and higher
Stop the Windows Service OracleDBConsole or Open a DOS Command Window and type
C:> set ORACLE_SID=
C:> set ORACLE_UNQNAME=

C:> set ORACLE_HOME=

C:> cd %ORACLE_HOME%/bin
C:> emctl stop dbconsole

Check that the DB Control is stopped
On Unix
$ emctl status dbconsole
On Windows
Check the status of the Windows Service OracleDBConsole or Open a DOS Command Window, cd to the database $ORACLE_HOME\bin and type
emctl status dbconsole 

Connect to the database as a user with DBA privilege with SQL*Plus and execute
alter user dbsnmp identified by ;
Check the new password
SQL> connect dbsnmp/[@database_alias]
Go to $ORACLE_HOME/host_sid/sysman/emd, Save the file targets.xml to targets.xml.orig, Edit the file targets.xml with your favorite text editor
Search for the line: encrypted_string
>" encrypted="TRUE">
       Replace the encrypted value by the new password value
       Replace TRUE by FALSE

Restart the standalone dbconsole
On Unix - DB Control Release up to 11.1.x
$ export ORACLE_SID=
$ emctl start dbconsole
On Unix - DB Control Release 11.2.x and higher
$ export ORACLE_SID=
$ export ORACLE_UNQNAME=
$ emctl start dbconsole

On Windows - DB Control Release up to 11.1.x
Start the Windows Service OracleDBConsole
Or
Open a DOS Command Window and type
set ORACLE_SID=
set ORACLE_HOME=
cd %ORACLE_HOME%/bin
emctl start dbconsole 

On Windows - DB Control Release 11.2.x and higher
Start the Windows Service OracleDBConsole
Or
Open a DOS Command Window and type
set ORACLE_SID=
set ORACLE_UNQNAME=
set ORACLE_HOME=
cd %ORACLE_HOME%/bin
emctl start dbconsole 

Check that the password has been encrypted
Edit the file targets.xml
Search for the line: 
Check that the password VALUE is encrypted
Check that the value of ENCRYPTED is TRUE

Note: In case of RAC DB, the dbsnmp password should be changed in targets.xml not only for instances(oracle_database), but also for rac_database target. The file targets.xml needs to be updated on all the RAC Cluster nodes.
References

No comments: