日期:2014-05-16 浏览次数:20428 次
修改SPFILE的值
登陆Oracle服务器,使用相关的命令来修改对应的值
ALTER SYSTEM SET parameter=value <comment='text'> <deferred> <scope=memory|spfile|both><sid='sid|*'>
sid='sid|*'
默认为*,表示所有的Instance,一般请款下一个Instance对应一个Database,如果是RAC(一个Database对应多个Instance),需要指定不同的SID
<scope=memory|spfile|both>
memory:只改内存中参数
spfile:只改磁盘上文件
both:两个都改,如果不指定,缺省适用both
<deferred> 有些参数不是当前修改,下次启动的时候修改
<comment='text'>注释
例子:
以修改fast_start_mttr_target参数的值为例:
先查看fast_start_mttr_target参数的默认值
show parameter fast_start_mttr_target;
name????type??value
fast_start_mttr_target ??integer??300
修改:
alter system set fast_start_mttr_target=250;
System altered;
查看修改后的值(memory)
show parameter fast_start_mttr_target;
name????type??value
fast_start_mttr_target ??integer??250
查看spfile的值
退出sqlplus
进入$ORACLE_HOEM/dbs目录下
Strings spfileSID.ora
*.fast_start_mttr_target=250
------------------------------------
我们只修改内存中的值
alter system set fast_start_mttr_target=260 scope=memory;
System altered;
查看修改后的值(memory)
show parameter fast_start_mttr_target;
name????type??value
fast_start_mttr_target ??integer??260
查看spfile的值
Strings spfileSID.ora
*.fast_start_mttr_target=250
修改spfile和memory类似,只是把scope的值换成spfile即可
=================================================
comment 的值存放在V$parameter中updata_comment列中
alter system set fast_start_mttr_target=260 comment='hello word';
查看comment中值
select name,value,updata_comment from v$parameter where name=fast_start_mttr_target'';
NAME????VALUE?UPDATA_COMMENT
fast_start_mttr_target??260?hello word
查看spfile中comment
*.fast_start_mttr_target=260#hello word
================================================
查看哪些参数需要设置 deferred
select name,issys_modifiable from V$parameter where issys_modifiable='DEFERRED'
================================================
如果想适用系统自带的值适用 alter system reset 命令
alter system reset PARAMETER_NAME scopt=memory|spfile|both? SID='SID|*';
?