Documente Academic
Documente Profesional
Documente Cultură
http://alexzeng.wordpress.com/2008/08/01/how-to-trace-oracle-sessions/
HOME HOME
AUTOMATION AUTOMATION
ORACLE
MYSQL MYSQL
MONGODB
CASSANDRA
ABOUT
POSTS
COMMENTS
Visitor map
1. alter session set events 10046 trace name context forever,level 12;
Recent Posts
A script to format pseudo code
alter session set tracefile_identifier=10046; alter session set timed_statistics = true; alter session set statistics_level=all; alter session set max_dump_file_size = unlimited;
# Expert Oracle Practices # Troubleshooting Latch Contention How-to avoid ssh prompt for password How-to Find & Replace a string in all files within a directory
Start trace:
# Expert Oracle Practices # Statistics # Expert Oracle Practices # Managing the Very
alter session set events 10046 trace name context forever,level 12;
Stop trace:
Performance Optimization Methods Oracle session, server process and virtual circuit in shared server mode (MTS)
EXECUTE DBMS_MONITOR.SESSION_TRACE_ENABLE(session_id => 27, serial_num =>Backup 60,waits => Cacti script EXECUTE DBMS_MONITOR.SESSION_TRACE_DISABLE(session_id => 27, serial_num => 60);
Backup MySQL using mysqldump script # Expert Oracle Practices # Battle Against
Trace a module:
Any Guess Oracle Core # RAC, 1-way, 2-way and 3-way block transfer Oracle Core # Hard parse, soft parse, soft soft parse, no parse at all How to install spine for cacti A script to patch oracle binary Copy and verify file from remote host script How-to setup MySQL HA by using keepalived Evaluate Oracle AWR (Automatic Workload Repository) How-to setup mysql replication in simple steps How-to fix MyISAM table after disk full
4/17/2013 3:55 AM
http://alexzeng.wordpress.com/2008/08/01/how-to-trace-oracle-sessions/
EXECUTE DBMS_MONITOR.SERV_MOD_ACT_TRACE_ENABLE(
service_name=>'vasont.world', module_name=>'VasontU.exe',
action_name=>DBMS_MONITOR.ALL_ACTIONS,waits=>TRUE,
for Oracle logical standby How-to create a SQL test case for Oracle support
How-to rebuild a MongoDB node Oracle Core # How does oracle do a data change Redo and Undo
service_name=>'vasont.world',module_name=>'VasontU.exe');
How-to use scripts to create cacti templates How-to find the SQL that using lots of temp tablespace in Oracle
Note: not available before 10g, can trace any session 3. Using package DBMS_SESSION
How-to restore MongoDB from raw data files Get the final blocker sessions in Oracle Oracle Analytic SQL Example:
How-to kill oracle sessions as you wish How-to check an oracle sessions uga/pga How-to drop an active oracle user
How-to add new device to cacti by script SQL Plan Management handy commands
How-to write Python for Oracle How-to write Python for MySQL
How-to write Python for Cassandra How-to write Python for MongoDB
serial#=>4957,sql_trace=>FALSE);
Archives
Note: available in 8i/9i/10g, can trace any session, package is wrapped. 5. oradebug Trace session sid=58;select p.PID,p.SPID from v$process p,v$session s where s.paddr = p.addr and s.sid = 58; PID SPID - 32 12943 connect / as sysdba oradebug setospid 12943 //or oradebug unlimit oradebug event 10046 trace name context forever,level 12 oradebug setorapid 32
Kerry Osborne Pythian Blog Tanel Poder Select Month
Blogroll
Alex Fatkulin Alex Gorbachev Andrey S. Nikolaev Latch, mutex and beyond Cary Millsap Jonathan Lewis
Stop trace: oradebug event 10046 trace name context off Note: available in 8i/9i/10g, can trace any session
Tom Kyte
Meta
Register
4/17/2013 3:55 AM
http://alexzeng.wordpress.com/2008/08/01/how-to-trace-oracle-sessions/
Comments RSS
waits=>true, binds=>true ); exec DBMS_SUPPORT.STOP_TRACE_IN_SESSION( &SID , null ); NOTE: need to install before use
WordPress.com
SQL> connect / AS SYSDBA SQL> @?\rdbms\admin\dbmssupp.sql SQL> GRANT execute ON dbms_support TO schema_owner; SQL> CREATE PUBLIC SYNONYM dbms_support FOR dbms_support;
7. Using trcsess trcsess [output=output_file_name] [session=session_id] [clientid=client_id] [service=service_name] [action=action_name] [module=module_name] [trace_files]
alter system set events '10046 trace name context forever,level 12'; or event="10046 trace name context forever,level 12"
CREATE OR REPLACE TRIGGER SYS.set_trace AFTER LOGON ON DATABASE WHEN (USER like '&USERNAME') DECLARE lcommand varchar(200); BEGIN EXECUTE IMMEDIATE 'alter session set statistics_level=ALL'; EXECUTE IMMEDIATE 'alter session set max_dump_file_size=UNLIMITED'; EXECUTE IMMEDIATE 'alter session set events ''10046 trace
4/17/2013 3:55 AM
http://alexzeng.wordpress.com/2008/08/01/how-to-trace-oracle-sessions/
END set_trace; /
About Alex Zeng I would be very happy if this blog can help you. I appreciate every honest comments. Please forgive me if I'm too busy to reply your comments in time.
Hey, cool tips. Perhaps Ill buy a glass of beer to the man from that forum who told me to visit your site
Reply
neworacledba says:
February 26, 2010 at 10:10 pm
this is a great post and most needed for daily operational task
Reply
alan says:
March 11, 2010 at 5:14 pm
Good effort to provide such wonderful tip of session tracing enable in all versions of Oracle. Great work. Keep it up.
Reply
Alex says:
July 28, 2010 at 8:58 am
4/17/2013 3:55 AM
http://alexzeng.wordpress.com/2008/08/01/how-to-trace-oracle-sessions/
Alex says:
November 16, 2011 at 8:50 am
I agree with aforesaid, this is short, comprehensive and, what is most important, easy for reading and understanding.
Reply
Thanks. -Alex
Reply
joseph says:
March 7, 2012 at 3:06 pm
B Beberman says:
November 14, 2012 at 6:44 pm
Leave a Reply
Blog at WordPress.com .
4/17/2013 3:55 AM