Monday, 20 March 2017

How to modify resource dependencies in CRS


I wanted to change the diskgroup used for flash recovery area. So I created a new diskgroup and updated the parameters

SQL> show parameter db_recovery_file_dest 

db_recovery_file_dest string +RACFRA

SQL> alter system set db_recovery_file_dest=’+FRA’

System altered.

SQL> show parameter db_recovery_file_dest

db_recovery_file_dest string +FRA

Also removed the old diskgroup

SQL> drop diskgroup RACFRA

Diskgroup dropped.

After that shutdown the database for some maintenance. But when I tried starting it back, it started throwing
following error
oragrid@node-20> srvctl start database -d mydb
PRCR-1079 : Failed to start resource ora.mydb.db
CRS-2640: Required resource ‘ora.RACFRA.dg’ is missing.
I was not sure, what exactly happened. As I already dropped this diskgroup, database & ASM diskgroup
dependency should have been removed. But error message was indicating something else
So my first check, was to see if the resource was still present


oragrid@node-20> crsctl stat res -t
——————————————————————————–
NAME TARGET STATE SERVER STATE_DETAILS
——————————————————————————–
Local Resources
——————————————————————————–


ora.FRA.dg
ONLINE ONLINE node-20
ONLINE ONLINE node-21
ora.LISTENER.lsnr
ONLINE ONLINE node-20
ONLINE ONLINE node-21
ora.DG.dg
ONLINE ONLINE node-20
ONLINE ONLINE node-21
ora.DG2.dg
ONLINE ONLINE node-20
ONLINE ONLINE node-21
ora.DG3.dg
ONLINE ONLINE node-20
ONLINE ONLINE node-21
ora.DG4.dg
ONLINE ONLINE node-20
ONLINE ONLINE node-21
ora.asm
ONLINE ONLINE node-20 Started
ONLINE ONLINE node-21 Started
ora.eons
ONLINE ONLINE node-20
ONLINE ONLINE node-21
ora.gsd
OFFLINE OFFLINE node-20
OFFLINE OFFLINE node-21
ora.net1.network
ONLINE ONLINE node-20
ONLINE ONLINE node-21
ora.ons
ONLINE ONLINE node-20
ONLINE ONLINE node-21
——————————————————————————–
Cluster Resources
——————————————————————————–
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE node-21
ora.oc4j
1 OFFLINE OFFLINE
ora.node-20.vip
1 ONLINE ONLINE node-20
ora.node-21.vip
1 ONLINE ONLINE node-21
ora.scan1.vip
1 ONLINE ONLINE node-21
ora.mydb.db
1 OFFLINE OFFLINE Instance Shutdown
2 OFFLINE OFFLINE Instance Shutdown


crsctl output did not show this diskgroup. So checked the dependency for the database resource
# crsctl status resource ora.mydb.db -f
Where I found, that START_DEPENDENCIES still have reference to old diskgroup. So removed, re-added the


database & associated instances
oragrid@node-21> srvctl remove database -d mydb
oragrid@node-21> srvctl add database -d mydb -o /oracle/11gr2
ora11gr2@node-21> srvctl add instance -d mydb -i mydb1 -n node-20
ora11gr2@node-21> srvctl add instance -d mydb -i mydb2 -n node-21
Again checked the dependency for the database resource
# crsctl status resource ora.mydb.db -f
This time START_DEPENDENCIES was having correct set of ASM diskgroups & the old DG reference was
removed.

Now started the database, all was fine.
oragrid@node-21> srvctl start database -d mydb
So to avoid this problem, we should be using srvctl remove diskgroup, instead of using sqlplus.



No comments:

Post a Comment