Pfile和Spfile配置解释(转载)

2019-03-01  本文已影响0人  Bean_Do

摘抄自这里,仅用来记录,以便查阅。

Certain files in the database can completely change the way your Oracle 12c database behaves. They can influence everything from performance and tuning as well as troubleshooting. Maintaining and configuring these files are a major component of database administration.

PFILE AND SPFILES IN ORACLE 12C

These are the files that set up your database operating environment:

Let’s go through many of the common parameters you find in these files. The parameter file is the first file read when you start your database; the parameters within it configure how your database operates.

First, take a look at an example of a PFILE and some of the commonly set parameters:

*.audit_file_dest='/u01/app/oracle/admin/dev12c/adump'
*.audit_trail='db'
*.compatible='12.0.0.0.0'
*.control_files='/u01/app/oracle/oradata/dev12c/control01.ctl',
         '/u02/app/oracle/oradata/dev12c/control02.ctl',
         '/u03/app/oracle/oradata/dev12c/control03.ctl'
*.db_block_size=8192
*.db_domain=’lfg.com’
*.db_name='dev12c'
*.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'
*.db_recovery_file_dest_size=4815m
*.diagnostic_dest='/u01/app/oracle'
*.memory_target=1280m
*.open_cursors=300
*.processes=300
*.undo_tablespace='UNDOTBS1'

The parameters have a * in front of them because you can use the parameter file to set parameters in more than one Oracle instance.

Follow these steps to see the parameters that are modified in an existing Oracle database:

  1. Log in to SQL*Plus as a SYSDBA.

  2. Type create pfile from spfile; (including the semicolon).

    The command dumps a text version of your SPFILE.

After you create your PFILE, you want to turn it into an SPFILE. Essentially, you do the reverse of what you did before:

  1. Log in to SQL*Plus as a SYSDBA.

  2. Type create spfile from pfile; (including the semicolon).

    You get a file called spfileORACLE_SID.ora in the same directory as your PFILE, where ORACLE_SID is your instance_name.

HOW TO SET PARAMETERS IN THE PFILES AND SPFILES IN ORACLE 12C

Whether you use PFILES or SPFILES determines how you set your parameters.

With a new database, you always start with a PFILE. If you end up wanting to use an SPFILE, you create it from the PFILE.

The first thing you need to do is find your PFILE. For whatever reason, despite all the other similarities, Linux/UNIX and Windows store it in different locations.

Find your PFILE on Windows, where ORACLE_SID is your instance name:

ORACLE_HOMEdatabaseinitORACLE_SID.ora

Find your PFILE on Linux/UNIX, where ORACLE_SID is your instance name:

ORACLE_HOME/dbs/initORACLE_SID.ora

These parameters are some of the most commonly customized. Most parameters suit most databases at their default value.

The * means to apply the parameter to all instances that read this file.

上一篇 下一篇

猜你喜欢

热点阅读