Enable or Disable Event command in Oracle

Enable or Disable Event at instance, session or for another session in Oracle

Enable or Disable Event at Instance Level:

-- Enable at Instance Level:
ALTER SYSTEM SET EVENTS '<event> trace name context forever, level <level>';

-- Disable at Instance level:
ALTER SYSTEM SET EVENTS '<event> trace name context off';

Enable or Disable Event at Session level:

--Enable at session level:
ALTER SESSION SET EVENTS '<event> trace name context forever, level <level>';

--Disable at Session Level:
ALTER SESSION SET EVENTS '<event> trace name context off';

Enable or Disable event for other Session:

-- Enable for different Session
EXECUTE dbms_system.set_ev (sid,serial#,eventnumber,level,'');
Exmple: Session id 109 serial# 2456
EXECUTE dbms_system.set_ev (109,2456,10046,8,'');

--Disable the event for session:
EXECUTE dbms_system.set_ev (109,2456,10046,0,'');

1 thought on “Enable or Disable Event command in Oracle

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.