Tuesday, July 24, 2012

Export Transfer Monitor Template Between OMSs


Requirements
To be able to export a monitoring template from an Oracle Enterprise Manager Repository so that it can be imported into another OEM Repository the Enterprise Manager Command Line Utility (emcli) must be installed and operational.

Steps

1.       Templates Available for Export, name must match exactly as indicated in OEM.
You can see a list via OEM Console or you can query the OEM repository database. 

Example:

SQL> SELECT TEMPLATE_NAME,TARGET_TYPE FROM MGMT_TEMPLATES;

TEMPLATE_NAME
----------------------------------------------------------------
TARGET_TYPE
----------------------------------------------------------------
Listner
oracle_listener

Prod DEV and TEST Databases
oracle_database

Production
oracle_database

Project Database Hosts
host

CPE Databases
oracle_database

2.       Select the template you want to extract and put into another OEM environment.

3.       Export the Template you want to put in the other OEM environment using the emcli utility.

Examples:

emcli export_template -name="Listner" -target_type=oracle_listener -output_file=/home/oracle/templates/Listener.template

emcli export_template -name='Prod DEV and TEST Databases' -target_type=oracle_database -output_file=/home/oracle/templates/prod_dev_and_test_databases.template

emcli export_template -name='Production' -target_type=oracle_database -output_file=/home/oracle/templates/Production.template

emcli export_template -name='Project Database Hosts' -target_type=host -output_file=/home/oracle/templates/Project_Database_hosts.template

emcli export_template -name='CPE Databases' -target_type=oracle_database -output_file=/home/oracle/templates/CPE_Databases.template

4.       Transfer the file created by the export of the template to the new OEM environment

5.       Import the template into the new OEM environment. 

Example:

emcli import_template -files="Listener.template;prod_dev_and_test_databases.template;Production.template;Project_Database_hosts.template;CPE_Databases.template"

OEM Grid Control Custom Target Properties


This procedure will walk through the requirements and steps to add and remove custom target properties as well as describe how to script populating the values for the target properties.  This procedure describes for the Oracle Enterprise Manager Grid Control 11g, while the steps are similar for earlier versions the EMCLI syntax may vary.  The custom target properties can be found for a target from the Grid Control Console in the target home page:

1.       Navigate to the Target homepage
2.       In the Related Links section, click 'Target Properties'

Requirements
To be able to add a custom target property or to script population of the target property the Oracle Enterprise Manager Command Line Interface (EM CLI) client must be installed.  The EM CLI OMS extensions are installed when the OMS is installed, but the client may require additional installation.
EMCLI Installation Requirements
·         Java version 1.6.0_25 or greater
·         Workstation running Solaris, Linux, HPUX, Tru64, AIX, or Windows with NTFS (client installation)

** See Oracle Documentation if installation is required.

Adding a Target Property
From the command line you will use the Oracle Command Line Interface (EM CLI) to add a target property, there is no way to add a target property from the Oracle Enterprise Manager Grid Control Console Interface.
1.       Log into server operating system where the Oracle Management Server is installed.
2.       From the operating system command line check the that emcli is installed
a.       emcli  (ensure that the emcli is in the PATH)
3.       Add a target property, example shows the addition of a target property to all database targets called URL.
a.       emcli add_target_property -target_type="oracle_database" -property="URL"
Note: You can use wild cards for target type to add to add a property to all target types
emcli add_target_property -target_type="*" -property="URL"

4.       Login to the OEM Grid Control GUI Console and navigate to an Oracle Database target properties.
a.       Navigate to the Target homepage
b.      In the Related Links section, click 'Target Properties'
c.       Check the property has been added.

Script Setting Target Property Value
You can set the target property value using the GUI console by going to the target home page then going to the Related Links Section “Target Properties”, however you may have a need to set the values through a process.  Again the EMCLI is required to be able to do this.

1.       Log into server operating system where the Oracle Management Server is installed.
2.       From the operating system command line check the that emcli is installed
a.       emcli
3.       Set the target property value, example shown shows an update to the URL target property of a database target called GRDPRD.
a.       emcli set_target_property_value -property_records="GRDPRD:oracle_database:URL:
www.mydatabase.com/GRDPRD"
4.       Login to the OEM Grid Control GUI Console and navigate to an Oracle Database target properties to check.
a.       Navigate to the Target homepage
b.      In the Related Links section, click 'Target Properties'
c.       Check the property value has been updated/changed

Remove Target Property
From the command line you will use the Oracle Command Line Interface (EM CLI) to remove a target property, there is no way to remove a target property from the Oracle Enterprise Manager Grid Control Console Interface.  ** Note: Cannot Remove Oracle Supplied Target properties.

1.       Log into server operating system where the Oracle Management Server is installed.

2.       From the operating system command line check the that emcli is installed
a.       emcli

3.       Remove a target property, example shows the removal of a target property from all database targets called URL
a.       emcli remove_target_properties –target_type="oracle_database" –property="URL"

4.       Login to the OEM Grid Control GUI Console and navigate to an Oracle Database target properties.
a.       Navigate to the Target homepage
b.      In the Related Links section, click 'Target Properties'
c.       Check the property has been removed.