Home | Tip of the Week | Tip of the Week Archive | Partners | Clients | History | Friends

Tip of the Week (Archived)
spfile or pfile...Inquiring Minds Want to Know

Each week I check statistics for our web site, just to see if anyone is stopping by and what they might be interested in. One of the questions that has popped up more than once is "how do I know if my database (instance) was started with a pfile or an spfile?"

Probably the best way to determine if an spfile was used to start the instance is to query the data dictionary view v$spparameter. According to the Oracle documentation (bolded is my note)

"V$SPPARAMETER displays information about the contents of the server parameter file. If a server parameter file (spfile) was not used to start the instance, then each row of the view will contain FALSE in the ISSPECIFIED column."

The documentation further states that if an spfile was not used to start the instance, then

  • The value column will be null for all rows.

  • The ordinal column will be 0 for all rows.

It is possible to use both a pfile and an spfile at instance startup. In this situation, when starting the database, you would use a pfile, and then specify an spfile using the startup parameter spfile. If the instance is not using an spfile at startup, then spfile parameter value will be null.

SELECT name, value
FROM   v$parameter
WHERE  name = 'spfile';

NAME
----------------------------------------------------------------
VALUE
--------------------------------------------------------------------------------
spfile
<null>

If the instance is using an spfile, then the query will return the location of the spfile. If the instance is started using an spfile in the default location, Oracle will default the value, as in the query below.

SELECT name, value
FROM   v$parameter
WHERE  name = 'spfile';

NAME
----------------------------------------------------------------
VALUE
--------------------------------------------------------------------------------
spfile
%ORACLE_HOME%\DATABASE\SPFILE%ORACLE_SID%.ORA

Note: This tip was tested using Oracle9i.

Was this tip useful? Did you find any errors? Do you have any suggestions? Do you care? Click here for the tip feedback page. Thank you.

2000 Turnberry Circle, Glenmoore, PA 19343
Voice: (610) 942-1979
Fax: (610) 942-1990
Email


© 2006 Alydan Consulting, Inc.