Moving Oracle SPFILE Between ASM and File System
This article explains how to move an Oracle SPFILE between ASM and the file system, and vice versa. The process is straightforward and involves creating a temporary PFILE, recreating the SPFILE at the desired location, and restarting the database.
Scenario 1: Move SPFILE from ASM to File System
In this scenario, the SPFILE is stored in the ASM disk group +DATA, and we want to move it to the default file system location under $ORACLE_HOME/dbs.
Step 1: Verify Current SPFILE Location
Output:
Step 2: Create a PFILE from the Existing SPFILE
Step 3: Create a New SPFILE on the File System
Step 4: Restart the Database
Step 5: Confirm the New SPFILE Location
Output:
Optional Cleanup: Remove Old ASM SPFILE
Although the database now uses the file system SPFILE, it is a good practice to remove the old ASM copy.
Scenario 2: Move SPFILE from File System to ASM
In this case, the SPFILE exists on the file system and needs to be moved into ASM.
Important: Oracle always prefers a file system SPFILE if it exists. Therefore, it must be renamed or removed before restarting the database.
Step 1: Confirm Current SPFILE Location
Step 2: Create a PFILE from the File System SPFILE
Step 3: Create SPFILE in ASM
Step 4: Rename the File System SPFILE
Step 5: Restart the Database
Step 6: Validate SPFILE Usage
Output:
Fixing an OMF-Named SPFILE in ASM
If the SPFILE was created using only the disk group name (for example, +DATA), Oracle assigns an OMF name. This can cause startup failures if the expected alias is missing.
Symptoms
Resolution Steps
Create a PFILE from the current SPFILE:SQL> CREATE PFILE='/tmp/findb1.pfile' FROM SPFILE;
Switch to ASM environment:
$ . oraenv ORACLE_SID=+ASM $ asmcmd
Locate the OMF SPFILE:
ASMCMD> cd DATA/FINDB1/PARAMETERFILE ASMCMD> ls spfile.289.1187639911
Create an alias for the SPFILE:
ASMCMD> mkalias \ +DATA/FINDB1/PARAMETERFILE/spfile.289.1187639911 \ +DATA/FINDB1/spfilefindb1.ora
Restart the database:
SQL> STARTUP;
Verify:
SQL> SHOW PARAMETER spfile;

Post a Comment
Post a Comment