Pfile VS Spfile (MOS Note 249664.1)
==============================================================================
Until Oracle 8i DBAs have been using a text file called the pfile (parameter file) to store the database initialization parameters. ---8i之前使用文本参数文件
The pfile is read at instance startup time to get specific instance characteristics. Any changes made the pfile would only take effect when the database is restarted.
However, parameters that were dynamically alterable could be changed using the appropriate ALTER SYSTEM or ALTER SESSION statement, which would take effect immediately.
As of Oracle9i, new feature called the spfile (server parameter file). The spfile is a binary file that contains the same information as the old pfile. --9i开始引入和服务参数文件,二进制类型
The spfile is a server-side initialization parameter file; parameters stored in this file are persistent across database startups.
This makes all the changes made to the instance using the ALTER SYSTEM statement persistent. Oracle requires that you start an instance for the first time using the pfile and then create the spfile.
The server parameter file (also called SPFILE) is in a single location where all the necessary parameters are defined and stored. The defined parameter values are applicable for all the instances in the cluster.
The SPFILE permits dynamic changes without requiring you to bring down the instance.
You can still use the client side parameter file to manage parameter settings in Real Application Clusters; however, administrative convenience is sacrificed and the advantage of dynamic change is lost.
By default, if you do not specify PFILE in your STARTUP command, Oracle will use a server parameter file. ---数据库启动的时候默认使用spfile
SERVER PARAMETER FILE ( SPFILE ) ---服务参数文件
================================
A server parameter file is basically a repository for initialization parameters.
Initialization parameters stored in a SPFILE are persistent, meaning any parameter changes made while an instance is running can persist across instance shutdown and startup.
In this way, all the initialization parameters manually updated by ALTER SYSTEM SET commands become persistent.
It also provides a basis for the Oracle database server to self-tune.
Another advantage, particularly for multi-instance RAC systems, is that a single copy of the parameter file can be used by all instances. Even though a single file is used to specify parameters, it has different format styles to support both the common values for all instances, as well as the specific values for an individual instance.
A server parameter file is initially built from the traditional text initialization parameter file, using the create SPFILE statement. It is a binary file that cannot be browsed or edited with a text editor.
Oracle provides other interfaces for viewing and modifying parameter settings. At system startup, the default behavior of the STARTUP command is to read a SPFILE to obtain initialization parameter settings. If the STARTUP command doesn't have a PFILE clause, it reads the SPFILE from a location
specified by the operating system.
If you choose to use the traditional text initialization parameter file, you must specify the PFILE clause when issuing the STARTUP command.
SETTING THE SERVER PARAMETER FILE VALUES ---设置参数文件的values
=========================================
Use the SID designator to set instance-specific parameter values in the server parameter file.
For settings across the database, use a '*', and for a specific instance, set the prefix with SID as indicated below. 数据库范围使用“*”,实例范围使用“SID.”
*.OPEN_CURSORS=400 # For database-wide setting
RACDB1.OPEN_CURSORS=800# For RACDB1 instance
Note that even though open_cursors is set at 400 for all instances in the first entry, the value of 800 remains in effect for the SID 'RACDB1'. ---相当于就近原则,优先级不一样
Some initialization parameters are dynamic since they can be modified using the ALTER SESSION or ALTER SYSTEM statement while an instance is running. Use the following syntax to dynamically alter
initialization parameters:
ALTER SESSION SET parameter_name = value
ALTER SYSTEM SET parameter_name = value [DEFERRED]
Use the SET clause of the ALTER SYSTEM statement to set or change initialization parameter values. Additionally, the SCOPE clause specifies the scope of a change as described below:
SCOPE = SPFILE ----对所有的动态参数和静态参数,使用这个语句都是在下次重启之后生效
(For both static and dynamic parameters, changes are recorded in the spfile, to be given effect in the next restart.)
SCOPE = MEMORY ---- 对于动态参数进行调整,下次重启失效
(For dynamic parameters, changes are applied in memory only. No static parameter change is allowed.)
SCOPE = BOTH ---对于动态参数有效,当前和重启均生效,可以指定DEFERRED参数,延迟生效
For dynamic parameters, the change is applied in both the server parameter file and memory. No static parameter change is allowed.)
For dynamic parameters, we can also specify the DEFERRED keyword. When specified, the change is effective only for future sessions.
HERE ARE A FEW EXAMPLES 一些例子
===========================
The following statement affects all instances. However, the values are only effective for the current instances, they are not written to binary SPFILE.
ALTER SYSTEM SET OPEN_CURSORS=500 SID='*' SCOPE=MEMORY;
The next statement resets the value for the instance 'RACDB1'.
At this point, the database-wide setting becomes effective for SID of RACDB1.
ALTER SYSTEM RESET OPEN_CURSORS SCOPE=SPFILE sid='RACDB1';
To reset a parameter to its default value throughout the cluster database, use the command:
ALTER SYSTEM RESET OPEN_CURSORS SCOPE=SPFILE sid='*';
CREATING A SERVER PARAMETER FILE ---创建一个参数文件
=================================
The server parameter file is initially created from a text initialization parameter file (init.ora).
It must be created prior to its use in the STARTUP command.
The create SPFILE statement is used to create a server parameter file.
The following example creates a server parameter file from an initialization parameter file.
CREATE SPFILE FROM PFILE='/u01/oracle/product/920/dbs/initRAC1.ora';
Below is another example that illustrates creating a server parameter file and supplying a name.
CREATE SPFILE='/u01/oracle/product/920/dbs/racdb_spfile.ora'
FROM PFILE='/u01/oracle/product/920/dbs/init.ora';
EXPORTING THE SERVER PARAMETER FILE --- 导出参数文件
===================================
We can export the server parameter file to create a traditional text initialization parameter file.
This would be useful for:(作用)
1) Creating backups of the server parameter file. --备份
2) For diagnostic purposes to list all of the parameter values currently used by an instance. 诊断
3) Modifying the server parameter file by first exporting it, editing the output file, and then recreating it. 外部编辑
The following example creates a text initialization parameter file from the server parameter file:
CREATE PFILE FROM SPFILE;
The example below creates a text initialization parameter file from a server parameter file, where the names of the files are specified:
CREATE PFILE='/u01/oracle/product/920/dbs/racdb_init.ora'
FROM SPFILE='/u01/oracle/product/dbs/racdb_spfile.ora';
Refer to 'Oracle 9i Database Reference' for all the parameters that can be changed with an ALTER SYSTEM command...
IS MY DATABASE USING SPFILE ?
=============================
Am I using spfile or pfile ?
The following query will let you know..
1) SQL> SELECT name,value FROM v$parameter WHERE name = 'spfile';
NAME VALUE
---------- --------------------------------------------------
spfile /fsys1/oracle/product/9.2.0/spfileTEST.ora
2) SQL> show parameter spfile;
The v$spparameter view
The contents of the SPFILE can be obtained from the V$SPPARAMETER view: 修改后的静态参数,重启数据库前可以从这个视图里面查到修改后的值
SQL> ALTER SYSTEM SET timed_statistics=FALSE SCOPE=SPFILE;
System altered. SQL> SELECT name,value FROM v$parameter WHERE name='timed_statistics'; NAME VALUE
-------------------- ---------------------
timed_statistics TRUE SQL> SELECT name,value FROM v$spparameter WHERE name='timed_statistics'; NAME VALUE
-------------------- ---------------------
timed_statistics FALSE RELATED DOCUMENTS
----------------- Oracle 9, Oracle 10g
Pfile VS Spfile (MOS Note 249664.1)的更多相关文章
- 福大软工 · 第七次作业 - 需求分析报告(404 Note Found队)
目录 组队后的团队项目的整体计划安排 项目logo及思维导图 项目logo 思维导图 产品思维导图 产品思维导图-引导 产品思维导图-后端数据处理.存储 产品思维导图-短信识别 产品思维导图-智能分析 ...
- 笔记本POWER部分的应用——(MOS/LDO/BUCK BOOST)
一.MOSFET 简介: 金属-氧化物半导体场效应晶体管,简称金氧半场效晶体管(Metal-Oxide-Semiconductor Field-Effect Transistor, MOSFET)是一 ...
- DBA_Oracle PFile and SPFile文件的管理和使用(案例)
2014-08-25 Created By BaoXinjian
- Oracle pfile与spfile文件参数(转载)
一.pfile与spfile Oracle中的参数文件是一个包含一系列参数以及参数对应值的操作系统文件.它们是在数据库实例启动时候加载的,决定了数据库的物理 结构.内存.数据库的限制及系统大量的默认值 ...
- oracle三个重要参数文件:pfile和spfile和init.ora
Oracle中的参数文件是一个包含一系列参数以及参数对应值的操作系统文件.它们是在数据库实例启动第一个阶段时候加载的, 决定了数据库的物理 结构.内存.数据库的限制及系统大量的默认值.数据库的各种物理 ...
- 【转】PFILE和SPFILE介绍
原文:http://blog.sina.com.cn/s/blog_77bba23901017xcl.html 一.PFILE Pfile(Parameter File,参数文件)是基于文本格式的参数 ...
- Oracle 初始化参数文件pfile和spfile
pfile和spfile差额 pfile :Oracle 9i之前.ORACLE使用我们一直PFILE存储的初始化参数,,能够在操作系统级别改动. 当spfile文件改动出现错误导致oracle无法启 ...
- oracle的参数文件:pfile和spfile
1.pfile和spfile Oracle中的参数文件是一个包含一系列参数以及参数对应值的操作系统文件.它们是在数据库实例启动时候加载的,决定了数据库的物理 结构.内存.数据库的限制及系统大量的默认值 ...
- Oracle:create pfile from spfile:rac下要小心该操作啊!
默认在原位置创建一个pfile的ora初始化参数文件!! 这在rac下会带来问题,因为rac下,当使用asm存储时,instance的启动参数文件就是pfile(其内容是指向一个spfile).如果不 ...
随机推荐
- github-提交仓库
git提交仓库主要分3快 1.用命令git add告诉Git,把文件添加到本地仓库(可以用.代替提交所有) $ git add readme.txt 2.用命令git commit告诉Git,把文件提 ...
- 源码升级安装python
1.下载 python: https://www.python.org/downloads/release/python-2712/ 2.编译安装 sudo mkdir /usr/local/pyth ...
- Java的多线程机制系列:(二)缓存一致性和CAS
一.总线锁定和缓存一致性 这是两个操作系统层面的概念.随着多核时代的到来,并发操作已经成了很正常的现象,操作系统必须要有一些机制和原语,以保证某些基本操作的原子性.首先处理器需要保证读一个字节或写一个 ...
- css-display:none和visibility:hidden的不同
摘自张鑫旭老师的博客-- display:none和visibility:hidden都能使元素隐藏,但是有明显区别,主要有以下三点: 空间占据 重排与重绘 株连性 1.空间占据. 使用display ...
- <<< 将一个rar格式的文件变成一张jpg图片,按照后缀来选择打开他的模式
把一个压缩格式和一张图片合成,按照后缀来判断他打开是图片还是解压文件,后缀是jpg打开的就是一张图片,后缀是rar打开的就是一个压缩包,里面存放你放的东西 :例如(秘密) 准备一张图片,test. ...
- android 性能优化-电量篇
消耗电量的几个主要原因.功能:1.大数据量的网络传输(网络)2.不停的网络切换(网络)3.解析大量的数据(CPU) 关于网络方面的优化: .网络请求之前,检查网络连接.没有网络连接不进行请求 .判断网 ...
- RDBMS DML DDL
RDBMS RDBMS 指的是关系型数据库管理系统. RDBMS 是 SQL 的基础,同样也是所有现代数据库系统的基础,比如 MS SQL Server, IBM DB2, Oracle, MySQL ...
- ASCII码表
ASCII码表 ASCII码大致可以分作三部分組成. 第一部分是:ASCII码非打印控制字符: 第二部分是:ASCII码打印字符: 第三部分是:扩展ASCII码打印字符. 第一部分:ASCII非打印控 ...
- rqnoj343 mty的考验
题目描述 啊!几经周折.mty终于找到了他的偶像.他就是….fyc! 可是fyc这样的高级人士可不喜欢一个人总是缠着他.于是他出了一道难题想考考mty.fyc有几个手下:陈乐天,舒步鸡,胡巍……现在f ...
- [Data Structure & Algorithm] 七大查找算法
查找是在大量的信息中寻找一个特定的信息元素,在计算机应用中,查找是常用的基本运算,例如编译程序中符号表的查找.本文简单概括性的介绍了常见的七种查找算法,说是七种,其实二分查找.插值查找以及斐波那契查找 ...