EM 12c, EM 13c: How to Create an emcli Script to Add Databases Based on the Targets Found in Auto Discovery Results in Enterprise Manager 12c and 13c Cloud Control
(Doc ID 1543773.1)
Last updated on FEBRUARY 15, 2019
Enterprise Manager for Oracle Database - Version 184.108.40.206.0 and later Information in this document applies to any platform.
Up to Enterprise Manager Cloud Control Release 220.127.116.11, there is no method of 'mass promotion' in Enterprise Manager 12c Cloud Control. This means that if lots of databases are discovered on a particular node, it is necessary to go into auto discovery results, and promote each database individually. This can be time consuming, and there is an internal Enhancement Request raised on this.
Beginning with 18.104.22.168 Cloud Control and higher, you can mass promote database by selecting the option "Specify Common Monitoring Credential" from the page" Promote Database Discovered Targets". Then you can select 'all' or a set of discovered databases to be promoted in one operation.
If you cannot upgrade to 22.214.171.124, the fastest way to promote a database would be to use the emcli add target command. However, the user would have to manually create the script to add the database targets in the first place. The script requires details such as hostname, port, sid,oracle_home of the database.
The goal of this document is to provide a quick way of creating the emcli add target script. The relevant details of the databases which have been discovered in auto discovery results will be used to create the emcli script. In this example the dbsnmp password will be hardcoded into the script as 'dbsnmp'. It can be changed appropriately once the script has been created
In addition to the method outlined in this article, Oracle now provides an example script 'promote_discovered_dbs.py' which is documented in the Enterprise Manager Command Line Interface (emcli) guide, which is also able to promote the un-managed databases. See: