Wednesday, February 3, 2021

Steps to Migrate OEM jobs to Another OEM

 

On SOURCE:

On Source OMS server login with sysman credentials

SRC_OMS_SERVER:NOTSET:/opt/oracle/product/middleware/oms/bin $ ./emcli login -username=sysman

Enter password :

Login successful


SRC_OMS_SERVER:NOTSET:/opt/oracle/product/middleware/oms/bin $ ./emcli get_reports | grep -i orcldb

"ORCLDB Failed Logons - Scheduled1 - 12c","SYSMAN","(ORCLDB Failed Logons - Scheduled1 - 12c)"


SRC_OMS_SERVER:NOTSET:/opt/oracle/product/middleware/oms/bin $ ./emcli export_report -output_file=/home/oracle/ORCLDB.xml -title="ORCLDB Failed Logons - Scheduled1 - 12c" -owner=SYSMAN

Report "ORCLDB Failed Logons - Scheduled1 - 12c", 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.

Now, scp the xml file generated to the target OMS server

SRC_OMS_SERVER:NOTSET:/opt/oracle/product/middleware/oms/bin $ scp /home/oracle/ORCLDB.xml oracle@TRG_OMS_SERVER:/home/oracle

oracle@TRG_OMS_SERVER's password:

ORCLDB.xml                         


On TARGET:

[oracle@TRG_OMS_SERVER bin]$ ./emcli login -username=sysman

Enter password :

Login successful


[oracle@TRG_OMS_SERVER ~]$ cd $OMS_HOME/bin

[oracle@TRG_OMS_SERVER bin]$ ./emcli import_report -files=/home/oracle/ORCLDB.xml

File "/home/oracle/ORCLDB.xml" has been imported into the repository.

Imported reports should be edited after import to supply all necessary report parameters.


Verify:

Go to oem reports then you'll see this report

Refer: 

Doc ID 831165.1


Script to export OEM 13c Jobs

 

#!/bin/ksh

################################################

# This script will export all OEM 13c jobs

#

# AUTHOR : 

#################################################


echo -e "\n*************************************"

echo  "DATE = `date`"

echo  "HOSTNAME = " `hostname`

echo -e "*************************************\n"


#export WORD =''

export OMS_HOME=${OMS_HOME}

export LOG_DIR=

#$OMS_HOME/bin/emcli login -username=sysman

$OMS_HOME/bin/emcli get_reports | grep 13c > FILE

cat FILE | egrep -o '^[^,]+'|sed -e 's/^"//' -e 's/"$//'  | while read -r LINE

do

echo

echo -e "**********************************************************\n"

echo -e "\nOEM JOB NAME :" $LINE

#echo $LINE | awk -F" " '{print $1}' > MYWORD

WORD1="`echo $LINE | awk -F" " '{print $1}'`"

WORD2="`echo $LINE | tr ":" " " | awk -F" " '{print $2}'`"

WORD3="`echo $LINE | tr ":" " " | awk -F" " '{print $3}'`"

echo -e "\nExporting "$WORD1 $WORD2 $WORD3 " .......\n"

$OMS_HOME/bin/emcli export_report -output_file="$LOG_DIR/${WORD1}_${WORD2}_${WORD3}.xml" -title="$LINE" -owner=SYSMAN

#echo "$OMS_HOME/bin/${WORD1}_${WORD2}_${WORD3}.xml"

done

echo -e "\n**********************************************************"

echo -e "\nSHELL Script ENDED at `date`\n"

echo -e "EXPORTED Files are =>\n"

ls -lrth $LOG_DIR/*.xml

echo -e "\nZipping above 'xml' Files.........."

gzip -f $LOG_DIR/*.xml

echo -e "\nCompleted Zipping all Files "

ls -lrth $LOG_DIR/*.gz


Refer more :

how to migrade specific OEM job to another OEM can be found below

http://chandu208.blogspot.com/2021/02/steps-to-migrate-oem-jobs-to-another-oem.html


Auto Scroll Stop Scroll