1.定位具体xid和sql,可以看到回滚段大小,具体的sqlid
SQL> @trans
SID SERIAL# USERNAME USED_UBLK USED_UREC STATUS START_DATE XID
-------- -------- ------------- ----------- ----------- -------- -------------------- ----------------
497 6069 SYS 1 1 ACTIVE 20-APR-23 050011008E0B0000
select sid,sql_id,OSUSER,PROCESS,MACHINE,TERMINAL,PROGRAM,MODULE,PREV_SQL_ID from v$session where sid='497'; SQL> / SID SQL_ID OSUSER PROCESS MACHINE TERMINAL PROGRAM MODULE PREV_SQL_ID -------- ------------- -------------------- ------------------------ -------------------- ------------------------------ -------------------- ------------------------------ ------------- 497 oracle 20819 vm01 pts/1 sqlplus@vm01 (TNS V1 sqlplus@vm01 (TNS V1-V3) 37drwtbf84008
SQL> @sqltext Parameter 1,SQL_ID (required): Enter value for 1: 37drwtbf84008 37drwtbf84008 ============================== insert into hrz values(100)
2.这里定位出具体语句可以在看一下语句具体是什么原因没有提交是不是数据库自身问题
联系应用是否是程序本身问题,如果应用依赖表中数据
SQL> alter system kill session '497,6069'; System altered.
3.出现了等待事件并且有绑定变量情况
SQL> @sqlbind Enter value for 1: 37drwtbf84008
详:v$sql_bind_capture
显示SQL游标使用的绑定变量的信息,但是不是所有绑定变量数值都显示,只有绑定变量的类型很简单(不包括LONG、LOB和ADT数据类型),并且绑定变量在SQL语句的WHERE或HAVING子句中使用才显示。
4.查看有没有死锁
SQL> delete from hrz where id=400; delete from hrz where id=400 * ERROR at line 1: ORA-00060: deadlock detected while waiting for resource
Deadlock graph: ------------Blocker(s)----------- ------------Waiter(s)------------ Resource Name process session holds waits serial process session holds waits serial TX-00060014-00000BA1-5C2156EE-00000000 33 456 X 42441 61 489 X 33870 TX-0007001F-00000B93-5C2156EE-00000000 61 489 X 33870 33 456 X 42441
注:联系应用处理死锁影响问题
标签:--------,事务,处理过程,绑定,--------------------,session,SQL,oracle,497 From: https://www.cnblogs.com/dbahrz/p/17337246.html