Monday, March 31, 2008

Rename Target in OEM Grid Control Without Removing Target

1. Go to the target machine when you can change the target name


2. Go to agent ORACLE_HOME/sysman/emd directory


3. Find the targets.xml file


4. make a backup of copy of the targets.xml to something like targets.xml.bak

Edit the file and search for the target name you want to change and then change the name to the new name you want the target to have.


6. Go to agent ORACLE_HOME/bin directory and run the following

emctl stop agent

emctl clearstate agent

emctl start agent

emctl reload agent

emctl upload agent


After a few minutes go into the OEM Grid Control GUI and you should see the new target name

Move OEM Grid Agent to another OMS

1. Stop the agent: emctl stop agent

2. edit the emd.properties file REPOSITORY_URL parameter to reflect the new OMS information

3. Clean up the agent 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

4. emctl clearstate

5. emctl start agent

6. emctl upload

7. emctl status agent

Rebuild targets.xml for Oracle Enterprise Manager Grid Control Agent

1. Agents installations before 10.2.0.3 have a bug in the 'agentca' command that prevents the targets.xml file from getting populated with the initial parameters (AGENT_TOKEN, ORACLE_EMD, and/or HOST) when the file does not already exist. To work around this we will need to manually create a targets.xml file if it does not exist.

Windows
create the new file in the Agent %ORACLE_HOME%\sysman\emd\ directory. (Where %ORACLE_HOME% is the agent’s home)
Unix$

$ cd $ORACLE_HOME/sysman/emd (where $ORACLE_HOME is the Agent's home)
$ touch targets.xml.

2. Once you have created the targets.xml file, view the Agent's $ORACLE_HOME/sysman/config/emd.properties file. Copy the values for:
agentSeed=12345EMD_URL=http://hostname.oracle.com:9876/emd/main

3. Manually update the new targets.xml and add the following entries to the file following the syntax exactly:






For example:





4. Force target re-discovery:
a. Verify that the environment variables are setup for the Management Agent:
$ORACLE_HOME set$ORACLE_HOME/bin in $PATH

b. The agentca utility is expecting the oraInst.loc to be located in the root of the Agent's $ORACLE_HOME

NOTE: Solaris puts the oraInst.loc in /var/opt/oracle. Agentca will not fine the oraInst.loc on a Solaris platform. For Solaris platforms you need to create a soft link:
$ORACLE_HOME/oraInst.loc to /var/opt/oracle/oraInst.loc
c. Run agentca -d to force a new discovery of the targets on the host

agentca -d