Tuesday, September 30, 2008

Redirect an OEM agent to another console

# stop the agent
emctl stop agent

# Change REPOSITORY_URL and emdWalletSrcUrl in emd.properties

# single instance

cp $ORACLE_HOME/sysman/config/emd.properties $ORACLE_HOME/sysman/config/emd.properties.20080930

vi $ORACLE_HOME/sysman/config/emd.properties
:%s/prod-oemnode-10/qa-oemnode-10/g

rm -r $ORACLE_HOME/sysman/emd/state/*
rm -r $ORACLE_HOME/sysman/emd/collection/*
rm -r $ORACLE_HOME/sysman/emd/upload/*
rm $ORACLE_HOME/sysman/emd/lastupld.xml
rm $ORACLE_HOME/sysman/emd/agntstmp.txt
rm $ORACLE_HOME/sysman/emd/blackouts.xml
rm $ORACLE_HOME/sysman/emd/protocol.ini

# RAC

cp $ORACLE_HOME/*/sysman/config/emd.properties $ORACLE_HOME/*/sysman/config/emd.properties.20080930

vi $ORACLE_HOME/*/sysman/config/emd.properties
:%s/prod-oemnode-10/qa-oemnode-10/g

# Delete old config files

rm -r $ORACLE_HOME/*/sysman/emd/state/*
rm -r $ORACLE_HOME/*/sysman/emd/collection/*
rm -r $ORACLE_HOME/*/sysman/emd/upload/*
rm $ORACLE_HOME/*/sysman/emd/lastupld.xml
rm $ORACLE_HOME/*/sysman/emd/agntstmp.txt
rm $ORACLE_HOME/*/sysman/emd/blackouts.xml
rm $ORACLE_HOME/*/sysman/emd/protocol.ini

# start the agent
emctl start agent

# clear the agent
emctl clearstate agent

# register with the console (prompts for password)
emctl secure agent

# upload the configuration to the console
emctl upload