Wednesday, April 2, 2008

Pfile and Spfile in Oracle.

There are two types of initialization parameter files in oracle:

1)Parameter Files (PFILES)
2)Server Parameter Files (SPFILES).

Comparison Between Pfile and Spfile:

A)Pfile is the text file that can be edited using a text editor. Spfile is binary file that cannot be edited directly by text editor.If you edit spfile it will corrupt.

B)When changes are made to the PFILE, the instance must be shut down and restarted before it takes effect.Most changes to the SPFILE can be made dynamically, while the instance is open and running.

C)Pfile is by default named as init{instance_name}.ora. Spfile is by default named as spfile{instance_name}.ora where instance_name will be replaced by your database name. By default spfile is located under $ORACLE_HOME/dbs in unix and windows and pfile will be located under $ORACLE_HOME\database location on windows.

D)Pfile can be created from an SPFILE using the create pfile from spfile command.Spfile can be created from a PFILE using the create spfile from pfile command.

E)In order to modify any parameter value in pfile you must open the pfile with any text editor and manually edit it. And in order to modify any parameter value inside spfile you must issue ALTER SYSTEM SET with SCOPE=SPFILE or SCOPE=BOTH. Pfile can never be edited with ALTER SYSTEM SET.

F)Spfile can be backed up by RMAN. pfile can't be backed up by RMAN.
In order to have clear idea about ALTER SYSTEM SET have a look at How to set initialization parameter using Alter System

Related Documents:
------------------------

How to set initialization parameter using Alter System

4 comments:

  1. I am finding your blog to be very useful. Keep posting.

    ReplyDelete
  2. short and to the point, a good quick reference.

    ReplyDelete
  3. Thank you for sharing this information. Much better than Oracle documents.

    ReplyDelete
  4. I recommend that you save the spfile as a pfile before you change non-dynamic parameters using the ALTER SYSTEM command. I've seen teh command allow for invalid values which causes problems when using the spfile for startup.

    ReplyDelete