使用_smu_debug_mode瞭解undo tablespace
背景
為了進一步研究undo segment header block中的事務SLOT重用機制,需要多個不同會話使用相同的undo segment header block,本文應時而生。結論
1,oracle隱含引數相當牛比,我認為分析及加深對於它的理解有幾個維度a,查詢與某個關鍵字匹配的隱含引數,進行測試總結
b,透過MOS查詢BUG找到某些隱含引數,一般情況下,這些隱含引數用於臨時解決或遮蔽BUG的,也可以順勢理解隱含引數的含義
c,網上其它大牛的BLOG,獲取分析一些隱含引數的函式
d,因為資料庫遷移或升級,配置一些隱含引數,比如關閉好多新特性,這也是你瞭解它的一個重要視窗
e,還有其它的方式,歡迎交流與補充
2,在aum即撤消表空間自動管理模式下,可以透過配置引數 _smu_debug_mode 手工指定會話事務使用指定的回滾段
3,_smu_debug_mode的含義,請見mos:420525.1
這裡引申一個重要方法:當你研究技術到一定程度時,透過某個關鍵字到MOS即可以查到更有價值的文章或方法,或者在GOOGLE中查
4,也可以手工管理撤消表空間模式下,手工為會話事務指定回滾段
不過這個回滾段必須是手工建立的回滾段
5,在手工管理撤消表空間模式下,除了SYSTEM ROLLBACK SEGMENT,其它的回滾段在資料庫剛啟動時,全是OFFLINE
6,在手工管理撤消表空間模式下,原來基於自動管理撤消表空間模式下UNDO TBS的回滾段不能手工ONLINE及OFFLINE
我理解這是處於2幾種機制的考慮,更進一步的理解還要測試
7, _smu_debug_mode 必須以系統層面方可生效即ALTER SYSTEM ,大家且不要在生產上調整,這裡我僅是為了測試
8,undo_management引數調整必須重啟庫
測試
SQL> select * from v$version where rownum=1;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
_smu_debug_mode 0 - set debug event for testing SMU ope
rations
SQL> select segment_name,status from dba_rollback_segs;
SEGMENT_NAME STATUS
------------------------------ ----------------
SYSTEM ONLINE
_SYSSMU1$ ONLINE
_SYSSMU2$ ONLINE
_SYSSMU3$ ONLINE
_SYSSMU4$ ONLINE
_SYSSMU5$ ONLINE
_SYSSMU6$ ONLINE
_SYSSMU7$ ONLINE
_SYSSMU8$ ONLINE
_SYSSMU9$ ONLINE
_SYSSMU10$ ONLINE
11 rows selected.
SQL> conn scott/system
Connected.
SQL> create table t_undo_seg(a int);
Table created.
SQL> insert into t_undo_seg values(1);
1 row created.
SQL> select xidusn,xidslot,xidsqn from v$transaction;
XIDUSN XIDSLOT XIDSQN
---------- ---------- ----------
3 42 219
SQL> select usn,name from v$rollname where usn=3;
USN NAME
---------- ------------------------------
3 _SYSSMU3$
--新啟一會話,手工指定和上述事務相同的回滾段
SQL> set transaction use rollback segment "_SYSSMU3$";
Transaction set.
SQL> insert into t_undo_seg values(3);
1 row created.
---可見沒有實現指定會話使用指定的回滾段
SQL> select xidusn,xidslot,xidsqn from v$transaction;
XIDUSN XIDSLOT XIDSQN
---------- ---------- ----------
3 42 219
2 30 208 ---
---undo處於AUM模式
SQL> show parameter undo
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_management string AUTO
undo_retention integer 900
undo_tablespace string UNDOTBS1
--- _smu_debug_mode無法在會話級別修改,只能以系統層面修改
SQL> alter session set "_smu_debug_mode"=45;
alter session set "_smu_debug_mode"=45
*
ERROR at line 1:
ORA-02096: specified initialization parameter is not modifiable with this
option
SQL> alter system set "_smu_debug_mode"=45;
System altered.
---再次在會話中指定回滾段
SQL> set transaction use rollback segment "_SYSSMU3$";
Transaction set.
SQL> insert into t_undo_seg values(3);
1 row created.
---這下發現已經成功手工指定回滾段
SQL> select xidusn,xidslot,xidsqn from v$transaction;
XIDUSN XIDSLOT XIDSQN
---------- ---------- ----------
3 42 219
3 14 221
---再看看在撤消表空間手工模式下,如何手工指定回滾段
SQL> alter system set "_smu_debug_mode"=0;
System altered.
SQL> show parameter undo
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_management string AUTO
undo_retention integer 900
undo_tablespace string UNDOTBS1
SQL> alter system set undo_management='manual';
alter system set undo_management='manual'
*
ERROR at line 1:
ORA-02095: specified initialization parameter cannot be modified
SQL> alter system set undo_management='manual' scope=spfile;
System altered.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 901775360 bytes
Fixed Size 2100424 bytes
Variable Size 226493240 bytes
Database Buffers 666894336 bytes
Redo Buffers 6287360 bytes
Database mounted.
Database opened.
SQL> show parameter undo
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_management string MANUAL
undo_retention integer 900
undo_tablespace string UNDOTBS1
SQL>
---可見手工管理撤消表空間,資料庫啟動後,除了SYSTEM ROLLBACK SEGMENT,其它的回滾段全是OFFLINE
SQL> select segment_name,status from dba_rollback_segs;
SEGMENT_NAME STATUS
------------------------------ ----------------
SYSTEM ONLINE
_SYSSMU1$ OFFLINE
_SYSSMU2$ OFFLINE
_SYSSMU3$ OFFLINE
_SYSSMU4$ OFFLINE
_SYSSMU5$ OFFLINE
_SYSSMU6$ OFFLINE
_SYSSMU7$ OFFLINE
_SYSSMU8$ OFFLINE
_SYSSMU9$ OFFLINE
_SYSSMU10$ OFFLINE
11 rows selected.
SQL> alter rollback segment "_SYSSMU5$" online;
alter rollback segment "_SYSSMU5$" online
*
ERROR at line 1:
ORA-30017: segment '_SYSSMU5$' is not supported in MANUAL Undo Management mode
SQL> host oerr ora 30017
30017, 00000, "segment '%s' is not supported in %s Undo Management mode"
// *Cause: the type of the specified undo segment is incompatible with
// the current undo management mode of the instance.
// *Action: Check the undo segment name and the undo management mode
// and reissue statement if necessary
SQL> select usn,name from v$rollname;
USN NAME
---------- ------------------------------
0 SYSTEM
SQL> desc v$rollstat;
Name Null? Type
----------------- -------- ------------
USN NUMBER
LATCH NUMBER
EXTENTS NUMBER
RSSIZE NUMBER
WRITES NUMBER
XACTS NUMBER
GETS NUMBER
WAITS NUMBER
OPTSIZE NUMBER
HWMSIZE NUMBER
SHRINKS NUMBER
WRAPS NUMBER
EXTENDS NUMBER
AVESHRINK NUMBER
AVEACTIVE NUMBER
STATUS VARCHAR2(15)
CUREXT NUMBER
CURBLK NUMBER
SQL> select count(*) from v$rollstat;
COUNT(*)
----------
1
SQL> create rollback segment manual_undo_seg1 tablespace undotbs1;
Rollback segment created.
SQL> select segment_name,status from dba_rollback_segs;
SEGMENT_NAME STATUS
------------------------------ ----------------
SYSTEM ONLINE
_SYSSMU1$ OFFLINE
_SYSSMU2$ OFFLINE
_SYSSMU3$ OFFLINE
_SYSSMU4$ OFFLINE
_SYSSMU5$ OFFLINE
_SYSSMU6$ OFFLINE
_SYSSMU7$ OFFLINE
_SYSSMU8$ OFFLINE
_SYSSMU9$ OFFLINE
_SYSSMU10$ OFFLINE
SEGMENT_NAME STATUS
------------------------------ ----------------
MANUAL_UNDO_SEG1 OFFLINE
12 rows selected.
---僅手工建立的回滾段方可手工ONLINE或OFFLINE
SQL> alter rollback segment "MANUAL_UNDO_SEG1" online;
Rollback segment altered.
SQL> select segment_name,status from dba_rollback_segs;
SEGMENT_NAME STATUS
------------------------------ ----------------
SYSTEM ONLINE
_SYSSMU1$ OFFLINE
_SYSSMU2$ OFFLINE
_SYSSMU3$ OFFLINE
_SYSSMU4$ OFFLINE
_SYSSMU5$ OFFLINE
_SYSSMU6$ OFFLINE
_SYSSMU7$ OFFLINE
_SYSSMU8$ OFFLINE
_SYSSMU9$ OFFLINE
_SYSSMU10$ OFFLINE
SEGMENT_NAME STATUS
------------------------------ ----------------
MANUAL_UNDO_SEG1 ONLINE
12 rows selected.
SQL> select usn,name from v$rollname;
USN NAME
---------- --------------------------------------------------
0 SYSTEM
11 MANUAL_UNDO_SEG1
---會話手工指定
SQL> set transaction use rollback segment "MANUAL_UNDO_SEG1";
Transaction set.
SQL> insert into t_undo_seg values(888);
SQL> select xidusn,xidslot,xidsqn from v$transaction;
XIDUSN XIDSLOT XIDSQN
---------- ---------- ----------
11 1 2
1 row created.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-1852494/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- tablespace 大檔案,undo,temp tablespace
- Oracle OCP(48):UNDO TABLESPACEOracle
- oracle 切換undo tablespace小結Oracle
- Run Out Of Space On UNDO Tablespace Using DataPump Import/ExportImportExport
- oracle10g undo tablespace相關知識Oracle
- 處理undo tablespace損環_rman-06054_一則
- 【UNDO】使用重建UNDO表空間方法解決UNDO表空間過大問題
- ORA-30046: Undo tablespace UNDOTBS1 not found in control file 無undo啟動庫
- 瞭解Git及其使用Git
- MySQL Transportable Tablespace(傳輸表空間) 使用詳解MySql
- CREATE TABLESPACE命令詳解
- oracle undo 使用分析Oracle
- 學習瞭解使用dockerDocker
- 瞭解何時使用RabbitMQMQ
- ORA-30012 undo tablespace 'UNDOTBS3' does not exist or of wrong typeS3
- Oracle - ORA-30036: unable to extend segment by 8 in undo tablespace 'UNDOTBS1'Oracle
- oracle管理之 undo tablespace(server.102 b14231)OracleServer
- 必須瞭解的mysql三大日誌-binlog、redo log和undo logMySql
- undo表空間使用率過高解決
- [Oracle] 檢視tablespace的使用率(Including temp tablespace)Oracle
- CREATE TABLESPACE命令詳解(轉)
- Oracle undo管理詳解Oracle
- JDBC的初步瞭解及使用JDBC
- 瞭解使用wireshark抓包工具
- Oracle UNDO引數詳解Oracle
- _smu_debug_mode在AUM下的應用
- vue瞭解與初步接觸/使用Vue
- 瞭解過、使用過的程式語言及其優勢,瞭解過、使用過的程式設計工具程式設計
- mysql5.7 General tablespace使用說明MySql
- 瞭解Vuex方法的使用初級篇Vue
- Oracle Undo使用情況監控Oracle
- 【TABLESPACE】使用“ALTER TABLESPACE”命令的“RENAME”功能實現表空間快速重新命名
- UNDO表空間不足解決方法
- undo日誌一些解釋
- 瞭解並使用 CSS 中的 rem 單位CSSREM
- 檢視Undo使用情況的SQLSQL
- 使用 top 命令瞭解 Fedora 的記憶體使用情況記憶體
- runLoop瞭解OOP