Oracle Restart configuration after Renaming the Database – 11gR2

The Oracle Restart ensures that various Oracle components gets automatically restarted after hardware or software failures.In my last post as i had renamed the database, i had to update the OLR (Oracle Local Registry)for the database to come up automatically.

[oracle@anand-lab bin]$ ./crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       anand-lab                                    
ora.DATA02.dg
               ONLINE  ONLINE       anand-lab                                    
ora.LISTENER.lsnr
               ONLINE  ONLINE       anand-lab                                    
ora.asm
               ONLINE  ONLINE       anand-lab                Started             
ora.ons
               OFFLINE OFFLINE      anand-lab                                    
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       anand-lab                                    
ora.diskmon
      1        ONLINE  ONLINE       anand-lab                                    
ora.evmd
      1        ONLINE  ONLINE       anand-lab                                    
ora.orcl.db
      1        ONLINE  OFFLINE                               Instance Shutdown   

Now to add the database to Oracle Restart configuration we use SRVCTL utility.

[oracle@anand-lab ~]$ srvctl add database -d MATRIX -o /u01/app/oracle/product/11.2.0/dbhome_1 -n MATRIX -p '+DATA/matrix/spfilematrix.ora' -s OPEN -t IMMEDIATE -r PRIMARY -y AUTOMATIC -a "+DATA,+DATA02"
PRCR-1070 : Failed to check if resource ora.+DATA.dg is registered
Invalid resource name


[oracle@anand-lab ~]$ srvctl add database -d MATRIX -o /u01/app/oracle/product/11.2.0/dbhome_1 -n MATRIX -p '+DATA/matrix/spfilematrix.ora' -s OPEN -t IMMEDIATE -r PRIMARY -y AUTOMATIC -a "DATA,DATA02"
[oracle@anand-lab ~]$ 

This added the entry in OLR which can be seen by dumping it using ocrdump -local command.OHASD log shows

2011-06-21 15:10:07.871: [UiServer][2980248464] {0:0:189} processMessage called 
2011-06-21 15:10:07.871: [UiServer][2980248464] {0:0:189} Container [ Name: UI_REGISTER
        ATTR_LIST: 
        TextMessage[AGENT_FILENAME=%CRS_HOME%/bin/oraagent%CRS_EXE_SUFFIX%CHECK_INTERVAL=1CHECK_TIMEOUT=30CLUSTER_DATABASE=falseDATABASE_TYPE=SINGLEDB_UNIQUE_NAME=MATRIXDEFAULT_TEMPLATE=PROPERTY(RESOURCE_CLASS=database) PROPERTY(DB_UNIQUE_NAME= CONCAT(PARSE(%NAME%, ., 2), %USR_ORA_DOMAIN%, .)) ELEMENT(INSTANCE_NAME= %GEN_USR_ORA_INST_NAME%) ELEMENT(DATABASE_TYPE= %DATABASE_TYPE%)DESCRIPTION=Oracle Database resourceFAILURE_INTERVAL=60FAILURE_THRESHOLD=1GEN_AUDIT_FILE_DEST=GEN_START_OPTIONS=GEN_USR_ORA_INST_NAME=INSTANCE_FAILOVER=1MANAGEMENT_POLICY=AUTOMATICONLINE_RELOCATION_TIMEOUT=0ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1RESTART_ATTEMPTS=2ROLE=PRIMARYSERVER_POOLS=SPFILE=+DATA/matrix/spfilematrix.oraSTART_TIMEOUT=600STOP_TIMEOUT=600TYPE=ora.database.typeTYPE_VERSION=2.2USR_ORA_DB_NAME=MATRIXUSR_ORA_DOMAIN=USR_ORA_FLAGS=USR_ORA_INST_NAME=MATRIXUSR_ORA_OPEN_MODE=openUSR_ORA_OPI=
2011-06-21 15:10:07.871: [UiServer][2980248464]falseUSR_ORA_STOP_MODE=immediateVERSION=11.2.0.2.0PLACEMENT=balancedACL=owner:oracle:rwx,pgrp:dba:r-x,other::r--,group:oinstall:r-x,user:oracle:rwxCARDINALITY=1START_DEPENDENCIES=hard(ora.DATA.dg,ora.DATA02.dg) weak(type:ora.listener.type,uniform:ora.ons) pullup(ora.DATA.dg,ora.DATA02.dg)STOP_DEPENDENCIES=hard(intermediate:ora.asm,shutdown:ora.DATA.dg,shutdown:ora.DATA02.dg)]
        CLIENT: 
        TextMessage[]
        CLIENT_PRIMARY_GROUP: 
        TextMessage[oinstall]
        LOCALE: 
        TextMessage[AMERICAN_AMERICA.US7ASCII]
        QUEUE_TAG: 
        TextMessage[1]
        RESOURCE: 
        TextMessage[ora.matrix.db]
]
2011-06-21 15:10:07.871: [UiServer][2980248464] {0:0:189} Sending message to PE. ctx= 0xb7d0350
2011-06-21 15:10:07.872: [UiServer][2980248464] {0:0:189} Sending command to PE: 124
2011-06-21 15:10:07.872: [   CRSPE][2982349712] {0:0:189} Cmd : 0xb3507cd8 : flags: QUEUE_TAG
2011-06-21 15:10:07.872: [   CRSPE][2982349712] {0:0:189} Processing PE command id=226. Description: [Register|Update Resource :  : 0xb3507cd8]
2011-06-21 15:10:07.881: [   CRSPE][2982349712] {0:0:189} DM flushing its state to repository.ri_seed = 100, config version = 83
2011-06-21 15:10:07.883: [  CRSOCR][2990754704] {0:0:189} Multi Write Batch processing...
2011-06-21 15:10:08.001: [   CRSPE][2982349712] {0:0:189} Resource ora.matrix.db has been registered with the PE data model:0xb350e8b8
2011-06-21 15:10:08.001: [   CRSPE][2982349712] {0:0:189} PE Command [ Register|Update Resource : ora.matrix.db : 0xb3507cd8 ] has completed
2011-06-21 15:10:08.001: [   CRSPE][2982349712] {0:0:189} UI Command [Register|Update Resource : ora.matrix.db : 0xb3507cd8] is replying to sender. 
2011-06-21 15:10:08.002: [  CRSOCR][2990754704] {0:0:189} Multi Write Batch done.
2011-06-21 15:10:08.003: [  CRSRPT][2980248464] {0:0:189} Published to EVM CRS_RESOURCE_PROFILE_CHANGE for ora.matrix.db
2011-06-21 15:10:08.003: [UiServer][2980248464] {0:0:189} Container [ Name: UI_DATA
        ora.matrix.db: 
        TextMessage[0]
]
2011-06-21 15:10:08.006: [UiServer][2980248464] {0:0:189} Done for ctx=0xb7d0350

Checking the status

[oracle@anand-lab bin]$ ./crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       anand-lab                                    
ora.DATA02.dg
               ONLINE  ONLINE       anand-lab                                    
ora.LISTENER.lsnr
               ONLINE  ONLINE       anand-lab                                    
ora.asm
               ONLINE  ONLINE       anand-lab                Started             
ora.ons
               OFFLINE OFFLINE      anand-lab                                    
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       anand-lab                                    
ora.diskmon
      1        ONLINE  ONLINE       anand-lab                                    
ora.evmd
      1        ONLINE  ONLINE       anand-lab                                    
ora.matrix.db
      1        OFFLINE OFFLINE                                                   
ora.orcl.db
      1        ONLINE  OFFLINE                               Instance Shutdown   

The TARGET and STATE for db shows OFFLINE. If the instance is up from before (using sqlplus), in that case using “srvctl start database -d ” to start the database,aborts the instance and restarts it again.OS, shutdown the database from sqlplus and then start using srvctl command.

[oracle@anand-lab ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Tue Jun 21 16:48:51 2011

Copyright (c) 1982, 2010, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> shu immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> 
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
[oracle@anand-lab ~]$ srvctl config database -d MATRIX
Database unique name: MATRIX
Database name: MATRIX
Oracle home: /u01/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: +DATA/matrix/spfilematrix.ora
Domain: 
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Disk Groups: DATA,DATA02
Services: 
[oracle@anand-lab ~]$ srvctl start database -d MATRIX
[oracle@anand-lab ~]$ 
[oracle@anand-lab bin]$ ./crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       anand-lab                                    
ora.DATA02.dg
               ONLINE  ONLINE       anand-lab                                    
ora.LISTENER.lsnr
               ONLINE  ONLINE       anand-lab                                    
ora.asm
               ONLINE  ONLINE       anand-lab                Started             
ora.ons
               OFFLINE OFFLINE      anand-lab                                    
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       anand-lab                                    
ora.diskmon
      1        ONLINE  ONLINE       anand-lab                                    
ora.evmd
      1        ONLINE  ONLINE       anand-lab                                    
ora.matrix.db
      1        ONLINE  ONLINE       anand-lab                Open                
ora.orcl.db
      1        ONLINE  OFFLINE                               Instance Shutdown   

Remove the ORCL info using “srvctl remove database -d ORCL”.

One thought on “Oracle Restart configuration after Renaming the Database – 11gR2

  1. Hi,

    This was my exam question, still not sure about the answer.
    Any help is much appreciatedl

    You are creating a resource definition called webapp for a web-based application that runs application called webvip
    Both webapp and webvip are normally active on a single node, but may failover if required to another cluster node in your eight node cluster.
    A second VIP application resource called appsvip exists, used by a second application resource called secapp.
    Webvip and webapp must start in correct sequence.
    Which two start dependincies would you use for the WEbapp application resource definition

    a-)hard(SECAPP)
    b-)pullup (SECAPP)
    c-)pullup(WEBVIP)
    d-)hard (WEBVIP)
    e-)dispersion (WEBVIP)
    f-)weak (WEBVIP)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s