Wednesday, July 9, 2008

Oracle Server Parameter File management (SpFile)

Managing the SpFILE:
In Oracle9i and above, the SpFILE is stored in a binary format on the server.
You no longer need to have a local copy to start the database remotely.
This also means that changes made via ALTER SYSTEM may now persist
across server restarts - without any need to remember to update a separate init.ora file.

A PFILE (old style text init.ORA) can be created via the command:
CREATE PFILE = 'pfilename' FROM SpFILE = 'filename';
An SpFILE (binary) can be created via the command:
CREATE SpFILE = 'filename' FROM PFILE ='pfilename';
To create an SpFile, the database need not be started, the old pfile format is largely for backwards compatibility with older releases.
~If the system has both a pfile and an SpFile, then Oracle will always use the SpFile.
~If the system has both a generic init.ora and an SID specific parameter file,

Oracle will use the SID specific file.
SID specific:
spfileSID.ora or initSID.ora
Generic:
spfile.ora or init.ora
The location for all parameter files is:
ORACLE_HOME\database (Windows)ORACLE_HOME/dbs (Unix/Linux)
To startup a database with an SpFILE:
SQL> startup
To startup a database with a PFILE, use the pfile= option :
SQL> startup pfile=filename
Examples
ALTER SYSTEM SET log_archive_format = "live%S.ARC" SCOPE = spfile;
ALTER SYSTEM SET shared_pool_size=64M scope=both
SELECT name, value from v$parameter

where name = 'spfile';
show parameter spfile;

No comments: