Sei sulla pagina 1di 2

3/23/13

PFILE vs. SPFILE - initialization parameter files

Oracle Home

Ads by Google

Oracle Database

Oracle Monitoring

Oracle Software

Oracle Tuning

Airline Maintenance
Aviation.Ramco.com Cloud based M&E and MRO solution with ERP. No CAPEX, $5000 monthly

Oracle Database 9i, 10g, 11g Oracle Data Warehouse & BI Oracle Applications EBS 11i, R12 Oracle Middleware SQL & PL/SQL
Ads by Google

UNIX/ Linux

DB Oracle

Oracle 10G

Oracle Server

Oracle Admin

Home > Oracle Database Administration (DBA) > Maintenance > PFILE vs. SPFILE

Oracle Database 10g Administration (DBA): Maintenance

PFILE vs. SPFILE


How the Oracle Instance is initialized When the Oracle instance start, first it looks to the $ORACLE_HOME/dbs (UNIX, Linux) or ORACLE_HOME/database (Windows) directory for the following files (in this order): 1. spfile${ORACLE_SID}.ora (SPFILE = Server Parameter File) 2. spfile.ora (SPFILE) 3. init${ORACLE_SID}.ora (PFILE) 4. init.ora (PFILE) The first found file is used for the instance initialization. So, Oracle first look for a SPFILE and after that after a PFILE. PFILE is a text file, SPFILE is a binary file which cannot be modified using a text editor. SPFILE advantages Here are the SPFILE advantages: 1. 2. 3. No need to restart the database in order to have a parameter changed and the new value stored in the initialization file Reduce human errors: Parameters are checked before changes are accepted An SPFILE can be backed-up with RMAN (RMAN cannot backup PFILEs) What is my database using SPFILE or PFILE ? The following select has the response:
SELECT DECODE (value, NULL, 'PFILE', 'SPFILE') "Init File Type" FROM sys.v_$parameter WHERE name = 'spfile';

How could I switch from SPFILE to PFILE and vice-versa ? Switch from SPFILE to PFILE: 1) CREATE PFILE FROM SPFILE; 2) Backup and delete SPFILE 3) Restart the instance Switch from PFILE to SPFILE : 1) CREATE SPFILE FROM PFILE 2) Restart the instance (the PFILE will be in the same directory but will not be used. SPFILE will be used instead) Changing the SPFILE parameter values
ALTER SYSTEM SET timed_statistics = TRUE COMMENT = 'Changed by Paul on January 1st 2008' SCOPE = BOTH SID = '*'

The SCOPE parameter can be set to SPFILE, MEMORY or BOTH: - MEMORY: Set for the current instance only. This is the default behavior if a PFILE was used at STARTUP. - SPFILE: update the SPFILE, the parameter will take effect with next database startup - BOTH: affect the current instance and persist to the SPFILE. This is the default behavior if an SPFILE was used at STARTUP. The COMMENT parameter (optional) specifies a user remark. The SID parameter (optional; only used with RAC) indicates the instance for which the parameter applies. (Default is *: all Instances). Converting SPFILE to PFILE and vice-versa This could be done in order to have a backup in the other format or to change the initialization file for the database instance.
CREATE PFILE FROM SPFILE;

www.oracle-home.ro/Oracle_Database/Maintenance/PFILEvsSPFILE.html

1/2

3/23/13

PFILE vs. SPFILE - initialization parameter files


CREATE SPFILE FROM PFILE; CREATE SPFILE = '/oradata/spfileORCL.ora' FROM PFILE = '/oradata/initORCL.ora' ;

More information about this subject ( PFILE vs. SPFILE ) you can get from www.in-oracle.com

Oracle Database 9i, 10g, 11g Oracle Data Warehouse & BI Oracle Applications EBS 11i, R12 Oracle Middleware SQL & PL/SQL Home > Oracle Database Administration (DBA) > Maintenance > PFILE vs. SPFILE

UNIX/ Linux

Different Romanian Links/ Linkuri romanesti diferite


1. Exercitii de gramatica limbii engleze (English Grammar Exercises ) Doresti un proiect de arhitectura ieftin (pentru zonele Buzau, Bucuresti sau Prahova) ?

Disclaimer: The views expressed on this web site are my own and do not reflect the views of Oracle Corporation. You may use the information from this site only at your risk. Copyright (c) 2009-2011 Paul Catalin Tomoiu. All rights reserved.

www.oracle-home.ro/Oracle_Database/Maintenance/PFILEvsSPFILE.html

2/2

Potrebbero piacerti anche