Pfile and Spfile

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Pfile and Spfile

What is pfile and spfile:


=========================

pfile is the parameter file .It is the text file that contains oracle instance parameters and it can be
changed by text editor such as vi or notepad++.

Spfile is the Server parameter file.It is the binary file and only can be change by using alter system
command.This feature introduced in 9i.When instance start up,it search for spfile by default,if no
spfile is found then it will use pfile.

Note:By default oracle will use spfile when instance starts,but you want to use the pfile instead of
spfile then you must specify like below.

startup pfile='<Path of the pfile>'

How to check instance is using pfile or spfile:


==============================================

SQL> show parameter spfile

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
spfile string +DATA_DG/RAMESH1/spfileramesh1.ora

Note:Value column will be empty if instance is using pfile instead of spfile.

How to create spfile from pfile:


-------------------------------

create spfile='+DATA_DG/RAMESH1/spfileramesh1.ora' from pfile;

How to create pfile from spfile:


--------------------------------

SQL> create pfile='/tmp/initramesh11.ora' from spfile;

File created.

SCOPE clause of alter system :


==============================

SCOPE = SPFILE // The change is applied in the server parameter file only and
No change is made to the current instance and change take place after instance got restarted.

SCOPE = MEMORY // The change is applied in memory only. Changes will gone when we restarted
the instance.

SCOPE = BOTH // The change is applied in both the server parameter file and memory . (current
and next startup)

Determine the parameter dynamic or static:


=========================================

example:
----------

SQL> set lines 300


col name for a60
select name, ISSYS_MODIFIABLE from v$parameter
where name='sga_max_size';SQL> SQL> 2

NAME ISSYS_MOD
------------------------------------------------------------ ---------
sga_max_size FALSE

SQL> select name, ISSYS_MODIFIABLE from v$parameter where name='sga_target';

NAME ISSYS_MOD
------------------------------------------------------------ ---------
sga_target IMMEDIATE

Change a parameter value:


========================

SQL> alter system set db_recovery_file_dest_size=7g scope=both sid='*';

System altered.

SQL> ALTER SYSTEM SET log_archive_dest_1='location=+FRA_DG/RAMESH1/db/archivelog'


SCOPE=memory sid='*';

System altered.

SQL> show parameter log_archive_dest_1

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
log_archive_dest_1 string location=+FRA_DG/RAMESH1/db/archivelog

You might also like