Managing Server Parameter Files

This module describes how to use and manage server parameter files (SPFILE).

This module discusses the following:

Overview
Migrating From a Text Initialization Parameter File
  Creating the Server Parameter File
  Starting the Instance Using the Server Parameter File

Modifying the Server Parameter File

  Using the ALTER SYSTEM Command
  Exporting the Server Parameter File

Changing Static Initialization Parameters

Re-creating the Server Parameter File After Manual Editing
  Re-creating the Server Parameter File From a Text Initialization Parameter File
  Re-creating the Server Parameter File

Move your mouse over this icon to show all screenshots. You can also move your mouse over each individual icon to see only the screenshot associated with it.

Back to List of Topics

A server parameter file (also referred to as SPFILE) is server-side initialization parameter file. It is a repository for initialization parameters and is maintained on the machine where the Oracle server executes. Initialization parameters stored in a server parameter file are persistent across instance startup and shut down. You can update initialization parameters in the server parameter file with the ALTER SYSTEM command.

When you start your instance and do not specify the location, the Oracle server locates your initialization parameter file by searching in the default location for a named file in the following order:

spfile$ORACLE_SID.ora
spfile.ora
init$ORACLE_SID.ora

The default location in UNIX for the server parameter file or text initialization parameter file is $ORACLE_HOME/dbs. On Windows, the default location is ORACLE_HOME/dbs.

Back to List of Topics

If you are currently using a text initialization parameter file (also referred to as an init.ora file), you can easily migrate to using a server parameter file.

 

Back to List of Topics

You can create a server parameter file (SPFILE) from a text initialization parameter file by performing the following steps:

1.

Invoke SQL*Plus. Connect as a user with SYSDBA privileges.

 

2.

Issue the CREATE SPFILE command to create the server parameter file from your text initialization parameter file. If your initialization parameter file does not reside in the default directory for parameter files on your operating system, you must specify the full path.
Oracle Corporation recommends that you allow the database server to default the name and location of the server parameter file. This will ease administration of your database. For example, the STARTUP command assumes this default location to read the parameter file.

CREATE SPFILE FROM PFILE='<pfile_name>';

Move your mouse over this icon to see the image

 

Back to List of Topics

After you have created your server parameter file, you need to restart your instance using this file. If you have created the server parameter file with a default name, perform the following steps to start your instance using your server parameter file:

1.

Invoke SQL*Plus. Connect as a user with SYSDBA privileges.

 

2.

Start the instance and open the database:

STARTUP

Move your mouse over this icon to see the image

 

3.

Issue the following command to verify that your instance was started with your server parameter file:

SHOW PARAMETER pfile

Move your mouse over this icon to see the image

 

Back to List

You can modify the values of parameters in the server parameter file by issuing the ALTER SYSTEM command or exporting the contents of the server parameter file to a text initialization parameter file.

 

Back to List of Topics

If you started your instance with a server parameter file, you can use the ALTER SYSTEM command to change the values of the initialization parameters in the server parameter file. Specify the SCOPE=SPFILE option to change the values in the server parameter file only. Specify SCOPE=BOTH to change values in memory and in the server parameter file. This option is valid only for dynamic parameters. SCOPE=BOTH is the default if the instance has been started with a server parameter file.

In the following example, the USER_DUMP_DEST parameter is changed in memory and in the server parameter file.

1.

Invoke SQL*Plus and connect as a user with SYSDBA privileges.

 

2.

Verify the value of the parameter with the SHOW PARAMETER command:

SHOW PARAMETER <parameter name>;

Move your mouse over this icon to see the image

 

3.

Determine if the parameter is dynamic by querying the ISSYS_MODIFIABLE column of the V$PARAMETER view. The value IMMEDIATE indicates this is a dynamic parameter.

SELECT name, type, value, issys_modifiable
FROM v$parameter
WHERE name = '<parameter name>';

Move your mouse over this icon to see the image

 

4.

Issue the ALTER SYSTEM command:

ALTER SYSTEM SET <parameter name>=<new value>;

Move your mouse over this icon to see the image

 

5.

Verify the value of the parameter with the SHOW PARAMETER command:

SHOW PARAMETER <parameter name>;

Move your mouse over this icon to see the image

 

Back to List of Topics

You can export a server parameter file to create a text initialization parameter file.

1.

Invoke SQL*Plus and connect to your database as a user with SYSDBA privileges.

 

2.

Create a text initialization parameter file from your server parameter file by issuing the following command:

CREATE PFILE='<pfile_name>' FROM SPFILE;


If you did not use the default name for your server parameter file, you should specify it as follows:

CREATE PFILE='<pfile_name>' FROM SPFILE='<spfile_name>'; 

Move your mouse over this icon to see the image

 

3.

Modify the initialization parameters of your choice in the text initialization parameter file you created.

 

4.

Shut down your instance.

 

5.

Invoke SQL*Plus and connect to your database as a user with SYSDBA privileges. Re-create the server parameter file from the text initialization parameter file as follows.

CREATE SPFILE FROM PFILE='<pfile_name>';

OR

Specify the server parameter file name if you are not using the default name.

CREATE SPFILE='<spfile_name>' FROM PFILE='<pfile_name>';

Move your mouse over this icon to see the image

 

6.

Restart your instance.

 

Back to List of Topics

You can change the value of a static initialization parameter by using the SCOPE=SPFILE clause on the ALTER SYSTEM command as follows. SPFILE indicates that the change is made in the server parameter file only. Note: The new setting takes effect when the database instance is shut down and restarted.

1.

Invoke SQL*Plus and connect as a user with SYSDBA privileges.

 

2.

Verify the value of the parameter with the SHOW PARAMETER command:

SHOW PARAMETER <parameter name>;

Move your mouse over this icon to see the image

 

3.

Query the ISSYS_MODIFIABLE column of the V$PARAMETER dynamic performance view to determine if the parameter can be changed with the ALTER SYSTEM command and when the change takes effect. A value of FALSE indicates that the parameter is a static parameter and can only be changed if the instance was started with a server parameter file by using the SCOPE=SPFILE clause.

SELECT name, type, value, issys_modifiable
FROM v$parameter
WHERE name = '<parameter name>';

Move your mouse over this icon to see the image

 

4.

Issue the ALTER SYSTEM command:

ALTER SYSTEM SET <parameter name>=<new value> SCOPE=SPFILE;

Move your mouse over this icon to see the image

 

4.

When you restart your instance with your server parameter file, your change will take effect.

Move your mouse over this icon to see the image

 

Back to List of Topics

If the server parameter file has been manually edited, you may receive an error when you attempt to change a parameter using the ALTER SYSTEM command or when you try to start the instance as shown in the examples below.

Note: Although you can open the binary server parameter file with a text editor and view its text, you should not manually edit it. If you edit the server parameter file, you will corrupt the file. You will not be able to start you instance. If the instance is running, it could fail.

Error example: Attempt to modify an initialization parameter:


Move your mouse over this icon to see the image

 

Error example: Attempt to start the instance:

 

Move your mouse over this icon to see the image

 

Back to List of Topics

If you have a text initialization parameter file, you can re-create your server parameter file from it as follows:

1.

Invoke SQL*Plus and connect as a user with SYSDBA privileges.

 

1.

Remove the corrupted server parameter file using operating system commands.

 

2.

Issue the following command:

CREATE SPFILE FROM PFILE='<pfile_name>';

Move your mouse over this icon to see the image

 

Back to List of Topics

If you do not have a text initialization parameter, re-create one and then re-create your server parameter file from it:

1.

Edit your corrupted server parameter file and extract all parameters.

 

2.

Create a new text initialization parameter file and include all parameters extracted above.

 

3.

Invoke SQL*Plus and connect as a user with SYSDBA privileges.

 

4.

Issue the following command supplying the name of your newly created text initialization parameter file:

CREATE SPFILE FROM PFILE='<pfile_name>';

Move your mouse over this icon to see the image

 

Move your mouse over this icon to hide all screenshots