spfile and pfile

首先说下SPFILE和PFILE的相互创建

由PFILE创建SPFILE

create spfile from pfile 当然也可以指定路径create spfile=’d:\boson\spfile.ora’ from pfile

CREATE SPFILE FROM PFILE=’/u01/oracle/dbs/init.ora’;

CREATE SPFILE='/u01/oracle/dbs/test_spfile.ora'        FROM PFILE='/u01/oracle/dbs/test_init.ora';

由SPFILE创建PFILE

create pfile from spfile 同样也可以指定路径create pfile=’d:\boson\pfile.ora’ from pfile

SPFILE是二进制文件,不能修改,否则就会出错,我曾经就犯过.PFILE是文本文件,可以手动修改.

使用SPFILE的话,可以修改一些参数,并决定是否保存SCOPE=SPFILE BOTH MEMORY

SCOPE = SPFILE The change is applied in the server parameter file only. The effect is as follows:

  • For dynamic parameters, the change is effective at the next startup and is persistent.
  • For static parameters, the behavior is the same as for dynamic parameters. This is the only SCOPE specification allowed for static parameters.

但是如果使用的PFILE的话.有ALTER SYSTEM修改的只能应用于当前实例,重起后就消失.SPFILE正是因为这个才出现.

启动数据库的时候也可以指定SPFILE或PFILE

startup pfile=”

这几个文件一般在$ORACLE_HOME/DBS下

缺省的名字为SPFILE$ORACLE_SID.ORA

查看当前服务器的参数可以用show parameter s 或者查询V$PARAMETER

也可以输出到本地  spool d:\a.txt show parameters spool off;

关于参数的几个视图

Method Description

陆续有关服务器参数文件的问题,我会更新到本文章



评论暂缺

(Required)
(Required, will not be published)