modify_target
Modifies a target instance definition.
Note:
To change the monitoring password of a database target, either use update_db_password (at the RAC level), or use modify_target with the following options:
-credentials="UserName:newuser;password:PWD_FILE;Role:SYSDBA" -input_file="PWD_FILE:at_pwd_file"
Format
emcli modify_target -name="name" -type="type" [-properties="pname1:pval1;pname2:pval2;..."]... [-separator=properties="sep_string"] [-subseparator=properties="subsep_string"] [-credentials="userpropname:username;pwdpropname:password;..."] [-input_file="parameter_tag:file_path"] [-display_name="display name"] [-on_agent] [ ] indicates that the parameter is optional
Options
-
name
Target name.
-
type
Target type.
-
properties
Name-value pair list of properties for the target instance. The "name"(s) are identified in the target-type metadata definition. They must appear exactly as they are defined in that file. Metadata files are located in
$AGENT_ORACLE_HOME/sysman/admin/metadata
.Note:
This verb does not support setting global target properties. It is recommended that you use set_target_property_values to set target properties.
-
separator=properties
Specifies a string delimiter to use between name-value pairs for the value of the
-properties
option. The default separator delimiter is ";". -
subseparator=properties
Specifies a string delimiter to use between name and value in each name-value pair for the value of the
-properties
option. The default subseparator delimiter is ":". -
credentials
Monitoring credentials (name-value pairs) for the target instance. The "name"(s) are identified in the target-type metadata definition as credential properties. They must appear exactly as they are defined in that file. Metadata files are located in
$AGENT_ORACLE_HOME/sysman/admin/metadata
. -
input_file
Used in conjunction with the
-credentials
option, this option enables you to store specific target monitoring credential values, such as passwords, in a separate file. The-input_file
option specifies a mapping between a tag and a local file path. The tag is specified in lieu of specific monitoring credentials of the-credentials
option. The tag must not contain colons ( : ) or semi-colons ( ; ).For more information about the input_file parameter, see -input_file Syntax Guidelines.
-
display_name
Sets the target display name.
-
on_agent
Propagates changes to the Management Agent collecting this target's metrics.
Examples
Example 1
This example modifies the display name and properties for the oracle_database
target with the name database
. The on_agent
flag ensures that the changes are propagated to the Management Agent collecting for this target.
emcli modify_target -name="database" -type="oracle_database" -display_name="New Name DB" -properties="SID=newsid|Port=15091|OracleHome=/oracle" -properties="MachineName=smpamp-sun1.example.com" -separator=properties="|" -subseparator=properties="=" -on_agent
Example 2
This example modifies an oracle_database
target type with the name payroll_db
. In this example, the display name for this database (target name that is displayed in the Enterprise Manager UI) is being changed to payroll
. The port number is being changed to 15067
, and the Oracle Home is being changed to /oradb
. The administrator (dbsnmp
), whose previous default role was normal
, is being changed to sysdba
. This example also illustrates the use of the input_file
to camouflage the credentials. The password is actually in a file named at_pwd_file
. The -input_file
argument replaces PWD_FILE
with the contents of at_pwd_file
in the -credentials
option.
emcli modify_target -name="payroll_db" -type="oracle_database" -credentials="UserName:Fred;password:PWD_FILE;Role:sysdba" -properties="Port:15067;OracleHome:/oradb" -input_file="PWD_FILE:at_pwd_file" -display_name=payroll -on_agent
Example 3
This example modifies an existing Apache Tomcat target named TARGET_NAME. Here, the SSL Trust Store location for the target is changed.
emcli modify_target -name="TARGET_NAME" -type="tomcat" -properties="SSLTrustStore:AGENT_HOME/agent_inst/sysman/config/montrust/AgentTrust.jks" -separator=properties=";" -subseparator=properties=":" -on_agent
Example 4
This example modifies an existing Apache Tomcat target named TARGET_NAME. Here, the SSL Trust Store location and the SSL Trust Store password for the target are changed.
emcli modify_target -name="TARGET_NAME" -type="tomcat" -properties="SSLTrustStore:AGENT_HOME/agent_inst/sysman/config/montrust/AgentTrust.jks;SSLTrustStorePassword:welcome" -separator=properties=";" -subseparator=properties=":" -on_agent
Bug Fix 1
This example updates the ORACLE_HOME property in RAC and Oracle Database targets. A total of four statements are required in order to update RAC targets. This command must be run in Oracle Databases within the RAC target.
emcli modify_target(name="<TARGET_NAME>",type="rac_database",properties="OracleHome:/opt/oracle/product/11.2.0/racdb11204") modify_target(name="<TARGET_NAME>",type="oracle_database",properties="OracleHome:/opt/oracle/product/11.2.0/racdb11204",on_agent=True) modify_target(name="<TARGET_NAME>",type="oracle_database",properties="OracleHome:/opt/oracle/product/11.2.0/racdb11204",on_agent=True) modify_target(name="<TARGET_NAME>",type="oracle_database",properties="OracleHome:/opt/oracle/product/11.2.0/racdb11204",on_agent=True)