Oracle參數修改淺析

來源:互聯網
上載者:User

Oracle參數修改淺析

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.
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.

 

反過來推理下:

啟動和修改方式

動態參數

靜態參數

SPFILE

啟動

Scope=spfile

更新spfile

更新spfile

重啟後永久生效

重啟後永久生效

Scope=memory

更新記憶體

不允許

立即生效,重啟後無效

Scope=both(預設)

更新記憶體和spfile

不允許

立即並永久生效

PFILE

啟動

Scope=spfile

不允許

不允許

Scope=memory(預設)

更新記憶體

不允許

立即生效,重啟後無效

Scope=both

不允許

不允許

 

從以上可以看出,由於pfile只能手工修改,所以以pfile啟動後,僅動態參數可以立即修改生效,但執行個體重啟後無效;以spfile啟動,靜態參數可以修改重啟後生效,動態參數可以以三種方式修改生效。

如何查看一個參數是動態還是靜態,可以通過v$parameter視圖中的issys_modifiable獲得:

此欄位含義:

?IMMEDIATE - Parameter can be changed with ALTER SYSTEM regardless of the type of parameter file used to start the instance. The change takes effect immediately.

?DEFERRED - Parameter can be changed with ALTER SYSTEM regardless of the type of parameter file used to start the instance. The change takes effect in subsequent sessions.

?FALSE - Parameter cannot be changed with ALTER SYSTEM unless a server parameter file was used to start the instance. The change takes effect in subsequent instances

從解釋來看,immediate和deferred都屬於動態參數,但deferred比較特殊,對當前已經串連會話不生效。False屬於靜態參數,只能重啟後生效。

 

SQL> select issys_modifiable,count(*) from v$parameter group by issys_modifiable;

ISSYS_MOD   COUNT(*)

--------- ----------

IMMEDIATE        145

FALSE            107

DEFERRED           7

  • 1
  • 2
  • 下一頁

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.