Tuesday, 19 February 2019

ORACLE ASM DEMYSTIFIED FOR PERSONAL USE AND INTERVIEWS

1. How to stop ASM?

Ans:-  I have issued the following command.

srvctl stop ASM


It shows the following errors:-
PRCR-1065 : Failed to stop resource ora.asm
CRS-2673: Attempting to stop 'ora.asm' on 'vienna'
CRS-5017: The resource action "ora.asm stop" encountered the following error:
ORA-15032: not all alterations performed
ORA-15027: active use of diskgroup "DATA" precludes its dismount
. For details refer to "(:CLSN00108:)" in "/u01/app/grid/diag/crs/vienna/crs/trace/ohasd_oraagent_grid.trc".

CRS-2675: Stop of 'ora.asm' on 'vienna' failed

CRS-2675: Stop of 'ora.asm' on 'vienna' failed

Same is the result when I have tried to stop it with the SQL plus utilities. So what could be the possible reasons?

1. The disk groups are mounted. If disk groups are remain mounted then we can not stop the ASm instance. Here I have a standalone ASM. I have installed the GRID only without any database in it.

crs_stat -t
The above command shows that lots of disk groups are in online . 
 
Name           Type           Target    State     Host
------------------------------------------------------------
ora.DATA.dg    ora....up.type OFFLINE   OFFLINE
ora....ER.lsnr ora....er.type ONLINE    ONLINE    vienna
ora....N1.lsnr ora....er.type ONLINE    ONLINE    vienna
ora.MGMTLSNR   ora....nr.type OFFLINE   OFFLINE
ora.asm        ora.asm.type   OFFLINE   ONLINE    vienna
ora.cvu        ora.cvu.type   ONLINE    ONLINE    vienna
ora....network ora....rk.type ONLINE    ONLINE    vienna
ora.oc4j       ora.oc4j.type  ONLINE    ONLINE    vienna
ora.ons        ora.ons.type   ONLINE    ONLINE    vienna
ora.scan1.vip  ora....ip.type ONLINE    ONLINE    vienna
ora....SM1.asm application    OFFLINE   ONLINE    vienna
ora....NA.lsnr application    ONLINE    ONLINE    vienna
ora.vienna.ons application    ONLINE    ONLINE    vienna
ora.vienna.vip ora....t1.type ONLINE    ONLINE    vienna


select name,state from v$asm_diskgroup;

The above command shows that the 

NAME                           STATE
------------------------------ -----------
DATA                           QUIESCING


Here the state is QUIESCING. Normal case it should be mounted.

Now why in my case it is showing QUISCING?

I copied the below few lines from the oracle docs:-
QUIESCING - CRSCTL utility attempted to dismount a disk group that contains the Oracle Cluster Registry (OCR). The disk group cannot be dismounted until Cluster Ready Services (CRS) exits, because the disk group contains the OCR.

So this disk groups contains the OCR informations. 

So at first in my case we have to stop crsctl.

So to stop CRS in the current node, we ahave to logged in as a root user.

Go to the /u01/app/12.1.0/grid/bin path

and run the command

./crsctl stop crs

So now check the status of the disk groups.

select name,state from v$asm_diskgroup;

The result is showing :-

select name,state from v$asm_diskgroup
*
ERROR at line 1:
ORA-03135: connection lost contact
Process ID: 28832
Session ID: 176 Serial number: 1945


That means The ORACLE ASM has been stopped directly from the QUIESCING state as I stopped the CRS.

N.B:-  Here I am showing all these for example purpose. My current state is Partially installed GRID
only in node1. Do not stop CRSCTL or ASM without taking proper precautions.

From the above example we have found that we have to start or stop crs service first. then we can startup or shutdown the ASM.




2. How to start ASM?

Ans:- Now to start ASM in this above case we first need to start up crs as

./crsctl start crs
CRS-4123: Oracle High Availability Services has been started.

 It will start the ASMalso.