Oracle 参数文件
来源:互联网 发布:图书数据加工人员 编辑:程序博客网 时间:2024/06/06 00:48
- 1 参数文件
Most initialization parameters belong to one of the following functional groups:
Parameters that name entities such as files or directories
Parameters that set limits for a process, database resource, or the database itself
Parameters that affect capacity, such as the size of the SGA (these parameters are called variable parameters)
Database administrators can use initialization parameters to:
Optimize performance by adjusting memory structures, such as the number of database buffers in memory
Set database-wide defaults, such as the amount of space initially allocated for a context area when it is created
Set database limits, such as the maximum number of database users
Specify names of files or directories required by the database
Many initialization parameters can be fine-tuned to improve database performance. Other parameters should never be altered or should be altered only under the supervision of Oracle Support Services.
- Derived Parameters(可推导的参数)比如sessions参数就根据processes参数计算获得,sessions=1.1*processes+15。如果设置了sessions,也会被推导出的值覆盖掉。
- Operating System-Dependent Parameters(OS相关参数)例如
DB_BLOCK_BUFFERS参数的最大值就和OS有关。
- Variable Parameters (these can be dynamic parameters or any of the preceding ones动态参数)该部分参数很大程度上影响到数据库的性能,也是最有发挥余地的参数。
- 2 SPFILE和PFILE
- 2.1 PFILE
A text initialization parameter file is a text file that contains a list of initialization parameters. This type of parameter file, which is a legacy implementation of the parameter file, has the following key characteristics:
When starting up or shutting down a database, the text initialization parameter file must reside on the same host as the client application that connects to the database.
A text initialization parameter file is text-based, not binary.
Oracle Database can read but not write to the text initialization parameter file. To change the parameter values you must manually alter the file with a text editor.
Changes to initialization parameter values by
ALTER
SYSTEM
are only in effect for the current instance. You must manually update the text initialization parameter file and restart the instance for the changes to be known.
The text initialization parameter file contains a series of key=value
pairs, one per line. For example, a portion of an initialization parameter file could look as follows:
db_name=samplecontrol_files=/disk1/oradata/sample_cf.dbfdb_block_size=8192open_cursors=52undo_management=autoshared_pool_size=280Mpga_aggregate_target=29M...
- 2.2 SPFILE
A server parameter file is a repository for initialization parameters that is managed by Oracle Database. A server parameter file has the following key characteristics:
Only one server parameter file exists for a database. This file must reside on the database host.
The server parameter file is written to and read by only by Oracle Database, not by client applications.
The server parameter file is binary and cannot be modified by a text editor.
Initialization parameters stored in the server parameter file are persistent. Any changes made to the parameters while a database instance is running can persist across instance shutdown and startup.
CREATE SPFILE
statement. It can also be created directly by the Database Configuration Assistant.- 2.3 PFILE与PFILE比较
SPFILEPFILERMAN备份能备份不能备份存放位置保存在服务端,只能在服务端修改或者通过命令行,降低人为错误可以任意修改上传
减少配置问题,启动远端数据库,不需要本地的pfile.
- 3 参数相关操作
3.1 查看参数Table 13-3 Static and Dynamic Initialization Parameters
Requires modification of the parameter file (text or server)
Yes
No
Requires database instance restart before setting takes affect
Yes
No
Described as "Modifiable" in Oracle Database Reference initialization parameter entry
No
Yes
Modifiable only for the database or instance
Yes
You can view parameter settings in several ways, as shown in the following table.
SHOW PARAMETERS
This SQL*Plus command displays the values of initialization parameters in effect for the current session.SHOW SPPARAMETERS
This SQL*Plus command displays the values of initialization parameters in the server parameter file (SPFILE).CREATE PFILE
This SQL statement creates a text initialization parameter file (PFILE) from the SPFILE or from the current in-memory settings. You can then view the PFILE with any text editor.V$PARAMETER
This view displays the values of initialization parameters in effect for the current session.V$PARAMETER2
This view displays the values of initialization parameters in effect for the current session. It is easier to distinguish list parameter values in this view because each list parameter value appears in a separate row.V$SYSTEM_PARAMETER
This view displays the values of initialization parameters in effect for the instance. A new session inherits parameter values from the instance-wide values.V$SYSTEM_PARAMETER2
This view displays the values of initialization parameters in effect for the instance. A new session inherits parameter values from the instance-wide values. It is easier to distinguish list parameter values in this view because each list parameter value appears in a separate row.V$SPPARAMETER
This view displays the current contents of the SPFILE. The view returns FALSE
values in the ISSPECIFIED
column if an SPFILE is not being used by the instance.- 3.2 查看引隐式参数
- 3.2 设置SPFILE参数值
- 3.3 取消SPFILE中的值设置
- 3.4 修改 PFILE 参数值
- Open the file called init<database_name>.ora. For example, if the database is called oraprod, then the file would be called initoraprod.ora. The file can be in a variety of places, but almost always somewhere in a subdirectory of the Oracle Installation directory on the server (also known as the ORACLE_HOME).
- Find the parameter that you wish to change. The parameter may not be in the file. If not, the default value is being used by Oracle. Add the parameter if it is not in the file and needs to be a non-default value.
- Comment out the line containing the current setting (in case the change needs to be undone). A line will be commented out (ignored by Oracle) if a pound sign (#) is placed at the beginning of the line
- Add a new line with the same parameter with the new setting.
Example
- 4 参数文件的维护
- 4.1 创建参数文件
- 4.1.1 pfile转换为spfile
CREATE SPFILE='/u01/oracle/dbs/test_spfile.ora' FROM PFILE='/u01/oracle/dbs/test_init.ora';
The next example illustrates creating a server parameter file in the default location from the current values of the initialization parameters in memory.
CREATE SPFILE FROM MEMORY;
Whether you use the default SPFILE name and default location or specify an SPFILE name and location, if an SPFILE of the same name already exists in the location, it is overwritten without a warning message.小心覆盖
- 4.1.2. spfile转换为pfile
You can use the CREATE PFILE
statement to export a server parameter file (SPFILE) to a text initialization parameter file. Doing so might be necessary for several reasons:
For diagnostic purposes, listing all of the parameter values currently used by an instance. This is analogous to the SQL*Plus
SHOW PARAMETERS
command or selecting from theV$PARAMETER
orV$PARAMETER2
views.To modify the &spfile;server parameter file by first exporting it, editing the resulting text file, and then re-creating it using the
CREATE SPFILE
statement
The exported file can also be used to start up an instance using the PFILE
clause.
You must have the SYSDBA
or the SYSOPER
system privilege to execute the CREATE PFILE
statement. The exported file is created on the database server machine. It contains any comments associated with the parameter in the same line as the parameter setting.
The following example creates a text initialization parameter file from the SPFILE:
CREATE PFILE FROM SPFILE;
Because no names were specified for the files, the database creates an initialization parameter file with a platform-specific name, and it is created from the platform-specific default server parameter file.
The following example creates a text initialization parameter file from a server parameter file, but in this example the names of the files are specified:
CREATE PFILE='/u01/oracle/dbs/test_init.ora' FROM SPFILE='/u01/oracle/dbs/test_spfile.ora';
Note:
An alternative is to create a PFILE from the current values of the initialization parameters in memory. The following is an example of the required command:CREATE PFILE='/u01/oracle/dbs/test_init.ora' FROM MEMORY;
- 4.2 修正被破坏的SPFILE
Starting ORACLE instance (normal)LICENSE_MAX_SESSION = 0LICENSE_SESSIONS_WARNING = 0Shared memory segment for instance monitoring createdPicked latch-free SCN scheme 2Using LOG_ARCHIVE_DEST_1 parameter default value as USE_DB_RECOVERY_FILE_DESTAutotune of undo retention is turned on.IMODE=BRILAT =27LICENSE_MAX_USERS = 0SYS auditing is disabledStarting up:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options.Using parameter settings in client-side pfile D:\U01\ADMIN\ORCL11G\PFILE\INIT.ORA on machine AD-PCSystem parameters with non-default values:processes = 150memory_target = 1232Mcontrol_files = "D:\U01\ORADATA\ORCL11G\CONTROL01.CTL"control_files = "D:\U01\FLASH_RECOVERY_AREA\ORCL11G\CONTROL02.CTL"db_block_size = 8192compatible = "11.2.0.0.0"db_recovery_file_dest = "D:\u01\flash_recovery_area"db_recovery_file_dest_size= 3852Mundo_tablespace = "UNDOTBS1"remote_login_passwordfile= "EXCLUSIVE"db_domain = ""dispatchers = "(PROTOCOL=TCP) (SERVICE=orcl11gXDB)"audit_file_dest = "D:\U01\ADMIN\ORCL11G\ADUMP"audit_trail = "DB"db_name = "orcl11g"open_cursors = 300diagnostic_dest = "D:\U01"
- 4.3 备份参数文件
starup nomount;set dbid ...;restore spfile from autobackup;或者指定文件位置restore spfile from './...';shutdown immediate;set dbid;startup;
- 5 RAC与参数文件
SPFILE='+DATADG/dacsdb/spfiledacsdb.ora'
- 6 Storing the Server Parameter File on HARD-Enabled Storage
Starting with Release 11g, the server parameter file (SPFILE) is in a new format that is compliant with the Oracle Hardware Assisted Resilient Data (HARD) initiative. HARD defines a comprehensive set of data validation algorithms, implemented at both the software and storage hardware levels, to ensure that no corrupt data is written to permanent storage. To fully enable HARD protection for the data in your SPFILE, the SPFILE must reside on HARD-enabled storage, and compatibility for your database instance must be advanced to at least 11.0.0.
You can store the HARD-compliant SPFILE on non-HARD-enabled storage. In this case, the new SPFILE format supports only detection of corrupt SPFILE data. Storing the SPFILE on HARD-enabled storage prevents corrupt data from being written to storage in the first place.
For more information about HARD, and for a list of storage vendors that supply HARD-enabled storage systems, visit:http://www.oracle.com/technology/deploy/availability/htdocs/HARD.html
.
Follow these guidelines for full HARD protection when installing or upgrading your Oracle database:
When Installing or Initially Creating a Release 11g Database
When first installing or creating a Release 11g database, the COMPATIBLE
initialization parameter defaults to 11.2.0, so this requirement for a HARD-compliant server parameter file (SPFILE) is met. You must then ensure that the SPFILE is stored on HARD-enabled storage. To meet this requirement, do one of the following:
For an Oracle Real Application Clusters environment without shared storage, when DBCA prompts for the location of the SPFILE, specify a location on HARD-enabled storage.
For a single-instance installation, or for an Oracle Real Application Clusters environment with shared storage, complete these steps:
Complete the database installation with Database Configuration Assistant (DBCA).
The SPFILE is created in the default location. See Table 2-4 for information on default locations.
Do one of the following:
Using an operating system command or the ASMCMD utility, copy the SPFILE to HARD-enabled storage.
In SQL*Plus or another interactive environment such as SQL Developer, connect to the database as user
SYS
and then submit the following command:CREATE SPFILE = 'spfile_name' FROM MEMORY;
where spfile_name is a complete path name, including file name, that points to HARD-enabled storage.
Create a text initialization parameter file (PFILE) in the default location with the following single entry:
SPFILE = spfile_name
where spfile_name is the complete path to the SPFILE on HARD-enabled storage.
See Table 2-4 for default name and location information for PFILEs and SPFILEs.
Shut down the database instance.
Delete the SPFILE in the default location.
Start up the database instance.
When Upgrading to Release 11g from an Earlier Database Release
When upgrading to Release 11g from an earlier database release, complete these steps to migrate your SPFILE to the HARD-compliant format and to store the SPFILE on HARD-enabled storage:
Start SQL*Plus or another interactive query application, log in to the database as user
SYS
orSYSTEM
, and then enter the following command:ALTER SYSTEM SET COMPATIBLE = '11.2.0' SCOPE = SPFILE;
Caution:
Advancing the compatibility level to 11.2.0 enables Release 11g features and file formats and has wide repercussions. Consult Oracle Database Upgrade Guide before proceedingRestart the database instance.
The database is now at compatibility level 11.2.0.
If your SPFILE is not already on HARD-enabled storage, complete the following steps:
In SQL*Plus or another interactive environment, connect to the database as user
SYS
and then submit the following command:CREATE SPFILE = 'spfile_name' FROM MEMORY;
where spfile_name is a complete path name, including file name, that points to HARD-enabled storage.
Create a text initialization parameter file (PFILE) in the default location with the following single entry:
SPFILE = spfile_name
where spfile_name is the complete path to the SPFILE on HARD-enabled storage.
See Table 2-4 for default name and location information for PFILEs and SPFILEs.
Shut down the database instance.
Delete the SPFILE in the default location.
Start up the database instance.
- Oracle初始化参数文件
- oracle参数文件
- oracle参数文件
- Oracle 参数文件总结
- Oracle 参数文件
- Oracle 初始化参数文件
- Oracle 参数文件 收藏
- Oracle 参数文件
- Oracle参数文件详解
- oracle的参数文件
- Oracle 参数文件
- Oracle体系结构-参数文件
- Oracle 参数文件
- Oracle 参数文件
- oracle参数文件
- oracle-参数文件
- Oracle 参数文件
- oracle器参数文件
- java面试
- oracle使用记录
- CSS_02 文字属性_文本属性_背景属性_列表属性
- iOS学习笔记--几种注释的作用pragma warning /***/星号
- 【简单项目框架一】Fragment实现的底部导航
- Oracle 参数文件
- WebM Web Video Encoding Tutorial With FFMpeg
- PAT 1023. Have Fun with Numbers (20)
- 实时编辑表格,可以编辑的表格
- 营业额统计
- 【建立二叉树】后序建立二叉树
- 验证表单元素常用的正则表达式
- Binary Tree Preorder Traversal
- Visual Studio 2010 正式版激活的两种方法小结