Use of PFILE and SPFILE in Oracle

Source: Internet
Author: User

Before 9i, Oracle used pfile to store the initialization parameter settings. These parameters were read when the instance was started. Any modification requires restarting the instance to take effect, with spfile, you can use alter system or alter session to dynamically modify the parameters that can be dynamically modified. All changes can take effect immediately, you can choose to apply the changes only to the current instance or to the spfile at the same time. This allows all modifications to the spfile to be completed in the command line. We can choose not to manually modify the initialization parameter file, which greatly reduces the occurrence of human errors.

SPFILE is a binary file that can be backed up using RMAN. In this way, Oracle also incorporates the parameter file into Backup recovery management. In addition to PFILE for the first time to start the database (and then create SPFILE Based on PFILE), we do not need PFILE. We strongly recommend that you use spfile to store and maintain initialization parameter settings using its new features.

1. Create a SPFILE

By default, ORACLE uses PFILE to start the database. SPFILE must be created by PFILE. The newly created SPFILE will take effect the next time the database is started. create spfile requires SYSDBA or SYSOPER permissions:

Syntax:

Create spfile [= 'spfile-name'] from pfile [= 'pfile-name']

Example:

SQL> create spfile from pfile;

By default, spfile is created to the default directory of the system.

(Unix: $ ORACLE_HOME/dbs; NT: $ ORACLE_HOME \ database)


If the SPFILE already exists, the following error is returned during creation:

SQL> create spfile from pfile;

Create spfile from pfile

ERROR is located in row 1st:

ORA-32002: Unable to create SPFILE used by routine

To determine whether SPFILE is used, you can use the SHOW command to display parameter settings. If the following result returns a null value, you are using pfile:

SQL> SHOW PARAMETER spfile

NAME TYPE VALUE

------------------------------

Spfile string % ORACLE_HOME % \ DATABASE \ SPFILE % ORACLE_SID %. ORA

  • 1
  • 2
  • 3
  • Next Page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.