Pages

Wednesday 4 January 2012

STEPS TO ADD ASM INSTANCE INTO EM AFTER DATABASE MIGRATED TO ASM

When a non ASM database is migrated to ASM storage the dbcontrol (Oracle Enterprise Manager) may not discover the newly created ASM instance and does not display anything for the ASM instance on its home page. 

Add ASM instance as a target to Enterprise Manager:


Now we need to add this newly created ASM instance as a target to the Enterprise Manager agent.by following these steps.


/* 
create a file named asmTarget.xml at the location "$ORACLE_HOME/ora10.home.com_ora10g/sysman/emd/"which is the location for target.xml where  all EM targets are configured.for convention ora10.home.com is my host name and ora10g is the sid for my Oracle RDBMS instance.You should have a similar directory in your machine withwith a name of  your host and your oracle SID.
*/


/* 
create new file $ORACLE_HOME/ora10.home.com_ora10g/sysman/emd/asmTarget.xml and put the following text into it.
*/

<Target TYPE="osm_instance" NAME="+ASM_ora10.home.com">
 <Property NAME="SID" VALUE="+ASM" />
 <Property NAME="MachineName" VALUE="ora10.home.com" />
 <Property NAME="OracleHome" VALUE="/u01/app/oracle/product/10.2.0/db_1" />
 <Property NAME="UserName" VALUE="sys" />
 <Property NAME="password" VALUE="system" ENCRYPTED="FALSE"/>
 <Property NAME="Role" VALUE="sysdba" />
 <Property NAME="Port" VALUE="1521" />
</Target>

/*
  SID is the sid for your ASM instance.
  MachineName is the hostname where ASM instance is running.
  OracleHome is the ASM instance home.
  UserName is the user who can connect with ASM instance.
  Password is the password of the user.
  Role is the administrative level.
  Port is the port where Oracle Listener is listening for the ASM
  instance.
*/
Now run the following command to add this new target to EM targets.
$ emctl config agent addtarget \
> $ORACLE_HOME/ora10.home.com_ora10g/sysman/emd/asmTarget.xml
TZ set to US/Eastern
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0  
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
After the command is executed successfully, you should see these lines in the target.xml file where all EM targets are configured. Notice the encrypted password. This was done during the "emctl config agent addtarget" command.
$ tail -10 targets.xml 
<Target TYPE="osm_instance" NAME="+ASM_ora10.home.com">
 <Property NAME="SID" VALUE="+ASM"/>
 <Property NAME="MachineName" VALUE="ora10.home.com"/>
 <Property NAME="OracleHome" VALUE="/u01/app/oracle/product/10.2.0/db_1"/>
 <Property NAME="UserName" VALUE="sys"/>
 <Property NAME="password" VALUE="499f8610be848dc6" ENCRYPTED="TRUE"/>
 <Property NAME="Role" VALUE="sysdba"/>
 <Property NAME="Port" VALUE="1521"/>
</Target>
</Targets>
Now restart the dbconsole.
$ emctl stop dbconsole
TZ set to US/Eastern
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0  
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
http://ora10.home.com:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 10g Database Control ... 
 ...  Stopped. 

$ emctl start dbconsole
TZ set to US/Eastern
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0  
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
http://ora10.home.com:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 10g Database Control
 ........................... started. 
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/10.2.0
/db_1/ora10.home.com_ora10g/sysman/log
After the dbconsole is restarted open enterprise manager and now you should see your ASM instance link in the "General" section of your EM home page



No comments: