Database Reference
In-Depth Information
-username
The EM username to be used by all subsequent emcli commands
when contacting the OMS.
-password
The EM user's password.
If this option is not specified, the user is prompted
for the password interactively.
Providing a password on the command line is insecure and
should be avoided.
-trustall
Automatically accept any server certificate from the OMS,
which results in lower security.
Also indicates that the setup directory is local and trusted.
The get_targets Verb
EM CLI verbs fall into three broad categories: EM queries, OEM administrative actions, and target manipulations.
Verbs use a very specific syntax, so the names of targets being passed to EM CLI must match the object's name in
OEM's dictionary.
The get_targets verb can be used to verify the target name prior to its use in any administrative or maintenance
task. For instance, let's say you want to create a blackout for database orcl1 on host myhostx and that you promote
discovered database and listener targets through the automated process. The database target in OEM may have been
added as sidc_myhostx , by its RAC instance name, or perhaps by its global name. Sometimes it may even appear as its
service name or SID. This variability can occur when you use target promotion through Auto Discovery Results. You
should set target names manually when you add targets, using the guided discovery process to ensure consistency
across your enterprise.
Output Formats
EM CLI has three preconfigured output formats for query results. User-defined formats are also supported.
Pretty format aligns the column headings with the result-set data.
Script format separates the values in the heading and results columns with a space. This
format works very well with the awk programming language.
Csv format, as the name suggest, separates the values with a comma for parsing in a
spreadsheet or with the shell's cut command.
Let's say you want to set the OEM credentials for the eamz database using this command:
emcli set_credential -target_type=oracle_database -target_name="eamz" \
-credential_set=DBCredsNormal \
-columns="username:dbsnmp;password:Super_S3cret;role:Normal"
Your command would fail because OEM can't find a matching target name. Figure 4-1 illustrates the different styles.
emcli get_targets -targets="oracle_database" -format="name:csv" | grep -i eamz
 
Search WWH ::




Custom Search