March 02, 2017

Difference between PFILE and SPFILE in Oracle

A PFILE is a static, client side text file. This file normally resides on the server. However in case you would like to start oracle from a remote machine, you will need a local copy of the PFILE in that machine.


This file can be edited with a standard text editor like notepad or vi editor. This file will be commonly referred as INIT.ORA file.


SPFILE (Server parameter file) is a persistent server side binary file. SPFILE should only be modified through “ALTER SYSTEM SET” command . Editing an SPFILE directly will corrupt the file and the start up of the database or instance will not be possible.

As SPFILe is a server side binary file,  local copy of the PFILE is not required to start oracle from a remote machine. 



Advantages of SPFILE compared to PFILE

  • A SPFILE doesnot need a local copy of  the pfile to start  oracle from a remote machine.  Thus eliminates configuration problems.

  • SPFILE  is a binary file and modications to that can only be done through ALTER SYSTEM SET command.

  • As SPFILE is maintained by the server, human errors can be eliminated as the parameters are checked before modification in SPFILE

  • It is easy  to locate SPFILE as it is stored in a central location

  • Changes to the parameters in SPFILE will take immediate effect without restart of the instance i.e Dynamic change of parameters is possible


  • SPFILE can be backed up by RMAN

Difference between PFILE and SPFILE in Oracle :


Query to findout, if database is running with PFILE or SPFILE

Goto SQL prompt and execute the following command to figure out if database is started with a PFILE or SPFILE.


SQL > SELECT DECODE(value, NULL, ‘PFILE’, ‘SPFILE’) “Init File” FROM sys.v_$parameter WHERE name = ‘spfile’;