Change AUTO_START in ASM Resource Oracle Clusterware

oracle_ace發表於2009-10-15
     When a node stops and restarts, Oracle Clusterware starts the instance as soon as the node starts. This may not be desirable because instance startup might fail if system components on which the instance depends, such as a volume manager or a file system, are not running. This is especially true if Oracle Clusterware does not manage the system component resources on which the instance depends. To manage automatic restarts, you can use the AUTO_START attribute to specify whether Oracle Clusterware should automatically start a resource when a node restarts. Valid AUTO_START values are:

    *0 always—Causes the resource to restart when the node restarts regardless of the resource's state when the node stopped.
    *1 restore—Does not start the resource at restart time if it was in an offline state, such as STATE=OFFLINE, TARGET=OFFLINE, when the node stopped. The resource is restored to its state when the node went down. The resource is started only if it was online before and not otherwise. This is the default value.s
    *2 never—The Oracle Clusterware never restarts the resource regardless of the resource's state when the node stopped.

    This approach uses profiles for CRS resources. There are some profile parameters which oracle does not recommend to change like "check_interval" for listeners. However you could safely set parameters like "auto_start" and "restart_attempts" according to your needs. They does not affect anything but help us according to our needs. I however do not prefer simply disabling the asm via srvctl command because, if somebody needs to check which resource parameter was modified, then you have to explicitly type crs_stat -p to check the resource properties. However if you create profiles like i did then you could simply check the current properties and your profile properties and change as you like.

    # /u01/oracle/product/crs/bin/crsctl start crs
    Attempting to start Oracle Clusterware stack
    The CRS stack will be started shortly

    $ crs_stat -t

    Name Type Target State Host
    ------------------------------------------------------------
    ora.oratest01.ASM1.asm OFFLINE OFFLINE
    ora.oratest01.LISTENER_ORATEST01.lsnr ONLINE ONLINE on oratest01
    ora.oratest01.gsd ONLINE ONLINE on oratest01
    ora.oratest01.ons ONLINE ONLINE on oratest01
    ora.oratest01.vip ONLINE ONLINE on oratest01

ASM1 didn't start automatic, try to manual start it:

    $ srvctl start asm -n oratest01

    $ crs_stat -t
    ora.oratest01.ASM1.asm ONLINE ONLINE on oratest01

That can start +ASM1 by manual, What's happened?

    $ /u01/oracle/product/crs/bin/crs_stat | grep NAME\= | grep asm
    NAME=ora.oratest01.ASM1.asm

    $ /u01/oracle/product/crs/bin/crs_stat -p ora.oratest01.ASM1.asm
    NAME=ora.oratest01.ASM1.asm
    TYPE=application
    ACTION_SCRIPT=/u01/oracle/product/11.1.0/asm/bin/racgwrap
    ACTIVE_PLACEMENT=0
    AUTO_START=2

that showed auto_start=2: This means, after node reboot or when Oracle Clusterware is started, resources with AUTO_START=2 will need to be started
manually via srvctl.

have to change AUTO_START=1, How? (contact oracle support... Good Idea), Or... change it by manual.

- Stop asm before

    $ srvctl stop asm -n oratest01

- copy ASM1 profile, CRS_HOME/crs/public/ PATH and filename = "resource_name".cap

    $ /u01/oracle/product/crs/bin/crs_stat -p ora.oratest01.ASM1.asm > /u01/oracle/product/crs/crs/public/ora.oratest01.ASM1.asm.cap

- unregister ASM1 resource

    $ /u01/oracle/product/crs/bin/crs_unregister ora.oratest01.ASM1.asm

    $ /u01/oracle/product/crs/bin/crs_stat -p ora.oratest01.ASM1.asm
    CRS-0210: Could not find resource 'ora.oratest01.ASM1.asm'.

- Edit cap file (AUTO_START=1)

    $ vi /u01/oracle/product/crs/crs/public/ora.oratest01.ASM1.asm.cap


AUTO_START=2 -> AUTO_START=1

- register ASM1 resource to Cluster

    $ /u01/oracle/product/crs/bin/crs_register ora.oratest01.ASM1.asm

- Check and Test

    $ /u01/oracle/product/crs/bin/crs_stat -p ora.oratest01.ASM1.asm

    NAME=ora.oratest01.ASM1.asm
    TYPE=application
    ACTION_SCRIPT=/u01/oracle/product/11.1.0/asm/bin/racgwrap
    ACTIVE_PLACEMENT=0
    AUTO_START=1

    $ su - root

    # /u01/oracle/product/crs/bin/crsctl stop crs
    Stopping resources.
    This could take several minutes.
    Successfully stopped Oracle Clusterware resources
    Stopping Cluster Synchronization Services.
    Shutting down the Cluster Synchronization Services daemon.
    Shutdown request successfully issued.

    # /u01/oracle/product/crs/bin/crsctl start crs
    Attempting to start Oracle Clusterware stack
    The CRS stack will be started shortly

    $ crs_stat -t

    Name Type Target State Host
    ------------------------------------------------------------
    ora.oratest01.ASM1.asm ONLINE ONLINE on oratest01
    ora.oratest01.LISTENER_ORATEST01.lsnr ONLINE ONLINE on oratest01
    ora.oratest01.gsd ONLINE ONLINE on oratest01
    ora.oratest01.ons ONLINE ONLINE on oratest01
    ora.oratest01.vip ONLINE ONLINE on oratest01

Success... ASM automatic started after when Oracle Clusterware is started.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12361284/viewspace-616627/,如需轉載,請註明出處,否則將追究法律責任。

相關文章