Archive for July, 2011

Set the login info, otherwise you will give session expired error.

./emcli setup -url=https://source_hostname:7799/em  -username=sysman
./emcli export_report -title="Database Size" -owner="SYSMAN" -output_file="db_size.xml"
Report "Database Size", owned by "SYSMAN", has been exported from the repository.
Exported reports may not contain all information from original report.  Repository specific information such as targets, administrator access, and schedules are not exported.  Imported reports should be edited after import to supply all necessary report parameters.

In target

./emcli setup -url=https://target_hostname:7799/em  -username=sysman
./emcli import_report -files="db_size.xml"
File "db_size.xml" has been imported into the repository.
Imported reports should be edited after import to supply all necessary report parameters.
convert this post to pdf.
./emcli setup -url=https://source_hostname:7799/em -username=sysman

If you don’t issue the above command, you will get error like session expired. get the name and target type from below query

 SELECT TEMPLATE_NAME,TARGET_TYPE FROM sysman.MGMT_TEMPLATES ;
./emcli export_template -name="Common_Database_Template" -arget_type="oracle_database" -output_file=Common_Database_Template.out

./emcli export_template -name="Common_Sybase_Template" -target_type="sybase_ase" -output_file=Common_Sybase_Template.out

./emcli export_template -name="Common_Clusterdb_template" -target_type="rac_database" -output_file=Common_Clusterdb_template.out

./emcli export_template -name="Common_ASM_template" -target_type="osm_instance" -output_file=Common_ASM_template.out

./emcli export_template -name="Common_Agent_template" -target_type="oracle_emd" -output_file=Common_Agent_template.out

./emcli export_template -name="Common_listener_Template" -target_type="oracle_listener" -output_file=Common_listener_Template.out

./emcli export_template -name="Common_Host_template" -target_type="host" -output_file=Common_Host_template.out

To import

./emcli setup -url=http://target_hostname:7788/em -username=sysman

Make sure that if the oms is secured use https, if not use http in -url. If you want to import as different user you can change the -username to respective users.

 ./emcli import_template -files="Common_Database_Template.out;Common_Sybase_Template.out;
Common_Clusterdb_template.out;Common_ASM_template.out;
Common_Agent_template.out;Common_listener_Template.out;
Common_Host_template.out"

sybase template will fail if sybase plugin is not installed. If there is already a name with exisiting template, that template will not be added.

convert this post to pdf.