ORACLE多個event設定方式

yingyifeng306發表於2022-04-15

設定多個 event 方式:

方法一:

ALTER SYSTEM SET EVENT='10089 trace name context forever, level 1','10235 trace name context forever, level 65536','28401 TRACE NAME CONTEXT FOREVER, LEVEL 1','10129 trace name context forever, level 1','10169 trace name context forever, level 1' scope=spfile;

 

方法二:

ALTER SYSTEM SET event='10089 trace name context forever, level 1:10235 trace name context forever, level 65536:28401 TRACE NAME CONTEXT FOREVER, LEVEL 1:10129 trace name context forever, level 1:10169 trace name context forever, level 1

' SCOPE=SPFILE;

 

 

方法一:

set serveroutput on size 1000000

 

declare

event_level number;

begin

for i in 1..100000 loop

sys.dbms_system.read_ev(i,event_level);

if (event_level > 0) then

dbms_output.put_line('Event '||to_char(i)||' set at level '||

to_char(event_level));

end if;

end loop;

end;

/

 

Event 28401 set at level 1

Event 31156 set at level 1024

 

PL/SQL procedure successfully completed.

 

 

 

  驗證設定的 event 是否生效:

方法二:

How To List All The Named Events Set For A Database (Doc ID 436036.1)

 

1. identify the session

 

   SQL> select p.pid, p.spid, s.username

        from v$process p, v$session s

        where p.addr = s.paddr;

 

 

2. Attach to the desired session

 

   SQL> connect / as sysdba

   SQL> oradebug setorapid <pid>

   - OR -

   SQL> oradebug setospid <spid>

   ...

 

SQL> oradebug setospid 7346

Oracle pid: 19, Unix process pid: 7346, image: oracle@yikuer (TNS V1-V3)

 

SQL> oradebug eventdump session

10169 trace name context forever, level 1

10129 trace name context forever, level 1

28401 TRACE NAME CONTEXT FOREVER, LEVEL 1

10235 trace name context forever, level 65536

10089 trace name context forever, level 1


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23732248/viewspace-2887287/,如需轉載,請註明出處,否則將追究法律責任。

相關文章