DBA Tips Archive for Oracle


[an error occurred while processing this directive]

No Title

[an error occurred while processing this directive]

by Michael New, MichaelNew@earthlink.net, Gradation LLC

Suppose your database is stored using ASM including all physical database files and the SPFILE. You already know and understand how to duplicate database files and even the control file from ASM to the local file system using RMAN (see Migrating Databases from non-ASM to ASM and Vice-Versa). But what about the SPFILE? What if all you need to do is make a copy of the current SPFILE file stored in ASM to the local file system? Your first thought might be to use RMAN, however, there is a much easier method as described below. This method makes a copy of an SPFILE stored in ASM to a text-based initialization parameter file on the local file system.

  1. First, identify the SPFILE you want to duplicate in ASM. When the SPFILE is stored in ASM, you generally have a text-based version of the initialization parameter file that points to the SPFILE in ASM.

    $ cat $ORACLE_HOME/dbs/initorcl1.ora SPFILE='+ORCL_DATA1/orcl/spfileorcl.ora'

    You can further verify that the SPFILE really does indeed reside in ASM by performing the following query against the ASM instance.

    SELECT CONCAT('+' || disk_group_name, SYS_CONNECT_BY_PATH(alias_name, '/')) full_alias_path , NVL(LPAD(type, 18), '<DIRECTORY>') type FROM ( SELECT g.name disk_group_name , a.parent_index pindex , a.name alias_name , a.reference_index rindex , f.type type FROM v$asm_file f RIGHT OUTER JOIN v$asm_alias a USING (group_number, file_number) JOIN v$asm_diskgroup g USING (group_number) ) WHERE type = 'PARAMETERFILE' START WITH (MOD(pindex, POWER(2, 24))) = 0 CONNECT BY PRIOR rindex = pindex; File Name File Type --------------------------------------------------- ------------- +ORCL_DATA1/ORCL/spfileorcl.ora PARAMETERFILE +ORCL_DATA1/ORCL/PARAMETERFILE/spfile.268.600397949 PARAMETERFILE

  2. OK, so at this point, you want to make a copy of the +ORCL_DATA1/ORCL/spfileorcl.ora stored in ASM to the local file system. The solution is to use the CREATE PFILE... statement as follows.

    SQL> CREATE PFILE='/u01/app/oracle/initorcl.ora' FROM SPFILE='+ORCL_DATA1/ORCL/spfileorcl.ora'; File created.

About the Author

Jeffrey Hunter is an Oracle Certified Professional, Java Development Certified Professional, Author, and an Oracle ACE. Jeff currently works as a Senior Database Administrator for The DBA Zone, Inc. located in Pittsburgh, Pennsylvania. His work includes advanced performance tuning, Java and PL/SQL programming, developing high availability solutions, capacity planning, database security, and physical / logical database design in a UNIX / Linux server environment. Jeff's other interests include mathematical encryption theory, tutoring advanced mathematics, programming language processors (compilers and interpreters) in Java and C, LDAP, writing web-based database administration tools, and of course Linux. He has been a Sr. Database Administrator and Software Engineer for over 20 years and maintains his own website site at: http://www.iDevelopment.info. Jeff graduated from Stanislaus State University in Turlock, California, with a Bachelor's degree in Computer Science and Mathematics.

Copyright (c) 1998-2018 Jeffrey M. Hunter. All rights reserved.

All articles, scripts and material located at the Internet address of http://www.idevelopment.info is the copyright of Jeffrey M. Hunter and is protected under copyright laws of the United States. This document may not be hosted on any other site without my express, prior, written permission. Application to host any of the material elsewhere can be made by contacting me at jhunter@idevelopment.info.

I have made every effort and taken great care in making sure that the material included on my web site is technically accurate, but I disclaim any and all responsibility for any loss, damage or destruction of data or any other property which may arise from relying on it. I will in no case be liable for any monetary damages arising from such loss, damage or destruction.

Last modified on
Tuesday, 17-Jan-2012 14:11:54 EST
Page Count: 22460