$ emcli login -username=sysman -password=pass1234
Login successful
or
$ emcli login -username=sysman
Enter password :
Login successful
$ emcli logout
Logout successful
$ emcli help
$ emcli help login
emcli>help()
emcli>help('login')
$ emcli status
Oracle Enterprise Manager 13c Release 2 EM CLI with Scripting option.
...
..
.
emcli>status()
$ emcli sync
Synchronized successfully
[oracle@oemnode1 ~]$ emcli get_target_types
Display Target Type | Target Type | Is Composite (Y/N)
------------------------------------------------- | ------------------------------------------ | ------------------
ADF Business Components for Java | oracle_bc4j | N
ASM Disk Group Component | asm_diskgroup_component | N
...
..
.
oracle_sdpmessagingdriver_xmpp | N
ZPools | oracle_si_zpool_host | N
ZPools | oracle_si_zpool_host_remote | N
ZPools | oracle_si_zpool_zfssa | N
webcenter_portal_app | webcenter_portal_app | N
$ emcli get_target_types -plugin=oracle.sysman.db
Display Target Type | Target Type | Is Composite (Y/N)
-------------------------------- | ------------------------| ------------------
ASM Disk Group Component | asm_diskgroup_component | N
ASM IO Server | osm_ioserver | N
ASM Proxy | osm_proxy | N
Automatic Storage Management | osm_instance | N
Cluster | cluster | Y
Cluster ASM | osm_cluster | Y
Cluster ASM Disk Group Component | casm_diskgroupcomponent | N
Cluster Database | rac_database | Y
Database Instance | oracle_database | N
Database System | oracle_dbsys | Y
Exadata Express Cloud Service | oracle_pdbexpress | N
Far Sync Instance | oracle_farsync | N
Global Data Services | gds_cloud | Y
Global Data Services Pool | gds_pool | Y
Global Service Manager | gds_gsm | N
Listener | oracle_listener | N
Oracle Cloud Database Service | oracle_cloud_dbcs | Y
Oracle Database Service | oracle_dbservice | N
Oracle High Availability Service | has | N
Oracle Secure Backup Domain | osb_server | N
Pluggable Database | oracle_pdb | N
Schema Service | oracle_dbsvc | N
- Lists all the property names for the target type.
$ emcli get_target_properties -target_type="oracle_database"
Comment
Contact
Cost Center
Customer Service Identifier
Department
Downtime Contact
Environment
LifeCycle Status
Line of Business
Location
Operating System
Platform
Site
Target Version
Target properties fetched successfully
- Set Target Property Value
For cluster target types, the value of the target property automatically propagates to all of its member targets. This happens even without the -propagate_to_members parameter. The propagate_to_members parameter is used for aggregate non-cluster targets where the desired behavior is to propagate the target property values to members of the aggregate target. Note that it will propagate to current members of the aggregate, and not targets that are added in the future.
Note:
You can only set up and propagate one property at a time to members.
$ emcli set_target_property_value -property_records=”target_name:target_type:property_name:property_value” [-
separator=property_records=”sep_string”] [-subseparator=property_records=”subsep_string”] [-input_file=”parameter_tag:file_path”]
[-propagate_to_members]
[ ] indicates that the parameter is optional
$ emcli set_target_property_value property_records=”oggtest:5512:oracle_goldengate:LifeCycleStatus:Test” -propagate_to_members
- List of Targets
$ emcli get_targets
[oracle@oemnode1 ~]$ emcli get_targets -targets="oracle_listener"
Status Status Target Type Target Name
ID
1 Up oracle_listener LISTENER_racnode2.virtuallab
1 Up oracle_listener LISTENER_SCAN3_racnode-cluster
0 Down oracle_listener ASMNET1LSNR_ASM_racnode2.virtuallab
1 Up oracle_listener LISTENER_racnode1.virtuallab
1 Up oracle_listener LISTENER_oemnode1
1 Up oracle_listener LISTENER_SCAN2_racnode-cluster
0 Down oracle_listener ASMNET1LSNR_ASM_racnode1.virtuallab
1 Up oracle_listener LISTENER_SCAN1_racnode-cluster
0 Down oracle_listener MGMTLSNR_racnode1.virtuallab
- List of alerts that are out-of-sync between OEM Agent and the repository for the specified target.
$ emcli get_unsync_alerts -target_type=host -target_name=racnide1
Total number of alerts to be synchronized = 0
$emcli create_blackout -name="DB_RAC_RACTEST_BLACKOUT"
-reason="Mainteneance" -add_targets="RACTEST:rac_database"
-schedule="duration:10"
$ emcli get_blackout_details -name="DB_RAC_RACTEST_BLACKOUT"
Status Status ID Run Jobs Next Start Duration Reason Frequency Repeat Days Months Start Time End Time TZ Region TZ Offset Type
Started 4 no 2019-12-02 14:00:20 10:00 Mainteneance once none none none 2019-12-02 03:00:20 2019-12-02 13:00:20 UTC +00:00 Blackout
$ emcli stop_blackout -name="DB_RAC_RACTEST_BLACKOUT"
Blackout "DB_RAC_RACTEST_BLACKOUT" stopped successfully
$ emcli delete_blackout -name="DB_RAC_RACTEST_BLACKOUT"
Blackout "DB_RAC_RACTEST_BLACKOUT" deleted successfully
Decommission an agent and delete the respective targets
$ emcli delete_target -name="racnode1:3872" -type="oracle_emd"
-delete_monitored_targets -async
Target "racnode1:3872:oracle_emd" deleted successfully
Stop and start an agent from OMS
Plug-In
[oracle@oemnode1 ~]$ emcli list_plugins_on_agent \
-agent_names=racnode1.virtuallab:3872 -include_discovery
The Agent URL is https://racnode1.virtuallab:3872/emd/main/ -
Plug-in Name Plugin-id Version [revision]
Systems Infrastructure oracle.sysman.si 13.3.1.0.0
Oracle Home oracle.sysman.oh 13.3.0.0.0
Oracle Fusion Middleware oracle.sysman.emas 13.3.1.0.0*
Systems Infrastructure oracle.sysman.si 13.3.1.0.0*
Oracle Exadata oracle.sysman.xa 13.3.1.0.0*
Oracle Database oracle.sysman.db 13.3.1.0.0*
Oracle Home oracle.sysman.oh 13.3.0.0.0*
Oracle Database oracle.sysman.db 13.3.1.0.0
* Indicates that the plug-in is a discovery plug-in.
[oracle@oemnode1 ~]$emcli list_plugins_on_agent -agent_names='agent,*node*'
[oracle@oemnode1 ~]$ emcli list_plugins_on_agent -all
Importing Manually Downloaded Plug_In
emcli import_update -omslocal -file=p29555092_112000_Generic.zip
Transfer the downloaded file to any managed host in your environment, and run following command to import it to Enterprise Manager.
emcli import_update -host=<hostname> -file=p29555092_112000_Generic.zip <host credential options>
Importing Plug-In Catalog Archives
[oracle@oemnode1 ~]$ emcli import_update_catalog -file="/tmp/p9348486_112000_Generic.zip" -omslocal
List Plug-Ins
[oracle@racnode1 ~]$ emctl listplugins agent
Deploying Plug-Ins to Management Service
[oracle@oemnode1 ~]$ emcli deploy_plugin_on_server -plugin="oracle.sysman.db:13.3.2.0.0" -repo_backup_taken
Enter repository DB sys password:
Tracking the Deployment Status of Plug-Ins on Oracle Management Service
[oracle@oemnode1 ~]$ emcli get_plugin_deployment_status -plugin_id="oracle.sysman.db:13.3.2.0.0"
Deploying Plug-Ins on Oracle Management Agent
[oracle@oemnode1 ~]$ emcli deploy_plugin_on_agent \
-agent_names="racnode1.virtuallab:3872" \
-plugin="oracle.sysman.db:13.3.2.0.0"
Agent side plug-in deployment is in progress
Use "emcli get_plugin_deployment_status -plugin=oracle.sysman.db"
to track the plug-in deployment status.