scope=memory;---直接修改内存中的值
scope=spfile;---只改的磁盘上的参数,没有更改内存
scope=both;--同时修改内存和磁盘
ALTER SYSTEM 中 SCOPE=SPFILE/MEMORY/BOTH 的区别:
SCOPE = SPFILE
The change is applied in theserverparameter 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.
(此更改写入初始化参数文件,更改将在下次启动时生效。动态参数与静态参数都一样可以。也是静态参数唯一可以使用的方式。)
SCOPE = MEMORY
The change is applied in memory only. The effect is as follows:
■ For dynamic parameters, the effect is immediate, but it is not persistent because the server parameter file is not updated.
■ For static parameters, this specification is not allowed.
(只在内存上修改,立即生效,但重启后将不再生效,因为并没有写入到初始化参数文件。只适用于动态参数,静态参数则不允许。)
SCOPE = BOTH
The change is applied in both the server parameter file and memory. The effect is as follows:
■ For dynamic parameters, the effect is immediate and persistent.
■ For static parameters, this specification is not allowed.
(既写入到初始化参数文件,也在内存上修改,立即生效。同样也只适用于动态参数,静态参数则不允许。)
动态修改:
举例:alter system set db_flashback_retention_target=2000;
SQL> alter system set db_flashback_retention_target=2000;
System altered.
可以动态修改。
scope参数说明:
静态参数 必须指定scope
动态参数issys_modifiable为IMMEDIATE不加scope默认的是 both
动态参数issys_modifiable为DEFERRED的必须加上scope=spfile或者加上derferred