In this post, we will see how to Backup, Copy and Move an Oracle ASM Initialization Parameter File. Here are some important asmcmd commands used to administer ASM SPFILE
spget <=Retrieves the location of the Oracle ASM SPFILE
spbackup <=Backs up an Oracle ASM SPFILE to a backup file
spcopy <=Copies an Oracle ASM SPFILE or an Oracle ASM backup file from source location to an Oracle ASM SPFILE in the destination location
spmove <=Moves an Oracle ASM SPFILE from source to destination and automatically updates the GPnP profile or OLR
spset <=Set the location of the ORACLE ASM SPFILE in Grid Plug and Play (GPnP) profile or OLR
How to Backup ASM SPFile
ASMCMD> spget
+DG_TEST_DATA/ASM/ASMPARAMETERFILE/registry.253.978021167
ASMCMD>spbackup +DG_TEST_DATA/ASM/ASMPARAMETERFILE/registry.253.978021167 +DG_TEST_FRA/spfileBackASM.bak
OR
ASMCMD>spcopy +DG_TEST_DATA/ASM/ASMPARAMETERFILE/registry.253.978021167 +DG_TEST_FRA/spfileBackASM.cpy
You can copy SPFILE or backup SPFILE from DG to file system as well
ASMCMD> spbackup +DG_TEST_DATA/ASM/ASMPARAMETERFILE/registry.253.978021167 /u01/oragrid/spfile/spfileBackASM.bak
ASMCMD> spcopy +DG_TEST_DATA/ASM/ASMPARAMETERFILE/registry.253.978021167 /u01/oragrid/spfile/spfileBackASM.cpy
How to Backup ASM SPFile as Text
Login to asm instance as sysasm, find the spfile and backup as text file as shown
SQL> show parameter spfile;
NAME TYPE VALUE
------------------------------------ ----------- ----------------
spfile string +DG_TEST_DATA/ASM/ASMPARAMETER
FILE/registry.253.978021167
SQL>
SQL> create pfile='/u01/oragrid/spfile/spfile+ASM.ora' from spfile='+DG_TEST_DATA/ASM/ASMPARAMETERFILE/registry.253.978021167';
File created.
How to Migrate ASM SPfile
+DG_TEST_FRA/spfileASM.ora
ORA-15032: not all alterations performed
ORA-15028: ASM file '+DG_TEST_FRA/spfileASM.ora' not dropped; currently being accessed (DBD ERROR: OCIStmtExecute)
-rw-r----- 1 oragrid oinstall 1536 Jun 8 13:41 /u01/oragrid/spfile/spfileASM.ora
$ asmcmd spget
/u01/oragrid/spfile/spfileASM.ora
Note: You can also use asmcmd spcopy instead of spmove. while using asmcmd spcopy you need to specify -u to update the OLR or GPnP profile about the new location of the spfile. notice the difference in below pic
Migrating ASM SPfile File System to Diskgroup.
How to Restore the ASM SPFILE from Backup
+DG_TEST_DATA/ASM/ASMPARAMETERFILE/REGISTRY.253.978270727
+DG_TEST_DATA/ASM/spfileASM.ora
+DG_TEST_FRA/ASM/ASMPARAMETERFILE/REGISTRY.253.978263057
+DG_TEST_FRA/spfileASM.ora
$ asmcmd spget
+DG_TEST_DATA/ASM/spfileASM.ora
No comments:
Post a Comment