Update_db_password command can be used to updates DBNSMP password of the target in the Enterprise Manager Credential sub-system and change the password on the target database as well.
The command need to be run from OMS home.
SYNTAX:
emcli login -username=sysman -password= emcli update_db_password -target_name="" -target_type="oracle_database" -user_name="dbsnmp" -change_at_target=yes -old_password="" -new_password="" -retype_new_password=""
For standalone database:(TESTDB)
1. login to sysman user in OMS
cd $OMS_HOME/bin ./emcli login -username=sysman -password=oracle1234 Login successful
2. Check the target staus:
./emcli get_targets -target="oracle_database" | grep TESTDB 1 Up oracle_database TESTDB
3. Update the dbsnmp password
./emcli update_db_password -target_name="TESTDB" -target_type="oracle_database" -user_name="dbsnmp" -change_at_target=yes -old_password="dbsnmp" -new_password="oracle" -retype_new_password="oracle" Successfully submitted a job to change the password in Enterprise Manager and on the target database: "TESTDB" Execute "emcli get_jobs -job_id=49A8A308BB280CAFE0540010E01F328C" to check the status of the job. Search for job name "CHANGE_PWD_JOB_1488359226974" on the Jobs home page to check job execution details.
4. Check the job status:
./emcli get_jobs -job_id=49A8A308BB280CAFE0540010E01F328C Name Type Job ID Execution ID Scheduled Completed TZ Offset Status Status ID Owner Target Type Target Name CHANGE_PWD_JOB_1488359226974 dbUpdateDBPassword 49A8A308BB280CAFE0540010E01F328C 49A8A308BB2B0CAFE0540010E01F328C 2017-03-01 12:07:07 2017-03-01 12:07:11 GMT+03:00 Succeeded 5 SYSMAN oracle_database TESTDB
FOR RAC DATABASE USE BELOW SYNTAX:
emcli update_db_password -target_name="" -user_name= -target_type=rac_database -change_all_references=yes -change_at_target=yes -old_password= -new_password= -retype_new_password= emcli set_monitoring_credential -target_type="rac_database" -target_name="" -set_name="DBCredsMonitoring" -cred_type="DBCreds" -attributes="DBUserName:;DBPassword:;DBRole:"
Hello, Nice post. In my case i am using 13C and I am trying to execute the ./emcli update_db_password -target_name=”TESTDB” -target_type=”oracle_database” -user_name=”dbsnmp” -change_at_target=yes -old_password=”dbsnmp” -new_password=”oracle” -retype_new_password=”oracle”
1st step is successful as below
Successfully submitted a job to change the password in Enterprise Manager and on the target database: “TESTDB”
Execute “emcli get_jobs -job_id=660264C7ECEC01E0E0530A1447E3EC8E” to check the status of the job.
Search for job name “CHANGE_PWD_JOB_1519531175428” on the Jobs home page to check job execution details.
2nd when i check job status it says failed. – I tired it on 15+ databases same result below is the output – any suggestions?
emcli get_jobs -job_id=660264C7ECEC01E0E0530A1447E3EC8E
Name Type Job ID Execution ID Scheduled Completed TZ Offset Status Status ID Owner Target Type Target Name
CHANGE_PWD_JOB_1519531175428 dbUpdateDBPassword 660264C7ECEC01E0E0530A1447E3EC8E 660264C7ECEF01E0E0530A1447E3EC8E 2018-02-24 21:59:35 2018-02-24 21:59:37 GMT-06:00 Failed 4 SYSMAN oracle_database TESTDB
Dear ,
-old_password=”dbsnmp”.
Is the old password is dbsnmp ???
Regards
Rajkishore
you use this shell script.
https://dbadeeds.wordpress.com/2021/03/15/how-to-change-oem-monitoring-credentials-using-emcli-shell-scripts-or-rundeck/