For sql / procedure / function trace (more effective way to tuning the execution path)
1. for seeing the trace file path , execute the following query
SELECT s.sid, s.serial#, pa.value '\' LOWER(SYS_CONTEXT('userenv','instance_name')) '_ora_' p.spid '.trc' AS trace_fileFROM v$session s, v$process p, v$parameter paWHERE pa.name = 'user_dump_dest'AND s.paddr = p.addrAND s.audsid = SYS_CONTEXT('USERENV', 'SESSIONID');
2. for trace file identifier(optional)
alter session set tracefile_identifier = 'LONG_RUNNING_QUERY';
3. for anable the session lebel trace file generate
ALTER SESSION SET EVENTS '10046 trace name context forever, level 8';
4. execute your tuning able objects or query
5.execute the following command for better readable format
$ tkprof trc_file_name Output_file_name.txt
example:-
$ tkprof F:\ORACLE\product\10.2.0 \admin\DBA\udump\dba_ora_3920.trc c:\transte.txt
6. Turn off the Trace
ALTER SESSION SET EVENTS '10046 trace name context off';
----------end-------------------------------------
Halim, a Georgia Tech graduate Senior Database Engineer/Data Architect based in Atlanta, USA, is an Oracle OCP DBA and Developer, Certified Cloud Architect Professional, and OCI Autonomous Database Specialist. With extensive expertise in database design, configuration, tuning, capacity planning, RAC, DG, scripting, Python, APEX, and PL/SQL, he combines technical mastery with a passion for innovation. Notably, Halim secured 16th place worldwide in PL/SQL Challenge Cup Playoff on the year 2010.
Subscribe to:
Post Comments (Atom)
My Blog List
-
-
-
ASSM states3 weeks ago
-
UKOUG Discover 20241 month ago
-
-
-
-
-
-
-
-
Moving Sideways8 years ago
-
-
Upcoming Events...11 years ago
-
No comments:
Post a Comment