How To Un-Register A Service

RATIONALE

You might be trying to issue an SRVCTL ADD SERVICE command for a service which has been previously removed but are presented with error messages such as:

      PRKP-1029 : Failed to register the service OMS_WEBM.
      CRS-0211: Resource 'ora.JSPSOL30.OMS_WEBM.cs' has already been registered.

In such cases you will need to unregister the service with the OCR before recreating. The service name used in the example below is OMS_ONLINE.

KEY

   * UNIX>      denotes a unix command
   * SQL>       denotes a SQL*Plus command

CHECK THE INTEGRITYOF THE OCR

The OCRCHECK utility is a diagnostic tool used for verifying the Oracle Cluster Registry (OCR). It displays the version of the OCR’s block format, total space available and used space, OCRID, and the OCR locations configured.

OCRCHECK performs a block-by-block checksum operation for all of the blocks in all of the OCRs that are configured. It also returns an individual status for each file as well as a result for the overall OCR integrity check.

The following commands are issued from Unix as the oracle user

  • UNIX> cd $ORACLE_HOME/bin
  • UNIX> ./ocrcheck
     Status of Oracle Cluster Registry is as follows :
     Version                  :          2
     Total space (kbytes)     :     204560
     Used space (kbytes)      :       5884
     Available space (kbytes) :     198676
     ID                       : 1906009051
     Device/File Name         : /dev/rdsk/emcpower4a
                                Device/File integrity check succeeded
                                Device/File not configured
     Cluster registry integrity check succeeded
  • Fig. 1 Example output from the ocrcheck command

BACKUP THE OCR

Take a logical backup of the OCR which can be used to restore from if required. The OCRCONFIG command must be run as the *root* user.

  • UNIX> su - root
  • UNIX> cd /u01/app/crs/product/10.2.0/bin
  • UNIX> ./ocrconfig -export /home/oracle/ocr_export_filename.dmp
  • UNIX> exit

SPOOL CURRENT SERVICE DEFINITIONS

Create a listing of the current services for reference. This is run as the oracle user from SQL*Plus

  • SQL> set lines 132
  • SQL> col name for a20
  • SQL> col network_name for a30
  • SQL> spool service.lst
  • SQL> select SERVICE_ID,NAME,NETWORK_NAME,GOAL,DTP,AQ_HA_NOTIFICATIONS ,CLB_GOAL from DBA_SERVICES;
      SERVICE_ID NAME                 NETWORK_NAME                   GOAL         D AQ_ CLB_G
      ---------- -------------------- ------------------------------ ------------ - --- -----
               1 SYS$BACKGROUND                                      NONE         N NO  SHORT
               2 SYS$USERS                                           NONE         N NO  SHORT
               3 seeddataXDB          seeddataXDB                                 N NO  LONG
               4 seeddata             seeddata                                    N NO  LONG
               5 JSUSOL8XDB           JSUSOL8XDB                                  N NO  LONG
               6 JSUSOL80             JSUSOL80                                    N NO  LONG
               7 OMS_ONLINE           OMS_ONLINE                     NONE         N NO  LONG
               8 OMS_DSS              OMS_DSS                        NONE         N NO  LONG
               9 OMS_STORE            OMS_STORE                      NONE         N NO  LONG
              10 OMS_WEBM             OMS_WEBM                       NONE         N NO  LONG
              12 SYS.KUPC$S_1_2010041 SYS$SYS.KUPC$S_1_2010041216420 NONE         N NO  LONG
  • Fig. 2 Example output from dba_services view
  • SQL> spool off
  • SQL> exit

UN-REGISTER THE SERVICE

The crs_stat –l command will produce a list of all services registered and whether they are Online. Scroll through that list, we are looking for those services with a suffix of .srv associated with OMS_ONLINE. Run this as oracle

  • UNIX> cd $ORACLE_HOME
  • UNIX> ./crs_stat -l
      NAME=ora.JSPSOL30.OMS_ONLINE.JSPSOL31.srv
      TYPE=application
      TARGET=OFFLINE
      STATE=OFFLINE

      NAME=ora.JSPSOL30.OMS_ONLINE.JSPSOL32.srv
      TYPE=application 
      TARGET=OFFLINE
      STATE=OFFLINE
  • Fig. 3 Partial output from crstat command
  • UNIX> ./crs_unregister ora.JSPSOL30.OMS_ONLINE.JSPSOL31.srv
  • UNIX> ./crs_unregister ora.JSPSOL30.OMS_ONLINE.JSPSOL32.srv

CHECK THAT THE SERVICE HAS BEEN REMOVED

The following command should produce no output if the un-register command has worked.

  • UNIX> ./crs_stat –l | grep OMS_ONLINE

You can now recreate the service.

© copyright 2001-2014 ABCdba.com | all rights reserved