Question
When the ASM was first installed the spfile was placed in the default Disk Group (e.g. +DATA). The requirement now is to move the spfile to a different diskgroup.
Method 1 : Using “asmcmd spcopy”
Copying the spfile
Shown below is an example of moving spfile with the “asmcmd spcopy” utility on Oracle Restart environment.
1. List out the current spfile being used in the database with “asmcmd spget” command.
$ asmcmd spget +DATA/asm/asmparameterfile/registry.253.722601213
Verify the disk group where you want to move the spfile to. In our example we will move the spfile to disk group “+PLAY”
$ asmcmd lsdg State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Votin g_files Name MOUNTED EXTERN N 512 4096 1048576 14658 9814 0 9814 0 N DATA/ MOUNTED EXTERN N 512 4096 1048576 9772 8507 0 8507 0 N PLAY/ MOUNTED EXTERN N 512 4096 1048576 9772 9212 0 9212 0 N RECO/
Copy spfile with -u option to update GPnP profile in RAC environment
$ asmcmd spcopy -u +DATA/asm/asmparameterfile/registry.253.722601213 +PLAY/spfileASM.ora
Restarting the HA stack
1. Next step is to restart the HA stack to verify that ASM starts up fine with copiedspfile. Restart the “has” resource with crsctl.
$ crsctl stop has CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on '[server]' ... CRS-4133: Oracle High Availability Services has been stopped.
$ crsctl start has CRS-4123: Oracle High Availability Services has been started.
Verify the new localtion of spfile with “asmcmd spget” command again.
$ asmcmd spget +PLAY/spfileASM.ora
Remove the old spfile
You may also want to remove the old spfile, so that no one uses it by mistake. To do so, use the “asmcmd rm” command.
$ asmcmd ls -l +DATA/asm/asmparameterfile Type Redund Striped Time Sys Name ASMPARAMETERFILE UNPROT COARSE JUN 25 10:00:00 Y REGISTRY.253.722601213
$ asmcmd rm +DATA/asm/asmparameterfile/registry.253.722601213
Method 2 : Using intermediate pfile
This is an example of moving ASM spfile in a single instance environment, by making use of intermediate pfile.
Create intermediate pfile
1. Verify the location of the current spfile.
$ sqlplus / as sysasm SQL*Plus: Release 11.2.0.1.0 Production on [date] Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production With the Automatic Storage Management option SQL> show parameter spfile NAME TYPE VALUE ------- ------- -------------------------------------------------- spfile string +DATA/asm/asmparameterfile/registry.253.715881237
2. Next is to create an intermediate pfile from spfile using the command shown below.
SQL> create pfile='/tmp/pfile+ASM.ora' from spfile; File created.
Create new spfile
1. Create a new spfile in the new disk group using the intermediate pfile we just created in step 1 above.
SQL> create spfile='+PLAY' from pfile='/tmp/pfile+ASM.ora'; File created. SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production With the Automatic Storage Management option
Restart the HA stack
1. Restart the HA stack to verify that ASM starts up fine with moved spfile.
$ crsctl stop has CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on '[server]' ... CRS-4133: Oracle High Availability Services has been stopped.
$ crsctl start has CRS-4123: Oracle High Availability Services has been started.
2. Verify that the new spfile is being used by the database using the below command.
$ sqlplus / as sysasm SQL*Plus: Release 11.2.0.1.0 Production on [date] Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production With the Automatic Storage Management option SQL> show parameter spfile NAME TYPE VALUE ------- ------- -------------------------------------------------- spfile string +PLAY/asm/asmparameterfile/registry.253.715963539
3. Also verify if the disk groups +DATA and +PLAY are in mounted state.
SQL> select name, state from v$asm_diskgroup; NAME STATE ----- ----------- DATA MOUNTED PLAY MOUNTED SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production With the Automatic Storage Management option
4. The use of new spfile can also be verified with asmcmd as follows:
$ asmcmd spget +PLAY/asm/asmparameterfile/registry.253.715963539
Remove old spfile
You may want to remove the old spfile so that no one uses it by mistake. Use the “asmcmd rm” command to remove the old spfile.
$ asmcmd rm +DATA/asm/asmparameterfile/registry.253.715881237
How to move a datafile from file system to ASM