Monday, June 18, 2012

Stopping ASM instance on stand alone database.

Couple of days back, I got a project case to migrate database from Filesystem to ASM, After I installed Grid infrastructure binaries for stand alone server. I created ASM instance manually, then I created necessary diskgroup as below.
NAME                         STATE
---------------------------- -------
ARCHLOG                      MOUNTED
DATAFILE_ORAPROD6            MOUNTED
DATAFILE_ORAPROD7            MOUNTED
LOG1                         MOUNTED
LOG2                         MOUNTED
Before to create above said diskgroups, I am able to start and stop ASM instance but After the diskgroup creation I was not able to stop ASM instance using SRVCTL command. When I tried to stop ASM instance it got failed with below error.
oracle:+ASM@linuxora15 /oracle > srvctl stop asm
PRCR-1065 : Failed to stop resource ora.asm
CRS-2529: Unable to act on 'ora.asm' because that would require stopping or relocating 'ora.LOG2.dg', but the force option was not specified
Then I obsorved that in single instance configuration if any of diskgroup got mounted we can't stop ASM instance untill unless we dismount all diskgroup for that Instance. this is because, from 11g R2 onwards, each diskgroup will have separate service running on each node, after ASM instance started.
oracle:+ASM@linuxora15 /oracle > crs_stat -t
Name           Type           Target    State     Host
-----------------------------------------------------------
ora.ARCHLOG.dg ora....up.type ONLINE    ONLINE    linuxora15
ora....ROD6.dg ora....up.type ONLINE    ONLINE    linuxora15
ora....ROD7.dg ora....up.type ONLINE    ONLINE    linuxora15
ora.LOG1.dg    ora....up.type ONLINE    ONLINE    linuxora15
ora.LOG2.dg    ora....up.type ONLINE    ONLINE    linuxora15
ora.asm        ora.asm.type   ONLINE    ONLINE    linuxora15
ora.cssd       ora.cssd.type  ONLINE    ONLINE    linuxora15
ora.diskmon    ora....on.type OFFLINE   OFFLINE
ora.evmd       ora.evm.type   ONLINE    ONLINE    linuxora15
ora.ons        ora.ons.type   OFFLINE   OFFLINE
Since all diskgroups on this ASM instance are in ONLINE status, I was not able to stop the instance. In this case to stop ASM instance, follow below procedure.
SQL> select name,state from v$asm_diskgroup;
NAME                         STATE
---------------------------- -----------
ARCHLOG                      MOUNTED
DATAFILE_ORAPROD6            MOUNTED
DATAFILE_ORAPROD7            MOUNTED
LOG1                         MOUNTED
LOG2                         MOUNTED

SQL> alter diskgroup all dismount; --> This will dismount all DG on this instance.
Diskgroup altered.
Note : Before to stop diskgroup you should connect to ASM instance with SYSASM privilege
SQL> select name,state from v$asm_diskgroup;
NAME                         STATE
---------------------------- -----------
DATAFILE_ORAPROD6            DISMOUNTED
DATAFILE_ORAPROD7            DISMOUNTED
LOG2                         DISMOUNTED
LOG1                         DISMOUNTED
ARCHLOG                      DISMOUNTED

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Automatic Storage Management option
oracle:+ASM@linuxora15 /oracle >
oracle:+ASM@linuxora15 /oracle > srvctl stop asm

oracle:+ASM@linuxora15 /oracle > crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora.ARCHLOG.dg ora....up.type OFFLINE   OFFLINE
ora....OD69.dg ora....up.type OFFLINE   OFFLINE
ora....D73A.dg ora....up.type OFFLINE   OFFLINE
ora.LOG1.dg    ora....up.type OFFLINE   OFFLINE
ora.LOG2.dg    ora....up.type OFFLINE   OFFLINE
ora.asm        ora.asm.type   OFFLINE   OFFLINE
ora.cssd       ora.cssd.type  ONLINE    ONLINE    linuxora15
ora.diskmon    ora....on.type OFFLINE   OFFLINE
ora.evmd       ora.evm.type   ONLINE    ONLINE    linuxora15
ora.ons        ora.ons.type   OFFLINE   OFFLINE
oracle:+ASM@linuxora15 /oracle >

No comments:

Post a Comment