Quite often you can get Oracle RAC resources in an unknown state and this is quite annoying because you won’t be able to use srvctl to manage that resource, to start and stop them.
There is a way to fix it and I’m going to show you how I solved that in a 2 node Exadata RAC.
Let’s first check a resource that is in an unknow state:
[oracle@xjhd01db02:PRO02INT2 ~]$ crsctl status res ora.pro02int.db -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.pro02int.db
1 ONLINE ONLINE xjhd01db01 Open,HOME=/u01/app/o
racle/product/19.0.0
.0/dbhome_1,STABLE
2 ONLINE UNKNOWN xjhd01db02 STABLE
--------------------------------------------------------------------------------
The resource in node 2 is in unknown state.
First I try to stop and remove the instance, but the cluster won’t let me.
[oracle@xjhd01db02:PRO02INT2 ~]$ srvctl stop instance -d PRO02INT -i PRO02INT2
PRCR-1191 : The stop request failed because the resource is not running on nodes xjhd01db02.
[oracle@xjhd01db02:PRO02INT2 ~]$ srvctl remove instance -d PRO02INT -i PRO02INT2
Remove instance from the database PRO02INT? (y/[n]) y
PRKO-3147 : Instance PRO02INT2 cannot be removed because it is the only preferred instance for service(s) PRO02INT_bkup1,PRO02INT_bkup2 for database PRO02INT
It says I can’t remove the instance because two services have that instance as preferred.
I modify those resources to have the other instance as preferred.
[oracle@xjhd01db02:PRO02INT2 ~]$ srvctl modify service -d PRO02INT -s PRO02INT_bkup1 -n -i PRO02INT1
[oracle@xjhd01db02:PRO02INT2 ~]$ srvctl modify service -d PRO02INT -s PRO02INT_bkup2 -n -i PRO02INT1
So now I can remove the instance and add it again.
[oracle@xjhd01db02:PRO02INT2 ~]$ srvctl remove instance -d PRO02INT -i PRO02INT2
Remove instance from the database PRO02INT? (y/[n]) y
[oracle@xjhd01db02:PRO02INT2 ~]$ srvctl add instance -d PRO02INT -i PRO02INT2 -n xjhd01db02
I check again and I find the resource is now offline.
Good news 🙂
[oracle@xjhd01db02:PRO02INT2 ~]$ crsctl status res ora.pro02int.db -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.pro02int.db
1 ONLINE ONLINE xjhd01db01 Open,HOME=/u01/app/o
racle/product/19.0.0
.0/dbhome_1,STABLE
2 OFFLINE OFFLINE STABLE
--------------------------------------------------------------------------------
Now I can start the instance.
[oracle@xjhd01db02:PRO02INT2 ~]$ srvctl start instance -d PRO02INT -i PRO02INT2
I check the services and everything is working fine.
[oracle@xjhd01db02:PRO02INT2 ~]$ srvctl status database -d PRO02INT
Instance PRO02INT1 is running on node xjhd01db01
Instance PRO02INT2 is running on node xjhd01db02
[oracle@xjhd01db02:PRO02INT2 ~]$ srvctl status service -d PRO02INT
Service PRO02INT_bkup1 is running on instance(s) PRO02INT1
Service PRO02INT_bkup2 is running on instance(s) PRO02INT1
Service PRO02INTplug is running on instance(s) PRO02INT1
I hope this was helpful.