|
Oracle Home |
|
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.
Here are the SPFILE advantages:
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 = BOTHSID = '*'
The
SCOPE parameter can be set to SPFILE, MEMORY or BOTH:
The COMMENT parameter (optional) specifies a user remark.
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; 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
|
|
Home > Oracle Database Administration (DBA) > Maintenance > PFILE vs. SPFILE |
|
Different Romanian Links/ Linkuri romanesti diferite |
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.