Manually adding a component to the OCR

If for whatever reason you need to add a component to the OCR, and the corresponding GUI is not cooperating, you can manually add it. This afternoon, I had to add a new node to a cluster. When I tried to add the listener on the new node, netca kept complaining about the listener already existing, when it in fact didn’t. OK, it probably had a good reason for thinking it did exist, but I couldn’t find it. I think it may be that the listener name to be registered already existed in the listener.ora file.

As an alternative, I used crs_stat and crs_register to manually add them. In the case of a listener, the easiest way to is to get a cap file for another listener already in the cluster and then edit it.

linux1:oracle:tst10g2:/home/oracle>./crsstat.ksh | grep LISTEN
ora.linux1.LISTENER_LINUX1.lsnr               ONLINE     ONLINE on linux1
ora.linux2.LISTENER_LINUX2.lsnr               ONLINE     ONLINE on linux2
linux1:oracle:tst10g2:/home/oracle>$ORA_CRS_HOME/bin/crs_stat -p ora.linux1.LISTENER_LINUX1.lsnr
NAME=ora.linux1.LISTENER_LINUX1.lsnr
TYPE=application
ACTION_SCRIPT=/u01/app/oracle/product/10.2.0/bin/racgwrap
ACTIVE_PLACEMENT=0
AUTO_START=1
CHECK_INTERVAL=600
DESCRIPTION=CRS application for listener on node
FAILOVER_DELAY=0
FAILURE_INTERVAL=0
FAILURE_THRESHOLD=0
HOSTING_MEMBERS=linux1
OPTIONAL_RESOURCES=
PLACEMENT=restricted
REQUIRED_RESOURCES=ora.linux1.vip
RESTART_ATTEMPTS=5
SCRIPT_TIMEOUT=600
START_TIMEOUT=0
STOP_TIMEOUT=0
UPTIME_THRESHOLD=7d
USR_ORA_ALERT_NAME=
USR_ORA_CHECK_TIMEOUT=0
USR_ORA_CONNECT_STR=/ as sysdba
USR_ORA_DEBUG=0
USR_ORA_DISCONNECT=false
USR_ORA_FLAGS=
USR_ORA_IF=
USR_ORA_INST_NOT_SHUTDOWN=
USR_ORA_LANG=
USR_ORA_NETMASK=
USR_ORA_OPEN_MODE=
USR_ORA_OPI=false
USR_ORA_PFILE=
USR_ORA_PRECONNECT=none
USR_ORA_SRV=
USR_ORA_START_TIMEOUT=0
USR_ORA_STOP_MODE=immediate
USR_ORA_STOP_TIMEOUT=0
USR_ORA_VIP=

linux1:oracle:tst10g2:/home/oracle>

Take the output of the crs_stat -p command above and add it to a file with a similar profile name, such as ora.linux3.LISTENER_LINUX3.lsnr. This file must have .cap appended to the name, i.e., ora.linux3.LISTENER_LINUX3.lsnr.cap

Edit the file to change the relevant pieces (host name in this case).

You can then either:

1) Place the file under $ORA_CRS_HOME/crs/public
2) Place it in an arbitrary location and tell the crs_register executable where it is

If you choose 1) above, then you must simply issue the following:

crs_register ora.linux3.LISTENER_LINUX3.lsnr

If you choose 2), you can issue the following:

crs_register -dir directory_where_you_put_the_cap_file ora.linux3.LISTENER_LINUX3.lsnr

Notice you don’t append the .cap to the resource name to be registered.

In the case of a listener, you also must have the corresponding entry in the listener.ora on the affected node.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.