EM 13c, EM 12c : 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 MAY 09, 2023
Applies to:
Enterprise Manager for Oracle Database - Version 12.1.0.4.0 and later Information in this document applies to any platform.
Goal
Up to Enterprise Manager Cloud Control Release 12.1.0.3, 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 12.1.0.4 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.
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
New Update:
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: