update_db_password
Updates the target database password change in the Enterprise Manager Credential sub-system and can change the password on the target database as well. This verb also propagates the collection or monitoring credentials to Enterprise Manager Management Agents.
Standard Mode
emcli update_db_password -target_name="tname" -user_name="user_name" [-target_type="ttype"] [-change_all_references="yes/no"] [-change_at_target="yes/no"] [-role="DBRole"] [-unlock="yes/no"] [-connect_as="DBUserName:uname;DBPassword:upassword[;DBRole:SYSDBA]"] [-copy_password_file="yes/no"] [-host_creds="(HostName:hname;HostUserName:huname;HostPassword:hpassword)"] [-input_file="tag1:file_path1;tag2:file_path2;..."] [-validate_only="yes/no"] [ ] indicates that the parameter is optional
Interactive or Script Mode
update_db_password (target_name="tname" ,user_name="user_name" [,target_type="ttype"] [,change_all_references="yes/no"] [,-change_at_target="yes/no"] [,-role="DBRole"] [,-unlock="yes/no"] [,-connect_as="DBUserName:uname;DBPassword:upassword[;DBRole:SYSDBA]"] [,-copy_password_file="yes/no"] [,-host_creds="(HostName:hname;HostUserName:huname;HostPassword:hpassword)"] [,-input_file="tag1:file_path1;tag2:file_path2;..."] [,-validate_only="yes/no"]) [ ] indicates that the parameter is optional
Options
- target_name
Name of the target.
- user_name
Name of the database user.
- target_type
Type of target. The possible values for target type in this verb are
oracle_database
andrac_database
. The default value for this option is oracle_database. For the rac_database type, the password should be changed at the database and not at the individual instance level. - change_all_references
Specify if the password must be changed for all references in Enterprise Manager. Possible values are:
- yes - Update all password references in Enterprise Manager for a database monitoring user who has an old password that matches the new password.
- no - Update the password for the currently logged in user.
The default value of this option is yes.
- change_at_target
Specify whether the password must also be changed on the target.
- yes — Change the password on the target database.
- no — Update the password only on Enterprise Manager.
The default value of this option is no.
- role
Database user role
- unlock
Specifies if the user should be unlocked. Possible values are:
- yes - unlock the user.
- no - do not attempt to unlock the user.
The default value of this option is no.
- connect_asConnect to the target database as. This option enables the user to change the password of a different user without having to login as that user. It should be specified in any of following formats :
-- "DBUserName:uname;DBPassword:upassword[;DBRole:SYSDBA]"
-- "[DBCredsOwner:ucredsowner;]DBNamedCreds:unamedcreds"
Note:
If this is not specified, the password for theuser_name
will be changed. - copy_password_fileIndicates whether to copy the password file across instances in RAC or across secondary databases in Data Guard environments in case it is needed.The default value of this option is no.
host_creds
must be specified when this option is yes. Possible values are:- yes - copy the password file.
- no - do not attempt to copy the password file.
- host_creds
This specifies the named host credentials information that would be used while copying the password file. Named credentials for multiple hosts can be specified in the following format:
"(HostName:hname;HostUserName:huname;HostPassword:hpassword"
or"HostNamedCreds=hnamedcreds")+
For example, if named credentials for multiple hosts are needed to copy a password file to one or more standby databases that are on hosts that are different from the primary database, this can be specified in the following format for all the hosts where the password file needs to be updated.
-host_creds="HostName:host1.example.com;HostNamedCreds:HostNamedCred1;HostName:host1Standby;HostNamedCreds:StandbyHostNamedCred1"
- input_file
Path of the file that has old and new passwords. Use this option to hide passwords displayed on the command line. You must accompany each path with a tag referenced in the password options. This can be specified in the following format:
tag1:file_path1;tag2:file_path2;...
When you execute this verb with the input_file option, you are prompted to enter the following values in non-echo mode:
-old_password -new_password -retype_new_password
For more information about the input_file parameter, see -input_file Syntax Guidelines.
- validate_onlyIndicates whether to only validate the options mentioned without doing the actions.The default value of this option is no.
- yes - You must validate the options that are mentioned. Do not perform any action and display any validation errors on to the console.
- no - Perform the actions as per the meentioned options.
Note:
On execution, you will be prompted to enter the following values in non-echo mode: -old_password
-new_password
-retype_new_password
This option hides the password to be displayed on command line.Examples
Example 1 - Command-Line
emcli update_db_password -target_name=myDB -user_name=Admin1
Example 2 - Scripting and Interactive
update_db_password (target_name="myDB", user_name="Admin1")
Example 3 - Command-Line
emcli update_db_password -target_name=myDB -user_name=Admin1 -change_at_target=yes
Example 4 - Scripting and Interactive
update_db_password (target_name="myDB", user_name="Admin1", change_at_target="yes")
Example 5 - Copy Password File
emcli update_db_password -target_name="myDB" -target_type="oracle_database" -user_name="Admin1" -role="Primary" -change_at_target=yes -change_all_references=yes -copy_password_file="yes" -host_creds="HostName:host1.example.com;HostNamedCreds:HostNamedCred1;HostName:host1Standby;HostNamedCreds:StandbyHostNamedCred1"