天天看點

ORACLE EVENT事件跟蹤

設定10035事件

SQL> exec dbms_workload_repository.create_snapshot();

PL/SQL procedure successfully completed.

SQL>  alter session set events '10035 trace name context forever,level 1';

Session altered.

SQL>

SQL>  alter system set events '10035 trace name context forever,level 1';

System altered.

SQL>

檢視sql來源:

# 這種一般是plsql等用戶端的工具寫的sql

SQL> oradebug setospid 26630;

Oracle pid: 67, Unix process pid: 26630, image: [email protected]

SQL> oradebug setospid 52811;

ORA-00072: process "52811" is not active

SQL>

# 一般是應用程式過來的sql語句

SQL> oradebug setospid 57135;

ORA-00072: process "57135" is not active

SQL>

看到alert log後,記得關閉:

ALTER SYSTEM SET EVENTS '10035 trace name context off';