set_credential
Sets preferred credentials for given users.
Note:
This command does not support the COLLECTION credential sets.
Format
emcli set_credential -target_type="ttype" [-target_name="tname"] -credential_set="cred_set" [-user="user"] -columns="col1:newval1;col2:newval2;PDP:SUDO/POWERBROKER;RUNAS:oracle; PROFILE:user1..." [-input_file="tag1:file_path1;tag2:file_path2;..."] [-oracle_homes="home1;home2"] [-monitoring] [ ] indicates that the parameter is optional
Options
-
target_type
Type of target. This must be "host" if the
-oracle_homes
parameter is specified. -
target_name
Name of the target. Omit this argument to set enterprise preferred credentials. This must be the host name if the
-oracle_homes
parameter is specified. -
credential_set
Credential set affected.
-
user
Enterprise Manager user whose credentials are affected. If omitted, the current user's credentials are affected.
-
columns
Name and new value of the column(s) to set. Every column of the credential set must be specified. Alternatively, a tag from the
-input_file
argument can be used so that the credential values are not seen on the command line. You can specify this argument more than once. -
input_file
Path of the file that has the
-columns
argument(s). This is used to hide passwords. Each path must be accompanied by a tag referenced in the-columns
parameter. You can specify this option more than once.For more information about the input_file parameter, see -input_file Syntax Guidelines.
-
oracle_homes
Name of Oracle homes on the target host. Credentials will be added/updated for all specified homes.
Note: The list of columns and the credential sets they belong to is included in the metadata file for each target type. This and other credential information is in the
<CredentialInfo>
section of the metadata. -
monitoring
Flag indicating that credentials affected are monitoring credentials. If omitted, the credentials affected are preferred credentials. Monitoring credentials require specifying the target_name option.
Examples
Example 1
In this example, FILE1
is a tag to refer to the contents of passwordFile
. Note that Example 2 has the same effect as Example 1.
emcli set_credential -target_type=oracle_database -target_name=myDB -credential_set=DBCredsNormal -user=admin1 -column=FILE1 -input_file=FILE1:passwordFile
Example 2
In this example, the contents of the passwordFile
: is username:joe;password:newPass;role:newRole
emcli set_credential -target_type=host -target_name=host.example.com -credential_set=OHCreds -user=admin1 -column="OHUsername:joe;OHPassword:newPass" -oracle_homes="database1;mydb"