Oracle: PFILE y SPFILE

Pfile o spfile? A partir de Oracle 9i cambian las cosas. Para entender la diferencia, aquí un fragmento extraido de http://ist.uwaterloo.ca/~baumbach/ORACLE10g/spfile.html.

Until now Oracle has been using a text file called the pfile (parameter file) to store the database initialization parameters. The pfile is read at instance startup time to get specific instance characteristics. Any changes made the pfile would only take effect when the database is restarted. However, parameters that were dynamically alterable could be changed using the appropriate ALTER SYSTEM or ALTER SESSION statement, which would take effect immediately.

As of Oracle9i, new feature called the spfile (server parameter file). The spfile is a binary file that contains the same information as the old pfile. The spfile is a server-side initialization parameter file; parameters stored in this file are persistent across database startups. This makes all the changes made to the instance using the ALTER SYSTEM statement persistent. Oracle requires that you start an instance for the first time using the pfile and then create the spfile.

By default a Oracle uses the pfile. The spfile must be created from the pfile at the SQL prompt. Oracle starts using the spfile only after you restart the database using the spfile. The spfile is created using the CREATE SPFILE statement; this requires SYSDBA or SYSOPER privileges.

SQL> create spfile from pfile;

This is the simplest form of the CREATE SPFILE statement. It creates a spfile in the default directory, ${ORACLE_HOME}/dbs/, from the pfile located in the default directory, ${ORACLE_HOME}/dbs/. The file is named spfile${ORACLE_SID}.ora.

Oracle9i searches for the following the pfile/spfile in the following order:

  1. spfile${ORACLE_SID}.ora file in ${ORACLE_HOME}/dbs/
  2. spfile.ora in ${ORACLE_HOME}/dbs/
  3. init${ORACLESID}.ora in ${ORACLE_HOME}/dbs/

Escribe un comentario