查詢holder的操作
工作中經常遇到鎖的問題,但是具體holder到底做了那些操作比較困難,這裡給出一個使用logmnr查詢holder操作的過程
做過那些操作
SELECT
decode(request,0,'holder:','waiter:')||sid sid,id1,id2,lmode,request,type
FROM v$lock
WHERE
(id1,id2,type) IN
(SELECT
id1,id2,type
FROM v$lock
WHERE
request>0)
ORDER BY
id1,request;
SID ID1 ID2 LMODE REQUEST TYPE
holder:143 65542 1645 6 0 TX
waiter:139 65542 1645 0 6 TX
waiter:142 65542 1645 0 6 TX
waiter:144 65542 1645 0 6 TX
假設出現了上述鎖,針對這種情況,做下列操作
SQL> select
group#,thread#,status from v$Log;
GROUP#
THREAD# STATUS
----------
---------- ----------------
1 1 CURRENT
2 1 INACTIVE
3 1 ACTIVE
SQL> alter
system switch logfile;
SQL> select group#,thread#,status from v$Log;
GROUP#
THREAD# STATUS
---------- ----------
----------------
1 1 ACTIVE
2 1 CURRENT
3 1 INACTIVE
SQL> archive
log list;
Database log
mode Archive Mode
Automatic
archival Enabled
Archive
destination c:archstdchicago
Oldest online log
sequence 318
Next log sequence
to archive 320
Current log
sequence 320
EXECUTE
DBMS_LOGMNR.ADD_LOGFILE(LOGFILENAME =>
'C:archchicagoARC00319_0664534646.001',OPTIONS => dbms_logmnr.NEW);
execute
DBMS_LOGMNR.START_LOGMNR(options =>dbms_logmnr.dict_from_online_catalog);
create table
system.test_logmnr as select * from v$logmnr_contents;
execute
DBMS_LOGMNR.END_LOGMNR;
select * from system.test_logmnr t where t.session# =143;
SCN CSCN TIMESTAMP COMMIT_TIMESTAMP THREAD# LOG_ID XIDUSN XIDSLT XIDSQN PXIDUSN PXIDSLT PXIDSQN RBASQN RBABLK RBABYTE UBAFIL UBABLK UBAREC UBASQN ABS_FILE# REL_FILE# DATA_BLK# DATA_OBJ# DATA_OBJD# SEG_OWNER SEG_NAME TABLE_NAME SEG_TYPE SEG_TYPE_NAME TABLE_SPACE ROW_ID SESSION# SERIAL# USERNAME SESSION_INFO TX_NAME ROLLBACK OPERATION OPERATION_CODE SQL_REDO SQL_UNDO RS_ID SEQUENCE# SSN CSF INFO STATUS REDO_VALUE UNDO_VALUE SQL_COLUMN_TYPE SQL_COLUMN_NAME REDO_LENGTH REDO_OFFSET UNDO_LENGTH UNDO_OFFSET DATA_OBJV# SAFE_RESUME_SCN XID PXID AUDIT_SESSIONID
4198405 2009-1-7
17:33:52 1 319 1 6 1645 1 6 1645 319 1569 16 2 0 0 0 0 0 0 0 0 0 AAAAAAAAAAAAAAAAAA 143 55 TEST login_username=TEST client_info=
OS_username=pepeli-cnpepeli Machine_name=CN-ORACLEpepeli-cn
OS_terminal=pepeli-cn OS_process_id=4324:3100 OS_program_name=plsqldev.exe 0 START 6 set
transaction read write;
0x00013f.00000621.0010 1 0 0 0 4396 4397 0 0 0 0 0 010006006D060000 010006006D060000 461199
4198405 2009-1-7 17:33:52 1 319 1 6 1645 1 6 1645 319 1569 16 2 0 0 0 2 4 20 52197 52197 TEST PERSON PERSON 2 TABLE USERS AAAMvlAAEAAAAAUAAA 143 55 TEST login_username=TEST client_info= OS_username=pepeli-cnpepeli Machine_name=CN-ORACLEpepeli-cn OS_terminal=pepeli-cn OS_process_id=4324:3100 OS_program_name=plsqldev.exe 0 UPDATE 3 update "TEST"."PERSON" set "ID" = '201' where "ID" = '1' and "NAME" = 'aa' and ROWID = 'AAAMvlAAEAAAAAUAAA'; update "TEST"."PERSON" set "ID" = '1' where "ID" = '201' and "NAME" = 'aa' and ROWID = 'AAAMvlAAEAAAAAUAAA'; 0x00013f.00000621.0010 1 0 0 0 4398 4399 0 0 0 0 1 010006006D060000 010006006D060000 461199
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/48010/viewspace-1015858/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 常見的查詢操作
- flowable的查詢操作和刪除操作
- Hive高階操作-查詢操作Hive
- 插入查詢資料的操作
- Mysql慢查詢操作梳理MySql
- 閃回版本查詢操作
- MySQL 查詢常用操作(0) —— 查詢語句的執行順序MySql
- [Mysql 查詢語句]——對查詢結果進一步的操作MySql
- filter的pk進行多值查詢操作Filter
- MySQL全面瓦解6:查詢的基本操作MySql
- MongoDB 操作文件 查詢文件MongoDB
- MySQL 之慢查詢相關操作MySql
- 查詢集合操作intersect與minus
- MongoDB之資料查詢操作MongoDB
- 域名資訊查詢怎麼操作?Godaddy的whois域名資訊查詢在哪裡?Go
- 對RPM軟體包的查詢操作
- MongoDB(13)- 查詢操作返回指定的欄位MongoDB
- sql查詢時的一些格式操作SQL
- 如何查詢DML操作的詳細記錄
- [冷楓推薦]:資料庫操作,內外聯查詢,分組查詢,巢狀查詢,交叉查詢,多表查詢,語句小結。資料庫巢狀
- SQLServer DML操作阻塞SELECT查詢SQLServer
- ArcGIS對欄位分割查詢操作
- 查詢集合操作union與union all
- SQL Server之查詢檢索操作SQLServer
- 在查詢列表中使用PRIOR操作
- 《MySQL 基礎篇》四:查詢操作MySql
- Mybatis騷操作-通用查詢工具類MyBatis
- SQL查詢的:子查詢和多表查詢SQL
- MySQL(三) 資料庫表的查詢操作【重要】MySql資料庫
- 查詢熱點快和熱點塊的操作
- 域名查詢資訊怎麼操作?可以查詢哪些資訊?(中科三方)
- MongoDB操作之遍歷集和條件查詢操作MongoDB
- [Oracle Script] latch holderOracle
- cmdb 查詢資料庫操作記錄資料庫
- Spring Boot MongoDB 查詢操作 (BasicQuery ,BSON)Spring BootMongoDB
- SpringDataJpa (二)-動態查詢&多表操作Spring
- SharePoint REST API - OData查詢操作RESTAPI
- 查詢操作佔用cpu很高語句