7 Replies Latest reply: Apr 4, 2012 3:09 PM by user11227249 RSS

    CRS registered resource (database) not startup at boot time

    user13005731
      My enviroment consists of a primary database and a standby database, on AIX 6.1. The crs version is as below:


      *# ./crsctl query has softwareversion*
      Oracle High Availability Services version on the local node is [11.2.0.2.0


      This is not a RAC setup, but using ASM (Grid infrastructure). I've added the database to be started on the standby to crs and can be seen using this output:
      --------------------------------------------------------------------------------
      NAME           TARGET  STATE        SERVER                   STATE_DETAILS
      --------------------------------------------------------------------------------
      Local Resources
      --------------------------------------------------------------------------------
      ora.ERPBKUP.dg
                     ONLINE  ONLINE       hqoradbbk1
      ora.LISTENER.lsnr
                     ONLINE  ONLINE       hqoradbbk1
      ora.PROD.lsnr
                     OFFLINE OFFLINE      hqoradbbk1
      ora.asm
                     ONLINE  ONLINE       hqoradbbk1               Started
      ora.hyp_db
                     OFFLINE OFFLINE      hqoradbbk1
      ora.ons
                     OFFLINE OFFLINE      hqoradbbk1
      *ora.prod_db*
                     *OFFLINE OFFLINE      hqoradbbk1*
      --------------------------------------------------------------------------------
      Cluster Resources
      --------------------------------------------------------------------------------
      ora.cssd
            1        ONLINE  ONLINE       hqoradbbk1
      ora.diskmon
            1        ONLINE  ONLINE       hqoradbbk1
      ora.evmd
            1        ONLINE  ONLINE       hqoradbbk1
      The resouce I've added is ora.prod_db, as shown above. If I query that resouce further, this is the output:
       *./crsctl status res ora.prod_db -p*
      
      NAME=ora.prod_db
      TYPE=local_resource
      ACL=owner:root:rwx,pgrp:system:r-x,other::r--
      ACTION_FAILURE_TEMPLATE=
      *ACTION_SCRIPT=/home/oraprod/prod_db_startup.scr*
      AGENT_FILENAME=%CRS_HOME%/bin/scriptagent
      ALIAS_NAME=
      AUTO_START=always
      CHECK_INTERVAL=60
      DEFAULT_TEMPLATE=
      DEGREE=1
      DESCRIPTION=
      ENABLED=1
      LOAD=1
      LOGGING_LEVEL=1
      NOT_RESTARTING_TEMPLATE=
      OFFLINE_CHECK_INTERVAL=0
      PROFILE_CHANGE_TEMPLATE=
      RESTART_ATTEMPTS=1
      SCRIPT_TIMEOUT=60
      START_DEPENDENCIES=hard(ora.ERPBKUP.dg)
      START_TIMEOUT=0
      STATE_CHANGE_TEMPLATE=
      STOP_DEPENDENCIES=
      STOP_TIMEOUT=0
      UPTIME_THRESHOLD=1h
      The action script is /home/oraprod/prod_db_startup.scr, which basically su into oracle user and start the db:

      # cat /home/oraprod/prod_db_startup.scr

      #!/bin/ksh
      su - oraprod -c startupdb.sh
      exit 1
      #cat startupdb.sh
      *sqlplus -s "/ as sysdba" << EOF*
      *startup mount;*
      *alter database recover managed standby database using current logfile disconnect;*
      *exit;*
      *EOF*
      *exit*
      If I run these scripts manually, they work. But seems wen ohas is starting up, these resouces are not automatically started. Reason i'm using customized script to auto-start the db, and not using the dbstart utility is because i've to start the database in mount mode, and begin log apply (since it's a standby database).

      Any idea?

      dula
        • 1. Re: CRS registered resource (database) not startup at boot time
          keyurPatel
          You can use crsctl modify command option to let cluster ware know that this is standby database and you want to start in mount mode instead of creating your own script. If ou would configure dg broker it would automatically start managed recovery. This way you would be able to fully automate instead of using your script.

          Also, I am not sure in non-cluster configuration, Db would be managed by ohasd. CRSD process is responsible to manage all the resource but in non-cluster environment it is not present as you can see in your output below.

          I hope this would help.
          • 2. Re: CRS registered resource (database) not startup at boot time
            696867
            I do not see a need for your own action script.

            All you need to do is add/modify your ora.prod_db with "srvctl" command. There are few caveats about OS user groups, when/how dependencies are automatically added (or not), etc. You will find it all here: http://download.oracle.com/docs/cd/E11882_01/server.112/e25494/restart005.htm#srvadddb1

            Good Luck
            • 3. Re: CRS registered resource (database) not startup at boot time
              user13005731
              Thanks a lot orafan.


              However when I add the resource using srvctl, I can't seem to start it using srvctl, though using sql plus works without any issue:
              srvctl add database -d MEDSTBY -o /oracle/medbak/product/11.2.0/dbhome_1 -n MEDPROD -p /oracle/medbak/product/11.2.0/dbhome_1/dbs/spfileMEDSTBY.ora -r PHYSICAL_STANDBY -s MOUNT -y AUTOMATIC -a "T24BKUP"
              
              
              
              
              srvctl config database -d MEDSTBY
              
              
              Database unique name: MEDSTBY
              Database name: MEDPROD
              Oracle home: /oracle/medbak/product/11.2.0/dbhome_1
              Oracle user: oragrid
              Spfile: /oracle/medbak/product/11.2.0/dbhome_1/dbs/spfileMEDSTBY.ora
              Domain:
              Start options: MOUNT
              Stop options: immediate
              Database role: PHYSICAL_STANDBY
              Management policy: AUTOMATIC
              Disk Groups: T24BKUP
              Services:
              
              srvctl start database -d MEDSTBY
              
              PRCR-1079 : Failed to start resource ora.medstby.db
              CRS-5011: Check of resource "MEDSTBY" failed: details at "(:CLSN00007:)" in "/oracle/app/oragrid/product/11.2.0/grid/log/hqoradbbk2/agent/ohasd/oraagent_oragrid/oraagent_oragrid.log"
              CRS-2674: Start of 'ora.medstby.db' on 'hqoradbbk2' failed
              ORA-01034: ORACLE not available
              ORA-27101: shared memory realm does not exist
              IBM AIX RISC System/6000 Error: 2: No such file or directory
              Process ID: 0
              Session ID: 0 Serial number: 0
              Regards,
              dula
              • 4. Re: CRS registered resource (database) not startup at boot time
                anand prakash - oracle
                Hi Dula,

                Can you provide the db_unique_name of the standby and the diskgroups that contains standby's datafiles.

                Anand
                • 5. Re: CRS registered resource (database) not startup at boot time
                  user13005731
                  Hi Anand,

                  Please find below:
                  SQL> show parameter unique
                  
                  NAME                                 TYPE        VALUE
                  ------------------------------------ ----------- ------------------------------
                  db_unique_name                       string      MEDSTBY
                  
                  
                  SQL> select name from v$asm_Diskgroup;
                  
                  NAME
                  ------------------------------
                  T24BKUP
                  regards,
                  dula
                  • 6. Re: CRS registered resource (database) not startup at boot time
                    anand prakash - oracle
                    Hi,

                    Can you recreate the resource using

                    srvctl add database -d MEDSTBY -o /oracle/medbak/product/11.2.0/dbhome_1 -p /oracle/medbak/product/11.2.0/dbhome_1/dbs/spfileMEDSTBY.ora -r physical_standby -s mount -t immediate -n MEDPROD -a T24BKUP


                    And then srvctl start daatabase -d MEDSTBY. Before starting it delete the previous one.


                    Anand
                    • 7. Re: CRS registered resource (database) not startup at boot time
                      user11227249
                      Whe I set the database in physical_standby role I still have to run recover managed standby manually....
                      Can you please tell what is wrong ---
                      18685:oracle@s3396salp> srvctl config database -d eorwp_WFMP
                      Database unique name: eorwp_WFMP
                      Database name:
                      Oracle home: /u01/app/oracle/product/11.2.0/dbhome_1
                      Oracle user: oracle
                      Spfile:
                      Domain:
                      Start options: mount
                      Stop options: immediate
                      Database role: PHYSICAL_STANDBY
                      Management policy: AUTOMATIC
                      Server pools: eorwp_WFMP
                      Database instances: WFMP2
                      Disk Groups: DG_CR1,DG_CR2,DG_CR3,DG_WFM
                      Mount point paths:
                      Services:
                      Type: RAC
                      Database is administrator managed
                      18685:oracle@s3396salp> srvctl stop database -d eorwp_wfmp
                      18685:oracle@s3396salp> srvctl start database -d eorwp_wfmp
                      18685:oracle@s3396salp> sqlplus / as sysdba

                      SQL*Plus: Release 11.2.0.2.0 Production on Wed Apr 4 15:01:04 2012

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


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

                      SQL> select process, status from v$managed_standby;

                      PROCESS STATUS
                      --------- ------------
                      ARCH CONNECTED
                      ARCH CONNECTED
                      ARCH CONNECTED
                      ARCH CONNECTED