SCOPE
The SCOPE clause lets you specify when the change takes effect. Scope depends on whether you started up the database using a client-side parameter file (pfile) or server parameter file (spfile).
scope可指定對system的修改何時生效,scope=memory|spfile|both ,值取決於數據庫使用pfile還是spfile啟動
MEMORY
MEMORY indicates that the change is made in memory, takes effect immediately, and persists until the database is shut down. If you started up the database using a parameter file (pfile), then this is the only scope you can specify.
scope=memory,表示修改立即生效,持續到數據庫關閉為止,若數據庫使用pfile啟動,這是唯一可選值,也是默認值。
SPFILE
SPFILE indicates that the change is made in the server parameter file. The new setting takes effect when the database is next shut down and started up again. You must specify SPFILE when changing the value of a static parameter that is described as not modifiable in Oracle Database Reference.
scope=spfile ,會修改spfile參數,新設置只有在重新使用spfile啟動數據庫的時候生效。
另外,若是修改靜態參數(不能直接生效的參數),必須指定scope=spfile,否則若指定memory或者both會報如下錯誤:
ORA-02095: specified initialization parameter cannot be modified
因為靜態參數不能直接通過修改內存而生效,只能通過修改spfile然后重啟數據庫生效。
BOTH
BOTH indicates that the change is made in memory and in the server parameter file. The new setting takes effect immediately and persists after the database is shut down and started up again.
scope=both,表示修改會發生在內存上立即生效,並修改spfile保證數據庫重啟后也生效。
If a server parameter file was used to start up the database, then BOTH is the default. If a parameter file was used to start up the database, then MEMORY is the default, as well as the only scope you can specify.
若數據庫使用spfile啟動,則scope=both是默認值
若數據庫使用pfile啟動,則scope=memory是默認值,也是唯一值。
靜態參數,不能通過修改內存(默認scope值或scope=memory或scope=both)來生效,要通過修改spfile(),重啟數據庫來生效。