學習oracle動態效能表--v$transaction
v$transaction
V$TRANSACTION lists the active transactions in the system. When the transaction is complete, (either COMMIT or ROLLBACK), the entry should go away.
Column | Datatype | Description |
---|---|---|
ADDR | RAW(4 | 8) | Address of the transaction state object |
XIDUSN | NUMBER | Undo segment number |
XIDSLOT | NUMBER | Slot number |
XIDSQN | NUMBER | Sequence number |
UBAFIL | NUMBER | Undo block address (UBA) filenum |
UBABLK | NUMBER | UBA block number |
UBASQN | NUMBER | UBA sequence number |
UBAREC | NUMBER | UBA record number |
STATUS | VARCHAR2(16) | Status |
START_TIME | VARCHAR2(20) | Start time (wall clock) |
START_SCNB | NUMBER | Start system change number (SCN) base |
START_SCNW | NUMBER | Start SCN wrap |
START_UEXT | NUMBER | Start extent number |
START_UBAFIL | NUMBER | Start UBA file number |
START_UBABLK | NUMBER | Start UBA block number |
START_UBASQN | NUMBER | Start UBA sequence number |
START_UBAREC | NUMBER | Start UBA record number |
SES_ADDR | RAW(4 | 8) | User session object address |
FLAG | NUMBER | Flag |
SPACE | VARCHAR2(3) | YES if a space transaction |
RECURSIVE | VARCHAR2(3) | YES if a recursive transaction |
NOUNDO | VARCHAR2(3) | YES if a no undo transaction |
PTX | VARCHAR 2(3) | YES if parallel transaction |
NAME | VARCHAR2(256) | Name of a named transaction |
PRV_XIDUSN | NUMBER | Previous transaction undo segment number |
PRV_XIDSLT | NUMBER | Previous transaction slot number |
PRV_XIDSQN | NUMBER | Previous transaction sequence number |
PTX_XIDUSN | NUMBER | Rollback segment number of the parent XID |
PTX_XIDSLT | NUMBER | Slot number of the parent XID |
PTX_XIDSQN | NUMBER | Sequence number of the parent XID |
DSCN-B | NUMBER | This column is obsolete and maintained for backward compatibility. The value of this column is always equal to the value in DSCN_BASE. |
DSCN-W | NUMBER | This column is obsolete and maintained for backward compatibility. The value of this column is always equal to the value in DSCN_WRAP. |
USED_UBLK | NUMBER | Number of undo blocks used |
USED_UREC | NUMBER | Number of undo records used |
LOG_IO | NUMBER | Logical I/O |
PHY_IO | NUMBER | Physical I/O |
CR_GET | NUMBER | Consistent gets |
CR_CHANGE | NUMBER | Consistent changes |
START_DATE | DATE | Start time (wall clock) |
DSCN_BASE | NUMBER | Dependent SCN base |
DSCN_WRAP | NUMBER | Dependent SCN wrap |
START_SCN | NUMBER | Start SCN |
DEPENDENT_SCN | NUMBER | Dependent SCN |
XID | RAW(8) | Transaction XID |
PRV_XID | RAW(8) | Previous transaction XID |
PTX_XID | RAW(8) | Parent transaction XID |
示例一:
session A:
建立測試表,並更新
SQL> create table scott.test as select * from dba_objects;
SQL> update test set OBJECT_ID=OBJECT_ID+1;
已更新50343行。
session B:
查詢v$transaction
SQL> select START_TIME,START_SCNB,USED_UBLK,USED_UREC,LOG_IO,PHY_IO
2 from v$transaction;
START_TIME START_SCNB USED_UBLK USED_UREC LOG_IO PHY_IO
--------------- ---------- ---------- --------- ------- ----------
05/05/08 15:13:53 708551 698 54422 185843 0
session A:
再更新一些記錄
SQL> update test set wner='AAA';
已更新50343行。
session B:
再查詢v$transaction
SQL> /
START_TIME START_SCNB USED_UBLK USED_UREC LOG_IO PHY_IO
---------------- ---------- --------- --------- ------- ----------
05/05/08 15:13:53 708551 1269 96902 353324 1
列出這幾列的含義,自己可以對比一下:
start_time --> start_time :)
start_scnb --> 開始的scn
used_ublk --> 佔用的undo block
used_urec --> undo 記錄的行數
log_io --> 邏輯io 注意並非Consistent gets,有專門一列:CR_GET
phy_io --> 物理io
如果想要得到session那就可以再加上查詢SES_ADDR列:
SES_ADDR User session object address -->對應v$session 的saddr列,再進一步自然可以找到正在執行的sql.
如果想要對應回滾段則:
XIDUSN Undo segment number -->使用的回滾段id,可以和v$rollstat對應
想更深入瞭解一個transaction,有了sql就能更深入了。
v$session a, v$transaction b
WHERE a.saddr = b.ses_addr;
---------- ------------------------------ ---------- ---------- ----------
118 CCP 102 12 1
FROM v$session a, v$transaction b
WHERE a.saddr = b.ses_addr;
--------- ------------------------------ ---------- ---------- ----------
596 GCC 87 2 1
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29209863/viewspace-2128688/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- jMeter Transaction Controller 學習筆記JMeterController筆記
- 動態生成表-判斷表是否存在效能對比
- oracle大表效能最佳化Oracle
- 動態規劃學習筆記動態規劃筆記
- oracle 表移動表空間Oracle
- Oracle表移動表空間Oracle
- oracle資料庫事務不同事務隔離級別與v$transaction flag列思考Oracle資料庫
- 17_深入解析Oracle undo原理(1)_transactionOracle
- 跟我一起學習和開發動態表單系統-動態表單系統的技術實現與優勢(2)
- Oracle Haip無法啟動問題學習OracleAI
- 機器學習的靜態特徵和動態特徵機器學習特徵
- PostgreSQL的idle in transaction連線狀態SQL
- 動態元件與v-on元件
- 【MyBatis學習總結 (五),動態SQL】MyBatisSQL
- 李沐動手學深度學習V2-chap_preliminaries深度學習
- 【react】實現動態表單中巢狀動態表單React巢狀
- Vue.js基礎學習(三) -------------動態繫結v-bind的介紹和使用Vue.js
- oracle產生事務transaction幾種方式或方法Oracle
- oracle中的processes,session,transaction引數詳解OracleSession
- ABAP動態內表
- angular動態表單Angular
- 動手學強化學習(四):動態規劃演算法強化學習動態規劃演算法
- java反射之動態代理學習筆記Java反射筆記
- Python學習筆記6——動態型別Python筆記型別
- Oracle學習總結Oracle
- Oracle學習路線Oracle
- oracle之 手動建立 emp 表 與 dept 表Oracle
- oracle的靜態註冊和動態註冊Oracle
- 動態規劃演算法(DP)學習<1>動態規劃演算法
- iOS Tangram(VirtualView)動態元件的學習與使用iOSView元件
- Python學習之路38-動態建立屬性Python
- vue 動態繫結 v-modelVue
- 動態繫結 input v-model
- 8.1關於動態效能檢視
- oracle事務隔離級別transaction isolation level初識Oracle
- oracle學習筆記《一》Oracle筆記
- 【REDO】Oracle redo undo 學習Oracle Redo
- 跟我一起學習和開發動態表單系統-資料庫設計(1)資料庫
- Google Protocol buffer 學習筆記.下篇-動態編譯GoProtocol筆記編譯