Tuesday, September 9, 2008

How to use spfile for database startup

First of all, I would clarify what is the difference between pfile and spfile. Pfile is the text file -database initialization parameter file which is read at the time of database startup. The dynamic parameters can be changed using alter system command but they are not persistent and to make them permanent we have to make changes in init.ora file and then we  need to bounce the database for the effect to take place.

However spfile is the server parameter file which is a binary file, resides on the server and whatever changes we do using 'alter system' are persistent (depending on scope we define) and hence we don't have to manually edit the file and no need to bounce the db. Please note that it is a binary file and we can't edit it manually.

When the database is started it will read the initialization parameter file in the following order from $ORACLE_HOME/dbs -unix or $ORACLE_HOME/database-windows

1 spfile<SID>.ora

2 spfile.ora

3 init<SID>.ora

How to create spfile->

connect as sysdba

create spfile from pfile;

how to create pfile from spfile->

alter database create pfile from spfile.

Please not that you have correct permissions of this file in unix or else database wont start using spfile and it will five the following error, if pfile is not there->

LRM-00109: could not open parameter file '/u01/oradb/9.2.0/dbs/initSID.ora'
ORA-01078: failure in processing system parameters

No comments: