./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.