Friday, July 31, 2009

Change Oracle ASM resource AUTO_START

After I read otn forums. I felt curious about "ASM resource don't start automatic after server reboot or when Oracle Cluster is started".
so, made simple testing about auto_start not equal 1
# /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.

3 comments:

Niradj said...

Hi Surachart, reading this post, I was curious, what version of the CRS are you using, and on what platform? I see the ASM instances autostart (with AUTO_START=1) on CRS 10.2.0.4 (Linux and Solaris), without needing to change anything manually, so i was wondering. Thanks

Surachart said...

Hi Niradj,

Thank You for your commend.

On some reason, we need to add asm resource to CRS by manual.

srvctl add asm -n nodename...

That can make AUTO_START=2 or (some parameters are not default)

by default AUTO_START = 1 on my 10gR2 too...

And This is my curious as well
"srvctl ... database" can set -y {AUTOMATIC | MANUAL}

with "srvctl ... asm" can not. it just does disable asm , but can not start asm by srvctl (must enable asm before).

I tested it on 11gR1.

raj said...

Hi Surachart,

how do we change the for the service which we use it to connect the application users. auto_start=1.