Saving your ASM Spfile.


Check spfile location.

[root@rac1 bin]# su - grid
[grid@rac1 ~]$ echo $ORACLE_SID
+ASM1
[grid@rac1 ~]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.1.0 Production on Sat Sep 22 00:46:33 2012

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Real Application Clusters and Automatic Storage Management options

SQL> show parameter spfile

Code:
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      +CRS/rac-cluster/asmparameterf
                                                 ile/registry.253.792630659
spfile location can also be found using.

ASMCMD> spget
Code:
+CRS/rac-cluster/asmparameterfile/registry.253.792630659
Take backup of spfile using asmcmd to another diskgroup.

SQL> exit

[grid@rac1 ~]$ asmcmd
ASMCMD> spbackup +CRS/rac-cluster/asmparameterfile/registry.253.792630659 +FRA/spfileBackASM.bak


Check the backup

ASMCMD> cd +FRA
ASMCMD> ls
ASM/
DELL/
ORCL/
spfileBackASM.bak


Copy the file to operating system if you want to.

ASMCMD> cp spfileBackASM.bak /tmp/spfileBackASM.bak
copying +FRA/spfileBackASM.bak -> /tmp/spfileBackASM.bak



You can also directly copy the ASM spfile to other diskgroups or operating system.

ASMCMD> spcopy +CRS/rac-cluster/asmparameterfile/registry.253.792630659 /tmp/spfilecopyASM.ora




OTHER ASMCMD COMMANDS.

To list the clients that are connected through V$ASM_CLIENT view.

ASMCMD> lsct -g
Code:
Instance_ID  DB_Name  Status     Software_Version  Compatible_version  Instance_Name  Disk_Group
          1  +ASM     CONNECTED        11.2.0.1.0          11.2.0.1.0  +ASM1          CRS       
          1  +ASM     CONNECTED        11.2.0.1.0          11.2.0.1.0  +ASM1          DATA      
          1  +ASM     CONNECTED        11.2.0.1.0          11.2.0.1.0  +ASM1          FRA       
          2  +ASM     CONNECTED        11.2.0.1.0          11.2.0.1.0  +ASM2          CRS       
          2  +ASM     CONNECTED        11.2.0.1.0          11.2.0.1.0  +ASM2          DATA      
          1  dell     CONNECTED        11.2.0.1.0          11.2.0.0.0  dell1          DATA      
          1  dell     CONNECTED        11.2.0.1.0          11.2.0.0.0  dell1          FRA       
          2  dell     CONNECTED        11.2.0.1.0          11.2.0.0.0  dell2          DATA      
          2  dell     CONNECTED        11.2.0.1.0          11.2.0.0.0  dell2          FRA
To check only a particular disk group.

ASMCMD> lsct -g CRS
Code:
Instance_ID  DB_Name  Status     Software_Version  Compatible_version  Instance_Name  Disk_Group
          1  +ASM     CONNECTED        11.2.0.1.0          11.2.0.1.0  +ASM1          CRS       
          2  +ASM     CONNECTED        11.2.0.1.0          11.2.0.1.0  +ASM2          CRS
To list current ASM operations going on from V$ASM_OPERATION view.


ASMCMD> lsop
Code:
Group_Name  Dsk_Num  State  Power
FRA     REBAL    WAIT   5
To list users from ASM password file.


ASMCMD> lspwusr
Code:
Username sysdba sysoper sysasm 
     SYS   TRUE    TRUE   TRUE 
 ASMSNMP   TRUE   FALSE  FALSE
To list disk group information through v$asm_diskgroup.


ASMCMD> lsdg
Code:
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  NORMAL  N         512   4096  1048576      6141     5215              309            2453              0             N  CRS/
MOUNTED  NORMAL  N         512   4096  1048576     24568    17614                0            8807              0             N  DATA/
MOUNTED  NORMAL  N         512   4096  1048576     24568    20348                0           10174              0             N  FRA/

To list disk information through v$asm_disk.


ASMCMD> lsdsk
Code:
Path
ORCL:VOL1
ORCL:VOL2
ORCL:VOL3
ORCL:VOL4
ORCL:VOL5
ORCL:VOL6
ORCL:VOL7
To Mount and Unmount Disk Groups.

ASMCMD> umount FRA
ASMCMD> lsdg
Code:
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  NORMAL  N         512   4096  1048576      6141     5215              309            2453              0             N  CRS/
MOUNTED  NORMAL  N         512   4096  1048576     24568    17614                0            8807              0             N  DATA/
ASMCMD> mount FRA
ASMCMD> lsdg
Code:
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  NORMAL  N         512   4096  1048576      6141     5215              309            2453              0             N  CRS/
MOUNTED  NORMAL  N         512   4096  1048576     24568    17614                0            8807              0             N  DATA/
MOUNTED  NORMAL  N         512   4096  1048576     24568    20344                0           10172              0             N  FRA/
To obtain I/O related information related to ASM Diskgroups every 2 secomds.

ASMCMD> iostat -et 2
Code:
Group_Name  Dsk_Name  Reads     Writes    Read_Err  Write_Err  Read_Time  Write_Time  
CRS         VOL1      98304     14336     0         0          .187       .055        
CRS         VOL2      61440     4096      0         0          .163       .013        
CRS         VOL7      124928    14336     0         0          .342       .023        
DATA        VOL3      43622400  11500544  0         0          40.484     5.051       
DATA        VOL4      82289152  11500544  0         0          64.281     5.521       
FRA         VOL5      57344     4096      0         0          .133       .009        
FRA         VOL6      61440     4096      0         0          .164       .015
Only for a particular Disk group.

ASMCMD> iostat -et -G DATA 2
Code:
Group_Name  Dsk_Name  Reads     Writes    Read_Err  Write_Err  Read_Time  Write_Time  
DATA        VOL3      43622400  11500544  0         0          40.484     5.051       
DATA        VOL4      82289152  11500544  0         0          64.281     5.521