Oracle Database Spfile learning Summary

Source: Internet
Author: User

Create 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:

Create spfile [= 'spfilename'] from pfile = [= 'pfilename'];

Example:

Create spfile from pfile;

Use spfile

Restart the database and run the startup command. Oralce searches the parameter file a. spfile $ {ORACLE_SID}. ora in the default directory in the following order.

Default directory UNIX: $ {ORACLE_HOME}/dbs/

NT: $ {ORACLE_HOME} \ database

B. spfile. ora

Default directory UNIX: $ {ORACLE_HOME}/dbs/

NT: $ {ORACLE_HOME} \ database

C. init $ {ORACLESID}. ora

Default directory UNIX: $ {ORACLE_HOME}/dbs/

NT: $ {ORACLE_HOME} \ database or $ {ORACLE_HOME} \ admin \ db_name \ pfile

After the spfile is created and the database is restarted, Oracle searches the preceding directories in sequence and the spfile takes effect automatically.

Modify parameters

You can use alter system or import and export the SPFILE content.

Alter system adds a new option: SCOPE. The SCOPE parameter has three optional values: MEMORY, SPFILE, and BOTH.

MEMORY: only changes the running status of the current instance.

SPFILE: only modify the SPFILE settings.

BOTH: Change the instance and SPFILE

Whether spfile is used

1. query the v $ parameter dynamic view. If the following query returns a null value, you are using pfile.

2. Alternatively, you can use the SHOW command to display parameter settings. If the value column of the following result returns a null value, you are using pfile:

3. query the v $ spparameter view. If the following query returns 0, it means you are using pfile. Otherwise, it means you are using spfile:

Export the SPFILE File

The SPFILE file can be exported as a text file. You can add parameters to the SPFILE during the export and creation processes.

Create pfile = '/home/oracle/initxu. ora' from spfile

 

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.