Monday, August 11, 2008

PRKP-1029, CRS-0211 on srvctl modify/add service

What I was trying to do:
My requirement was to change the preferred node and available node for a service.
Issues:
srvctl modify service -d ORCL -s BULK -i node3,node4 -a node1,node2
PRKP-1029 : Failed to register the service ORCL_BULK_svc.
CRS-0211: Resource 'ora.ORCL.ORCL_BULK_svc.cs' has already been reg
istered.

I tried the above command a couple of time, but gave the same error. I decided to stop the service and then try.
I decided to stop the service:
srvctl stop service -d ORCL -s BULK.
The service stopped without any issue.

But even after stopping the service, it gave the same error.

The I decided to remove the service and recreate it with the required configuration.
srvctl remove service -d ORCL -s BULK
Service got removed without any issue.

Now tried to add the service:
srvctl add service -d ORCL -s BULK -r node3,node4 -a node1,node2
PRKP-1029 : Failed to register the service ORCL_BULK_svc.
CRS-0211: Resource 'ora.ORCL.ORCL_BULK_svc.cs' has already been registered.

BAAAM, the error was not supposed to come, as I had already removed the service. Interestingly, I checked the DBA_SERVICES and still saw the entry of this service there. And also crs_stat showed this service.
Now I was in a soup as one of the most important application could not connect. Check with metalink/web the only thing I found was to "contact support". Turned to a couple of colleagues and got the suggestion to use crs_unregister. This is not a recommended thing to do, but I was in dire straits.

SO this is what we did:
crs_unregister ora.ORCL.ORCL_BULK_svc.cs

srvctl add service -d ORCL -s BULK -r node3,node4 -a node1,node2
PRKP-1029 : Failed to register the service ORCL_BULK_svc.
CRS-0211: Resource 'ora.ORCL.ORCL_BULK_svc.ORCL.srv' has already been registered.


crs_unregister ora.ORCL.ORCL_BULK_svc.ORCL.srv

srvctl add service -d ORCL -s BULK -r node3,node4 -a node1,node2
PRKP-1029 : Failed to register the service ORCL_BULK_svc.
CRS-0211: Resource 'ora.ORCL.ORCL_BULK_svc.cs' has already been registered.

We had already unregistered this one, but it gave the error for the same thing again. We ran the unregister once again:

crs_unregister ora.ORCL.ORCL_BULK_svc.cs

Looks like the sequence is to first remove the .srv and then the .cs:

crs_unregister ora.ORCL.ORCL_BULK_svc.ORCL.srv
CRS-0210: Could not find resource 'ora.ORCL.ORCL_BULK_svc.ORCL.srv'.

crs_unregister ora.ORCL.ORCL_BULK_svc.cs
CRS-0210: Could not find resource 'ora.ORCL.ORCL_BULK_svc.cs'.

Finally:
srvctl add service -d ORCL -s BULK -r node3,node4 -a node1,node2
and now it worked. And I started the service.

Details on crs_unregister from Oracle:

The crs_unregister command removes the registration information of Oracle Clusterware resources from the binary Oracle Clusterware registry database. The Oracle Clusterware will no longer acknowledge this resource. An application associated with a resource that is unregistered is no longer highly available. You must have full administrative privileges to use this command.

Upon successful completion of the crs_unregister command, the resource is removed from the online Oracle Clusterware environment. You cannot unregister a resource that is a required resource for another resource. You must stop the resource by using the crs_stop command before unregistering it.
Syntax and Options for crs_unregister

Use the crs_unregister command with the following syntax:

crs_unregister resource_name [...] [-q]

The only option available for this command is -q, that runs the crs_unregister command in quiet mode, which means no messages are displayed.
Example of crs_unregister

The following example unregisters a highly available application called postman:

crs_unregister postman

Errors for crs_unregister

Oracle displays a corresponding text message for the following error conditions:

* No root privilege
* CAA daemon is not running
* The application is running
* The application is not registered

10 Comments:

Anonymous said...

Hi,

Want to know more about crs_unregister option . In my setup whenever I run this below command

./crs_unregister ora.Node1.ASM1.asm

it gives error like
CRS-0214: Could not unregister resource 'ora.Node1.ASM1.asm

but when I am try to look the statu s for ASM from SRVCTL, it gives nothing...so It's really unregister or not?

Please give some idea on this...

Apun Hiran said...

Hello,
Have you checked using crs_stat if ASM shows up. If it does show up, try stopping ASM resource using crs-stop -f ora.Node1.ASM1.asm.
And then try to use crs_unregister. Then to confirm please check crs_stat and see if the resource has got removed.
Regards
Apun

Anonymous said...

Hello,

your post was very helpful! I had the same issue after a RAC DB installation failed. I was not able to find anything on Metalink, related to this issue.

Regards,
Bernd

Anonymous said...

$ crs_stop ora.fdxxxxx2t.ASM1.asm -f
Target set to OFFLINE for `ora.sattrain.sattrain1.inst`
Target set to OFFLINE for `ora.satelint.satelint1.inst`
Target set to OFFLINE for `ora.elistint.elistint1.inst`
Target set to OFFLINE for `ora.dartrain.dartrain1.inst`
Target set to OFFLINE for `ora.darnwint.darnwint1.inst`
Target set to OFFLINE for `ora.fdxxxxx2t.ASM1.asm`

-bash-3.00$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....OINT.cs application ONLINE OFFLINE
ora....nt1.srv application ONLINE OFFLINE
ora....nt2.srv application ONLINE OFFLINE
ora....RINT.cs application ONLINE OFFLINE
ora....nt1.srv application ONLINE OFFLINE
ora....nt2.srv application ONLINE OFFLINE
ora....t1.inst application OFFLINE OFFLINE
ora....t2.inst application OFFLINE OFFLINE
ora....wint.db application ONLINE OFFLINE
ora....xint.cs application ONLINE OFFLINE
ora....nt1.srv application ONLINE OFFLINE
ora....nt2.srv application ONLINE OFFLINE
ora....n1.inst application OFFLINE OFFLINE
ora....n2.inst application OFFLINE OFFLINE
ora....rain.db application ONLINE OFFLINE
ora....TEST.cs application OFFLINE OFFLINE
ora....nt1.srv application ONLINE OFFLINE
ora....tint.db application ONLINE OFFLINE
ora....t1.inst application OFFLINE OFFLINE
ora....t2.inst application OFFLINE OFFLINE
ora....SM1.asm application OFFLINE OFFLINE
ora....2T.lsnr application ONLINE ONLINE fdxxxxx2t
ora....12t.gsd application ONLINE ONLINE fdxxxxx2t
ora....12t.ons application ONLINE ONLINE fdxxxxx2t
ora....12t.vip application ONLINE ONLINE fdxxxxx2t
ora....SM2.asm application OFFLINE OFFLINE
ora....3T.lsnr application ONLINE ONLINE fdxxxxx3t
ora....13t.gsd application ONLINE ONLINE fdxxxxx3t
ora....13t.ons application ONLINE ONLINE fdxxxxx3t
ora....13t.vip application ONLINE ONLINE fdxxxxx3t
ora....lint.db application ONLINE OFFLINE
ora....xint.cs application OFFLINE OFFLINE
ora....nt1.srv application ONLINE OFFLINE
ora....nt2.srv application ONLINE OFFLINE
ora....t1.inst application OFFLINE OFFLINE
ora....t2.inst application OFFLINE OFFLINE
ora....rain.db application ONLINE OFFLINE
ora....n1.inst application OFFLINE OFFLINE
ora....n2.inst application OFFLINE OFFLINE


-bash-3.00$ crs_unregister ora.fdxxxxx2t.ASM1.asm
Can't unregister `ora.fdxxxxx2t.ASM1.asm` because it is required by other resources.
CRS-0214: Could not unregister resource 'ora.fdxxxxx2t.ASM1.asm'.

Still not able to unregister ASM?

Anonymous said...

$ crs_stop ora.fdxxxxx2t.ASM1.asm -f
Target set to OFFLINE for `ora.sattrain.sattrain1.inst`
Target set to OFFLINE for `ora.satelint.satelint1.inst`
Target set to OFFLINE for `ora.elistint.elistint1.inst`
Target set to OFFLINE for `ora.dartrain.dartrain1.inst`
Target set to OFFLINE for `ora.darnwint.darnwint1.inst`
Target set to OFFLINE for `ora.fdxxxxx2t.ASM1.asm`

-bash-3.00$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....OINT.cs application ONLINE OFFLINE
ora....nt1.srv application ONLINE OFFLINE
ora....nt2.srv application ONLINE OFFLINE
ora....RINT.cs application ONLINE OFFLINE
ora....nt1.srv application ONLINE OFFLINE
ora....nt2.srv application ONLINE OFFLINE
ora....t1.inst application OFFLINE OFFLINE
ora....t2.inst application OFFLINE OFFLINE
ora....wint.db application ONLINE OFFLINE
ora....xint.cs application ONLINE OFFLINE
ora....nt1.srv application ONLINE OFFLINE
ora....nt2.srv application ONLINE OFFLINE
ora....n1.inst application OFFLINE OFFLINE
ora....n2.inst application OFFLINE OFFLINE
ora....rain.db application ONLINE OFFLINE
ora....TEST.cs application OFFLINE OFFLINE
ora....nt1.srv application ONLINE OFFLINE
ora....tint.db application ONLINE OFFLINE
ora....t1.inst application OFFLINE OFFLINE
ora....t2.inst application OFFLINE OFFLINE
ora....SM1.asm application OFFLINE OFFLINE
ora....2T.lsnr application ONLINE ONLINE fdxxxxx2t
ora....12t.gsd application ONLINE ONLINE fdxxxxx2t
ora....12t.ons application ONLINE ONLINE fdxxxxx2t
ora....12t.vip application ONLINE ONLINE fdxxxxx2t
ora....SM2.asm application OFFLINE OFFLINE
ora....3T.lsnr application ONLINE ONLINE fdxxxxx3t
ora....13t.gsd application ONLINE ONLINE fdxxxxx3t
ora....13t.ons application ONLINE ONLINE fdxxxxx3t
ora....13t.vip application ONLINE ONLINE fdxxxxx3t
ora....lint.db application ONLINE OFFLINE
ora....xint.cs application OFFLINE OFFLINE
ora....nt1.srv application ONLINE OFFLINE
ora....nt2.srv application ONLINE OFFLINE
ora....t1.inst application OFFLINE OFFLINE
ora....t2.inst application OFFLINE OFFLINE
ora....rain.db application ONLINE OFFLINE
ora....n1.inst application OFFLINE OFFLINE
ora....n2.inst application OFFLINE OFFLINE


-bash-3.00$ crs_unregister ora.fdxxxxx2t.ASM1.asm
Can't unregister `ora.fdxxxxx2t.ASM1.asm` because it is required by other resources.
CRS-0214: Could not unregister resource 'ora.fdxxxxx2t.ASM1.asm'.

Still can not remove ASM

Apun Hiran said...

The error you have mentioned is different. It say that there are dependencies on the ASM resource.
Did u run the following commands to remove ASM, before trying the unregister:
srvctl stop asm -n < node name>

srvctl remove asm -n < node name>

srvctl remove asm -n < node name> -f
and then
crs_unregister < resource_name> -f

It is a little different with ASM and other services.

Neil said...

Cool man... I had issue on my prod... Google search direct hit on your page and problem saolved in 5 minutes... This called power of sharing your knowledge..

many thanks...

Anonymous said...

Hi ,

Thanks for the suggestion. I cancelled the create service after issuing srvctl create and it didnt allow me to drop it .Then followed the above unregister to drop and recreate .Worked like a charm

Anonymous said...

In 11gR2
crsctl delete resource command is used in place of crs_unregister

Arpan Shrivastava said...

In 11gR2 crsctl delete resource replaces crs_unregister and crsctl add resource replaces crs_register.

Steps to unregister/delete a resource in 11gR2:

Check if the resource is running:
srvctl status service -d test11g -s testing_svc

Get the actual resource name:
crsctl status resource -t |grep testing

The name is : ora.test11g.testing_svc.svc

Delete/Unregister the resource:
crsctl delete resource ora.test11g.testing_svc.svc

CRS-2586: Deletion of a running resource 'ora.test11g.testing_svc.svc' requires the force option
CRS-4000: Command Delete failed, or completed with errors.

Use the force option if the resource is running:

crsctl delete resource ora.test11g.testing_svc.svc -f