Oracle View trace file step 1. Get current trace file generation path sql> select Tracefile from v$process where addr in (select Paddr from V$se Ssion where SID in (select SID from V$mystat)); Tracefile www.2cto.com ----------------------------------------------------------------------- --------------------------------------------------------f:\oracle\administrator\diag\rdbms\orcl\orcl\trace\ ORCL_ORA_1160.TRC 2. To open the current session's trace sql> alter session set Sql_trace=true; Sql> Select COUNT (*) from T1; 3. Convert TRC file contents to readable output C:\Documents and Settings\administrator>tkprof f:\oracle\administrator\diag\ RDBM s\orcl\orcl\trace\orcl_ora_1160.trc output=c:\aa.txt tkprof:release 11.2.0.1.0-development on Saturday October 6 23: 51:07 Copyright (c) 1982, 2009, Oracle and/or its affiliates. all rights reserved. 4. When you open C:\aa.txt, you will see the execution plan for SQL statement ' SELECT COUNT (*) from T1 [sql] **************************************** **************************************** SQL ID:5BC0V4MY7DVR5 Plan hash:3724264953 SELECT COUNT (*) from www.2cto.com & nbsp  T1 Call count CPU elapsed D ISK query current rows ------------- ---------- -------------------------------------- ---------- Parse 1 0 0.04 0 1 0 0 Execute 1 0.00 0.00 0 0 &NB Sp;0 0 Fetch 2 0.03 0.01 0 1070 0 &NB Sp 1 ------------- ------------------------------------------------ ---------- Total &N Bsp 4 0.03 0.06 0 1071 0 1 misses in library cache During parse:1 Optimizer mode:all_rows parsing user id:91 ROWS Row Source Operation ------- --------------------------------------------------- 1 sort AGGREGATE (cr=1070 pr=0 pw=0 time=0 us) 72597 TABLE ACCESS full T1 (cr=1070 pr=0 Pw=0 time=172543 US cost=298 size=0 card=66014) www.2cto.com ******************************** *********************
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service