[20210528]oracle大表空間預分配問題.txt
[20210528]oracle大表空間預分配問題.txt
--//使用oracle大表空間帶來的好處就是一個表空間僅僅一個資料檔案,維護管理簡單,但也帶來一些問題,就是預分配問題.
--//預設oracle有一個後臺程式監測SMCO (Space Management Coordinator).看文件每個小時喚醒監測1次.
--//當表空間不足時擴充套件資料檔案.這樣可以帶來一個好處,比如使用者大量匯入資料,而資料檔案需要擴張時,整個業務要稍微停頓.
--//如果事先資料檔案擴充套件了,就可以減少這方面的停頓.
--//受兩個隱含引數的_enable_space_preallocation,_kttext_warning.
--//想象一下如果資料檔案1T,增加5%,也就是增加50G,假設寫入400m/s,也大概需要50000/400 = 125秒完成.
--//補充知識:
MOS 如下文件詳細說明了這個程式的作用:
SMCO (Space Management Coordinator) For Autoextend On Datafiles And How To Disable/Enable (文件 ID 743773.1)
What is the function of SMCO background process
SMCO coordinates the following space management tasks. It performs proactive space allocation and space reclamation. It
dynamically spawns slave processes (Wnnn) to implement the task.
SMCO 協調以下空間管理任務。 它執行主動空間分配和空間回收。 它動態生成從屬程式(Wnnn)來實現任務。
表空間級別的空間預分配 - Tablespace-level space (Extent) pre-allocation.
Pre-allocation here refers to datafile extention, Datafile extension happens when a space request (extent
allocation) operation generally triggered via Insert / loading to a segment does not find contiguous space in the
tablespace, the session will extend the file by the next increment set for the datafile and will continue with the
space request or Extent allocation.
這裡的預分配是指資料檔案擴充套件,當通常透過插入/載入到段時觸發的空間請求(擴充套件區分配)操作在表空間中找不到連續空間時會發
生資料檔案擴充套件,會話將按照 increment 設定擴充套件檔案,同時將繼續使用空間請求或Extent分配。
For SMCO to autoextend a datafile, the AUTOEXTEND should be set to ON for the datafile. SMCO decides to expand the
tablespace based on history, extension is split evenly across all datafiles in the tablespace which have not reached
their maxsize and are still limited to 10% of the full tablespace size in one hourly SMCO wakeup.
(Full tablespace size = Sum of datafile sizes at any given instance of time.)
要使SMCO自動擴充套件資料檔案,應將資料檔案的AUTOEXTEND設定為ON。 SMCO決定根據歷史記錄擴充套件表空間,擴充套件在表空間中的所有數
據檔案中均勻分配,這些資料檔案尚未達到其maxsize,並且在每小時SMCO喚醒時,擴充套件空間限制為完整表空間大小的10%。(完整表
空間大小=任何給定時刻的資料檔案大小總和。)
Apart from the above mentioned task, the SMCO process is also responsible for performing the following tasks.
updating block and extents counts in SEG$ for locally managed tablespaces after adding an extent (from unpublished
Bug 12940620)
Securefile lob segment pre-extension.
Securefile lob segment in-memory dispenser space pre-allocation.
Securefile lob segment space reclamation (moving free chunks from uncommitted free space area to committed free space area).
Temporary segment space reclamation.
The main advantage is that sessions need not wait for reactive space allocation/deallocation operations as this is
proactively done, and hence a gain in performance.
How to disable and enable the SMCO background process
The feature provided by the SMCO process is called "Tablespace-level space (Extent) pre-allocation."
It can be turned off by setting "_enable_space_preallocation"=0 as below:
ALTER SYSTEM SET "_ENABLE_SPACE_PREALLOCATION" = 0;
The feature can be turned on again any time by setting "_enable_space_preallocation"=3 which is the default value:
ALTER SYSTEM SET "_ENABLE_SPACE_PREALLOCATION" = 3;
The parameter is dynamic and the scope is ALTER SYSTEM.
NOTE:
Please use the double quotes as indicated to prevent an ORA-911 because of the leading '_'
Following is other possible settings:
* 0 to turn off the tbs pre-extension feature.
* 1 To enable tablespace extension.
* 2 To enable segment growth.
* 4 To enable chunk allocation.
以上摘自 MOS 內容,僅供參考。
1.環境:
SCOTT@book> @ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
SYS@book> @ hide _enable_space_preallocation
NAME DESCRIPTION DEFAULT_VALUE SESSION_VALUE SYSTEM_VALUE ISSES ISSYS_MOD
---------------------------- ---------------------------- ------------- ------------- ------------ ----- ---------
_enable_space_preallocation enable space pre-allocation TRUE 3 3 FALSE IMMEDIATE
SYS@book> @hide _kttext_warning
NAME DESCRIPTION DEFAULT_VALUE SESSION_VALUE SYSTEM_VALUE ISSES ISSYS_MOD
--------------- -------------------------------------------------------- ------------- ------------- ------------ ----- ---------
_kttext_warning tablespace pre-extension warning threshold in percentage TRUE 5 5 FALSE IMMEDIATE
--//還有相關引數_ktslj*:
SYS@book> @ hide _ktslj
NAME DESCRIPTION DEFAULT_VALUE SESSION_VALUE SYSTEM_VALUE ISSES ISSYS_MOD
------------------------ ------------------------------------------------------ ------------- ------------- ------------ ----- ---------
_ktslj_segext_max_mb segment pre-extension max size in MB (0: unlimited) TRUE 0 0 FALSE IMMEDIATE
_ktslj_segext_retry segment pre-extension retry TRUE 5 5 FALSE IMMEDIATE
_ktslj_segext_warning segment pre-extension warning threshold in percentage TRUE 10 10 FALSE IMMEDIATE
_ktslj_segext_warning_mb segment pre-extension warning threshold in MB TRUE 0 0 FALSE IMMEDIATE
2.解決方法:
alter system set "_enable_space_preallocation"=0;
--//注意監測表空間的使用定期增加表空間大小.
或者限制增長率:
alter system set "_kttext_warning"=1;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2775010/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle系統表空間過大問題處理Oracle
- interval 分割槽表clob預設表空間指定問題
- oracle建立使用者,表空間,臨時表空間,分配許可權步驟詳解Oracle
- Oracle表空間Oracle
- oracle 表空間Oracle
- 增加oracle表空間Oracle
- oracle temp 表空間Oracle
- oracle 表移動表空間Oracle
- Oracle表移動表空間Oracle
- Oracle臨時表空間檢視、新增臨時表空間資料檔案、修改預設臨時表空間 方法!Oracle
- oracle表空間的整理Oracle
- Oracle 批量建表空間Oracle
- Oracle清理SYSAUX表空間OracleUX
- Oracle 10g大檔案表空間(轉)Oracle 10g
- Oracle Temp 表空間切換Oracle
- Oracle 表空間增加檔案Oracle
- Oracle OCP(49):表空間管理Oracle
- Oracle表空間收縮方案Oracle
- Oracle RMAN 表空間恢復Oracle
- [20181229]關於字串的分配問題.txt字串
- Oracle新建使用者、表空間、表Oracle
- [20210528]Oracle 19c Max_Idle_Blocker_Time Parameter.txtOracleBloC
- 對Oracle分割槽表進行表空間遷移並處理ORA-14511問題Oracle
- Oracle 自動化運維-Python表空間郵件預警Oracle運維Python
- oracle建立臨時表空間和資料表空間以及刪除Oracle
- Oracle的表空間quota詳解Oracle
- oracle臨時表空間相關Oracle
- oracle sql 表空間利用率OracleSQL
- Oracle OCP(47):表空間的建立Oracle
- 【Oracle 恢復表空間】 實驗Oracle
- 【TABLESPACE】Oracle表空間最佳實踐Oracle
- [20210527]rman與undo表空間備份.txt
- 臨時表空間ORA-1652問題解決
- oracle 建立表空間和使用者Oracle
- Oracle建立表空間和使用者Oracle
- Oracle中新建表空間、使用者Oracle
- Oracle中表空間、表、索引的遷移Oracle索引
- ORACLE線上切換undo表空間Oracle