ORACLE 10046、10053 事件

内容参考 http://blog.csdn.net/tianlesoftware/article/details/5857023

10046 、10053 事件

平时用PL/SQL,在开发的过程中经常会有这样一种情况:发出一个语句后一直在运行,看了查询优化器给的执行计划,还是不能准确地了解数据库内部是怎么运行的?有一种想干嘛又无从下手的感觉,就像小时候拆卸钟表一样想弄清楚表针为什么会转,靠着什么一直再转;在这里10046结合tkprof工具以及10053事件可以解决这种烦恼(SQL_TRACE也可以进行跟踪,不过ORACLE已经不建议使用该功能:Although it is possible to enable the SQL Trace facility for a session or for an instance, it is recommended that you use the DBMS_SESSION or DBMS_MONITOR packages instead. When the SQL Trace facility is enabled for a session or for an instance, performance statistics for all SQL statements executed in a user session or in the instance are placed into trace files. Using the SQL Trace facility can have a severe performance impact and may result in increased system overhead, excessive CPU usage, and inadequate disk space.);

10046 事件

SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE    10.2.0.3.0      Production
TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production


10046 事件按照收集信息内容,可以分成4个级别:

                Level 1: 等同于SQL_TRACE 的功能

                Level 4: 在Level 1的基础上增加收集绑定变量的信息

                Level 8: 在Level 1 的基础上增加等待事件的信息

                Level 12:等同于Level 4+Level 8, 即同时收集绑定变量信息和等待事件信息。

session  135  发出以下语句

--找出trace文件
SELECT D.VALUE || '\' || LOWER(RTRIM(I.INSTANCE, CHR(0))) || '_ora_' ||
       P.SPID || '.trc' AS "trace_file_name"
  FROM (SELECT P.SPID
          FROM V$MYSTAT M, V$SESSION S, V$PROCESS P
         WHERE M.STATISTIC# = 1
           AND S.SID = M.SID
           AND P.ADDR = S.PADDR) P,
       (SELECT T.INSTANCE
          FROM V$THREAD T, V$PARAMETER V
         WHERE V.NAME = 'thread'
           AND (V.VALUE = 0 OR T.THREAD# = TO_NUMBER(V.VALUE))) I,
       (SELECT VALUE FROM V$PARAMETER WHERE NAME = 'user_dump_dest') D;

E:\ORACLE\PRODUCT\10.2.0\ADMIN\ORCL\UDUMP\ORCL_ora_17728.trc

--标示trace文件名称,便于查找. tracefile_identifier 描述:
http://docs.oracle.com/cd/E11882_01/server.112/e25513/initparams259.htm#REFRN10220
ALTER SESSION SET tracefile_identifier='YJG';
ALTER SESSION SET EVENTS '10046 trace name context forever,level 12';
SELECT *
  FROM (SELECT M.INITIALENTRY,
               M.VENDORNO_,
               M.COMPANY_ID,
               M.ENTRYTYPE,
               M.POSTINGDATE,
               M.POSTINGGROUP,
               M.AMOUNT,
               M.INVT_INIT
          FROM ODS_DETAILEDVENDORLEDG_ENTRY M
         WHERE NOT EXISTS
         (SELECT 1
                  FROM DM_COMPANY T, CONNECT_JYYB_DEL F
                 WHERE T.COMPANY_ID IS NOT NULL
                   AND T.DB_NAME = F.DATABASENAME
                   AND T.DB_TABLE_DESC = F.COMPANYCODE
                   AND T.DB_IP = F.DATABASEADRESS
                   AND T.COMPANY_ID = M.COMPANY_ID
                   AND F.CONNECTVENDORNO = M.VENDORNO_
                   AND f.departno=m.initialentry)) B
 WHERE COMPANY_ID = 1
   AND INITIALENTRYGLOBALDIM_1 = 212
   AND B.INVT_INIT = 0
   AND B.ENTRYTYPE <> 2
   AND B.POSTINGDATE <= TO_DATE('20130406', 'yyyy-mm-dd')
   AND B.POSTINGGROUP != 'EMP-YB';
  
ALTER SESSION SET EVENTS '10046 trace name context OFF';

 


--TKPROF 用法(官方文档)
Syntax of TKPROF:
TKPROF is run from the operating system prompt. The syntax is:

tkprof filename1 filename2 [waits=yes|no] [sort=option] [print=n]
    [aggregate=yes|no] [insert=filename3] [sys=yes|no] [table=schema.table]
    [explain=user/password] [record=filename4] [width=n]


The input and output files are the only required arguments. If you invoke TKPROF without arguments, then the tool displays online help. Use the arguments in Table 21-2 with TKPROF.

Table 21-2 TKPROF Arguments

Argument Description
filename1
 Specifies the input file, a trace file containing statistics produced by the SQL Trace facility. This file can be either a trace file produced for a single session, or a file produced by concatenating individual trace files from multiple sessions.
 
filename2
 Specifies the file to which TKPROF writes its formatted output.
 
WAITS
 Specifies whether to record summary for any wait events found in the trace file. Values are YES or NO. The default is YES.
 
SORTS
 Sorts traced SQL statements in descending order of specified sort option before listing them into the output file. If multiple options are specified, then the output is sorted in descending order by the sum of the values specified in the sort options. If you omit this parameter, then TKPROF lists statements into the output file in order of first use. Sort options are listed as follows:
 
PRSCNT
 Number of times parsed.
 
PRSCPU
 CPU time spent parsing.
 
PRSELA
 Elapsed time spent parsing.
 
PRSDSK
 Number of physical reads from disk during parse.
 
PRSQRY
 Number of consistent mode block reads during parse.
 
PRSCU
 Number of current mode block reads during parse.
 
PRSMIS
 Number of library cache misses during parse.
 
EXECNT
 Number of executes.
 
EXECPU
 CPU time spent executing.
 
EXEELA
 Elapsed time spent executing.
 
EXEDSK
 Number of physical reads from disk during execute.
 
EXEQRY
 Number of consistent mode block reads during execute.
 
EXECU
 Number of current mode block reads during execute.
 
EXEROW
 Number of rows processed during execute.
 
EXEMIS
 Number of library cache misses during execute.
 
FCHCNT
 Number of fetches.
 
FCHCPU
 CPU time spent fetching.
 
FCHELA
 Elapsed time spent fetching.
 
FCHDSK
 Number of physical reads from disk during fetch.
 
FCHQRY
 Number of consistent mode block reads during fetch.
 
FCHCU
 Number of current mode block reads during fetch.
 
FCHROW
 Number of rows fetched.
 
USERID
 Userid of user that parsed the cursor.
 
PRINT
 Lists only the first integer sorted SQL statements from the output file. If you omit this parameter, then TKPROF lists all traced SQL statements. This parameter does not affect the optional SQL script. The SQL script always generates insert data for all traced SQL statements.
 
AGGREGATE
 If you specify AGGREGATE = NO, then TKPROF does not aggregate multiple users of the same SQL text.
 
INSERT
 Creates a SQL script that stores the trace file statistics in the database. TKPROF creates this script with the name filename3. This script creates a table and inserts a row of statistics for each traced SQL statement into the table.
 
SYS
 Enables and disables the listing of SQL statements issued by the user SYS, or recursive SQL statements, into the output file. The default value of YES causes TKPROF to list these statements. The value of NO causes TKPROF to omit them. This parameter does not affect the optional SQL script. The SQL script always inserts statistics for all traced SQL statements, including recursive SQL statements.
 
TABLE
 Specifies the schema and name of the table into which TKPROF temporarily places execution plans before writing them to the output file. If the specified table exists, then TKPROF deletes all rows in the table, uses it for the EXPLAIN PLAN statement (which writes more rows into the table), and then deletes those rows. If this table does not exist, then TKPROF creates it, uses it, and then drops it.

The specified user must be able to issue INSERT, SELECT, and DELETE statements against the table. If the table does not exist, then the user must also be able to issue CREATE TABLE and DROP TABLE statements. For the privileges to issue these statements, see the Oracle Database SQL Language Reference.

This option allows multiple individuals to run TKPROF concurrently with the same user in the EXPLAIN value. These individuals can specify different TABLE values and avoid destructively interfering with each other's processing on the temporary plan table.

If you use the EXPLAIN parameter without the TABLE parameter, then TKPROF uses the table PROF$PLAN_TABLE in the schema of the user specified by the EXPLAIN parameter. If you use the TABLE parameter without the EXPLAIN parameter, then TKPROF ignores the TABLE parameter.

If no plan table exists, TKPROF creates the table PROF$PLAN_TABLE and then drops it at the end.
 
EXPLAIN
 Determines the execution plan for each SQL statement in the trace file and writes these execution plans to the output file. TKPROF determines execution plans by issuing the EXPLAIN PLAN statement after connecting to Oracle Database with the user and password specified in this parameter. The specified user must have CREATE SESSION system privileges. TKPROF takes longer to process a large trace file if the EXPLAIN option is used.
 
RECORD
 Creates a SQL script with the specified filename4 with all of the nonrecursive SQL in the trace file. You can use this script to replay the user events from the trace file.
 
WIDTH
 An integer that controls the output line width of some TKPROF output, such as the explain plan. This parameter is useful for post-processing of TKPROF output.
 


-- The SQL Trace facility and TKPROF let you accurately assess the efficiency of the SQL statements an application runs. For best results, use these tools with EXPLAIN PLAN rather than using EXPLAIN PLAN alone.


session 146

tkprof ORCL_ora_17728_YJG.trc  ORCL_ora_17728.txt sys=no insert=ORCL_ora_17728_yjg.sql;


SQL> show parameter user_dump
 
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
user_dump_dest                       string      E:\ORACLE\PRODUCT\10.2.0\ADMIN\ORCL\UDUMP

--在该路径下打开文件ORCL_ora_17728.txt 内容如下

TKPROF: Release 10.2.0.4.0 - Production on Wed Apr 24 14:45:27 2013

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

Trace file: ORCL_ora_17728_YJG.trc
Sort options: default

********************************************************************************
count    = number of times OCI procedure was executed
cpu      = cpu time in seconds executing
elapsed  = elapsed time in seconds executing
disk     = number of physical reads of buffers from disk
query    = number of buffers gotten for consistent read
current  = number of buffers gotten in current mode (usually for update)
rows     = number of rows processed by the fetch or execute call
********************************************************************************

begin :id := sys.dbms_transaction.local_transaction_id; end;


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        2      0.00       0.00          0          0          0           0
Execute      2      0.00       0.00          0          0          0           2
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        4      0.00       0.00          0          0          0           2

Misses in library cache during parse: 0
Optimizer mode: ALL_ROWS
Parsing user id: 58 

Elapsed times include waiting on following events:
  Event waited on                             Times   Max. Wait  Total Waited
  ----------------------------------------   Waited  ----------  ------------
  SQL*Net message to client                       3        0.00          0.00
  SQL*Net message from client                     3        0.02          0.05
  SQL*Net break/reset to client                   1        0.00          0.00
********************************************************************************

SELECT *
  FROM (SELECT M.INITIALENTRY,
               M.VENDORNO_,
               M.COMPANY_ID,
               M.ENTRYTYPE,
               M.POSTINGDATE,
               M.POSTINGGROUP,
               M.AMOUNT,
               M.INVT_INIT
          FROM ODS_DETAILEDVENDORLEDG_ENTRY M
         WHERE NOT EXISTS
         (SELECT 1
                  FROM DM_COMPANY T, CONNECT_JYYB_DEL F
                 WHERE T.COMPANY_ID IS NOT NULL
                   AND T.DB_NAME = F.DATABASENAME
                   AND T.DB_TABLE_DESC = F.COMPANYCODE
                   AND T.DB_IP = F.DATABASEADRESS
                   AND T.COMPANY_ID = M.COMPANY_ID
                   AND F.CONNECTVENDORNO = M.VENDORNO_
                   AND f.departno=m.initialentry)) B
 WHERE COMPANY_ID = 1
   AND INITIALENTRYGLOBALDIM_1 = 212
   AND B.INVT_INIT = 0
   AND B.ENTRYTYPE <> 2
   AND B.POSTINGDATE <= TO_DATE('20130406', 'yyyy-mm-dd')
   AND B.POSTINGGROUP != 'EMP-YB'

call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.01       0.00          0          0          0           0
Execute      1      0.00       0.00          0          0          0           0
Fetch        1      0.06       0.07          0       2072          0         100
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        3      0.08       0.08          0       2072          0         100

Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 58 

Elapsed times include waiting on following events:
  Event waited on                             Times   Max. Wait  Total Waited
  ----------------------------------------   Waited  ----------  ------------
  SQL*Net message to client                       3        0.00          0.00
  SQL*Net message from client                     3        0.02          0.02
********************************************************************************

ALTER SESSION SET EVENTS '10046 trace name context OFF'


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      1      0.00       0.00          0          0          0           0
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2      0.00       0.00          0          0          0           0

Misses in library cache during parse: 0
Parsing user id: 58 

 

********************************************************************************

OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS

call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        4      0.01       0.00          0          0          0           0
Execute      4      0.00       0.00          0          0          0           2
Fetch        1      0.06       0.07          0       2072          0         100
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        9      0.08       0.08          0       2072          0         102

Misses in library cache during parse: 1

Elapsed times include waiting on following events:
  Event waited on                             Times   Max. Wait  Total Waited
  ----------------------------------------   Waited  ----------  ------------
  SQL*Net message to client                       6        0.00          0.00
  SQL*Net message from client                     6        0.02          0.08
  SQL*Net break/reset to client                   1        0.00          0.00


OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS

call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        0      0.00       0.00          0          0          0           0
Execute      0      0.00       0.00          0          0          0           0
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        0      0.00       0.00          0          0          0           0

Misses in library cache during parse: 0

    4  user  SQL statements in session.
    0  internal SQL statements in session.
    4  SQL statements in session.
********************************************************************************
Trace file: ORCL_ora_17728_YJG.trc
Trace file compatibility: 10.01.00
Sort options: default

       1  session in tracefile.
       4  user  SQL statements in trace file.
       0  internal SQL statements in trace file.
       4  SQL statements in trace file.
       3  unique SQL statements in trace file.
     112  lines in trace file.
       0  elapsed seconds in trace file.


 
--行标题意义
CALL
  Statistics are identified by the value of the CALL column

COUNT
 Number of times a statement was parsed, executed, or fetched.
 
CPU
 Total CPU time in seconds for all parse, execute, or fetch calls for the statement. This value is zero (0) if TIMED_STATISTICS is not turned on.
 
ELAPSED
 Total elapsed time in seconds for all parse, execute, or fetch calls for the statement. This value is zero (0) if TIMED_STATISTICS is not turned on.
 
DISK
 Total number of data blocks physically read from the data files on disk for all parse, execute, or fetch calls.
 
QUERY
 Total number of buffers retrieved in consistent mode for all parse, execute, or fetch calls. Usually, buffers are retrieved in consistent mode for queries.
 
CURRENT
 Total number of buffers retrieved in current mode. Buffers are retrieved in current mode for statements such as INSERT, UPDATE, and DELETE.
 
ROWS
 Total number of rows processed by the SQL statement. This total does not include rows processed by subqueries of the SQL statement.
 

 

-- call 列各关键词意义
PARSE
 Translates the SQL statement into an execution plan, including checks for proper security authorization and checks for the existence of tables, columns, and other referenced objects.
 
EXECUTE
 Actual execution of the statement by Oracle. For INSERT, UPDATE, and DELETE statements, this modifies the data. For SELECT statements, this identifies the selected rows.
 
FETCH
 Retrieves rows returned by a query. Fetches are only performed for SELECT statements.


--生成的脚本文件描述
Storing SQL Trace Facility Statistics
You might want to keep a history of the statistics generated by the SQL Trace facility for an application, and compare them over time. TKPROF can generate a SQL script that creates a table and inserts rows of statistics into it. This script contains:

•A CREATE TABLE statement that creates an output table named TKPROF_TABLE.

•INSERT statements that add rows of statistics, one for each traced SQL statement, to the TKPROF_TABLE.

After running TKPROF, you can run this script to store the statistics in the database.

Generating the TKPROF Output SQL Script
When you run TKPROF, use the INSERT parameter to specify the name of the generated SQL script. If you omit this parameter, then TKPROF does not generate a script.

Editing the TKPROF Output SQL Script
After TKPROF has created the SQL script, you might want to edit the script before running it. If you have created an output table for previously collected statistics, and if you want to add new statistics to this table, then remove the CREATE TABLE statement from the script. The script then inserts the new rows into the existing table.

If you have created multiple output tables, perhaps to store statistics from different databases in different tables, then edit the CREATE TABLE and INSERT statements to change the name of the output table.


--在刚才的路径下打开生成的脚本文件ORCL_ora_17728_yjg.sql

REM  Edit and/or remove the following  CREATE TABLE
REM  statement as your needs dictate.
CREATE TABLE  tkprof_table
(
 date_of_insert                       DATE  
,cursor_num                           NUMBER
,depth                                NUMBER
,user_id                              NUMBER
,parse_cnt                            NUMBER
,parse_cpu                            NUMBER
,parse_elap                           NUMBER
,parse_disk                           NUMBER
,parse_query                          NUMBER
,parse_current                        NUMBER
,parse_miss                           NUMBER
,exe_count                            NUMBER
,exe_cpu                              NUMBER
,exe_elap                             NUMBER
,exe_disk                             NUMBER
,exe_query                            NUMBER
,exe_current                          NUMBER
,exe_miss                             NUMBER
,exe_rows                             NUMBER
,fetch_count                          NUMBER
,fetch_cpu                            NUMBER
,fetch_elap                           NUMBER
,fetch_disk                           NUMBER
,fetch_query                          NUMBER
,fetch_current                        NUMBER
,fetch_rows                           NUMBER
,ticks                                NUMBER
,sql_statement                        LONG
);
set sqlterminator off
INSERT INTO tkprof_table VALUES
(
  SYSDATE, 1, 0, 58, 2, 0, 57, 0, 0, 0, 0
, 2, 0, 397, 0, 0, 140733193388032, 0, 2
, 0, 0, 0, 0, 0, 0, 0, 34230
, 'begin :id := sys.dbms_transaction.local_transaction_id; end;
')
/
INSERT INTO tkprof_table VALUES
(
  SYSDATE, 2, 0, 58, 1, 12001, 9045, 0, 0, 0, 1
, 1, 0, 37, 140733193388032, 0, 140733193388032, 0, 0
, 1, 68004, 71271, 0, 2072, 0, 100, 82118
, 'SELECT *
  FROM (SELECT M.INITIALENTRY,
               M.VENDORNO_,
               M.COMPANY_ID,
               M.ENTRYTYPE,
               M.POSTINGDATE,
               M.POSTINGGROUP,
               M.AMOUNT,
               M.INVT_INIT
          FROM ODS_DETAILEDVENDORLEDG_ENTRY M
         WHERE NOT EXISTS
         (SELECT 1
                  FROM DM_COMPANY T, CONNECT_JYYB_DEL F
                 WHERE T.COMPANY_ID IS NOT NULL
                   AND T.DB_NAME = F.DATABASENAME
                   AND T.DB_TABLE_DESC = F.COMPANYCODE
                   AND T.DB_IP = F.DATABASEADRESS
                   AND T.COMPANY_ID = M.COMPANY_ID
                   AND F.CONNECTVENDORNO = M.VENDORNO_
                   AND f.departno=m.initialentry)) B
 WHERE COMPANY_ID = 1
   AND INITIALENTRYGLOBALDIM_1 = 212
   AND B.INVT_INIT = 0
   AND B.ENTRYTYPE <> 2
   AND B.POSTINGDATE <= TO_DATE('20130406', 'yyyy-mm-dd')
   AND B.POSTINGGROUP != ''EMP-YB''
')
/
INSERT INTO tkprof_table VALUES
(
  SYSDATE, 1, 0, 58, 1, 0, 30, 0, 0, 0, 0
, 1, 0, 79, 140733193388032, 0, 140733193388032, 0, 0
, 0, 0, 0, 0, 0, 0, 0, 26202
, 'ALTER SESSION SET EVENTS ''10046 trace name context OFF''
')
/
set sqlterminator on


--该脚本可以修改,可以运行(保存了本次的跟踪历史)

内容参考:http://space.itpub.net/611609/viewspace-683744

10053 事件

对于10053事件的trace文件,我们只能直接阅读原始的trace文件,不能使用tkprof工具来处理,tkprof工具只能用来处理sql_trace 和 10046事件产生的trace文件。

10053事件有两个级别:

Level 2:2级是1级的一个子集,它包含以下内容:
Column statistics
Single Access Paths
Join Costs
Table Joins Considered
Join Methods Considered (NL/MS/HA)

Level 1: 1级比2级更详细,它包含2级的所有内容,在加如下内容:
Parameters used by the optimizer
Index statistics

session 194 发出下列命令

--找出trace文件
SELECT D.VALUE || '\' || LOWER(RTRIM(I.INSTANCE, CHR(0))) || '_ora_' ||
       P.SPID || '.trc' AS "trace_file_name"
  FROM (SELECT P.SPID
          FROM V$MYSTAT M, V$SESSION S, V$PROCESS P
         WHERE M.STATISTIC# = 1
           AND S.SID = M.SID
           AND P.ADDR = S.PADDR) P,
       (SELECT T.INSTANCE
          FROM V$THREAD T, V$PARAMETER V
         WHERE V.NAME = 'thread'
           AND (V.VALUE = 0 OR T.THREAD# = TO_NUMBER(V.VALUE))) I,
       (SELECT VALUE FROM V$PARAMETER WHERE NAME = 'user_dump_dest') D;

E:\ORACLE\PRODUCT\10.2.0\ADMIN\ORCL\UDUMP\ORCL_ora_5988.trc


ALTER SESSION SET tracefile_identifier='YJG';
ALTER SESSION SET EVENTS '10053 trace name context forever';

select dname, ename from emp, dept
where emp.deptno = dept.deptno
and emp.ename =&B;

ALTER SESSION SET EVENTS '10053 trace name context off';

--打开ORCL_ora_5988.trc

*** TRACE DUMP CONTINUED FROM FILE e:\oracle\product\10.2.0\admin\ORCL\udump\ORCL_ora_5988_yjg.trc ***


Registered qb: SEL$1 0x7666ad0 (PARSER)
  signature (): qb_name=SEL$1 nbfros=2 flg=0
    fro(0): flg=4 objn=51249 hint_alias="DEPT"@"SEL$1"
    fro(1): flg=4 objn=66236 hint_alias="EMP"@"SEL$1"
**************************
Predicate Move-Around (PM)
**************************
PM: Considering predicate move-around in SEL$1 (#0).
PM:   Checking validity of predicate move-around in SEL$1 (#0).
CBQT: Validity checks failed for f435nnbak6z8a.
Query block (07666AD0) before join elimination:
SQL:******* UNPARSED QUERY IS *******
SELECT "DEPT"."DNAME" "DNAME","EMP"."ENAME" "ENAME" FROM "SCOTT"."EMP" "EMP","SCOTT"."DEPT" "DEPT" WHERE "EMP"."DEPTNO"="DEPT"."DEPTNO" AND "EMP"."ENAME"='YOUJINGE'
Query block (07666AD0) unchanged
CVM: Considering view merge in query block SEL$1 (#0)
Query block (07666AD0) before join elimination:
SQL:******* UNPARSED QUERY IS *******
SELECT "DEPT"."DNAME" "DNAME","EMP"."ENAME" "ENAME" FROM "SCOTT"."EMP" "EMP","SCOTT"."DEPT" "DEPT" WHERE "EMP"."DEPTNO"="DEPT"."DEPTNO" AND "EMP"."ENAME"='YOUJINGE'
Query block (07666AD0) unchanged
CBQT: Validity checks failed for f435nnbak6z8a.
***************
Subquery Unnest
***************
SU: Considering subquery unnesting in query block SEL$1 (#0)
*************************
Set-Join Conversion (SJC)
*************************
SJC: Considering set-join conversion in SEL$1 (#0).
**************************
Predicate Move-Around (PM)
**************************
PM: Considering predicate move-around in SEL$1 (#0).
PM:   Checking validity of predicate move-around in SEL$1 (#0).
PM:     PM bypassed: Outer query contains no views.
FPD: Considering simple filter push in SEL$1 (#0)
FPD:   Current where clause predicates in SEL$1 (#0) :
         "EMP"."DEPTNO"="DEPT"."DEPTNO" AND "EMP"."ENAME"='YOUJINGE'
kkogcp: try to generate transitive predicate from check constraints for SEL$1 (#0)
predicates with check contraints: "EMP"."DEPTNO"="DEPT"."DEPTNO" AND "EMP"."ENAME"='YOUJINGE'
after transitive predicate generation: "EMP"."DEPTNO"="DEPT"."DEPTNO" AND "EMP"."ENAME"='YOUJINGE'
finally: "EMP"."DEPTNO"="DEPT"."DEPTNO" AND "EMP"."ENAME"='YOUJINGE'
apadrv-start: call(in-use=584, alloc=0), compile(in-use=34104, alloc=0)
kkoqbc-start
            : call(in-use=588, alloc=0), compile(in-use=34888, alloc=0)
******************************************
Current SQL statement for this session:
select dname, ename from emp, dept
where emp.deptno = dept.deptno
and emp.ename ='YOUJINGE'
*******************************************
Legend
The following abbreviations are used by optimizer trace.
CBQT - cost-based query transformation
JPPD - join predicate push-down
FPD - filter push-down
PM - predicate move-around
CVM - complex view merging
SPJ - select-project-join
SJC - set join conversion
SU - subquery unnesting
OBYE - order by elimination
ST - star transformation
qb - query block
LB - leaf blocks
DK - distinct keys
LB/K - average number of leaf blocks per key
DB/K - average number of data blocks per key
CLUF - clustering factor
NDV - number of distinct values
Resp - response cost
Card - cardinality
Resc - resource cost
NL - nested loops (join)
SM - sort merge (join)
HA - hash (join)
CPUCSPEED - CPU Speed
IOTFRSPEED - I/O transfer speed
IOSEEKTIM - I/O seek time
SREADTIM - average single block read time
MREADTIM - average multiblock read time
MBRC - average multiblock read count
MAXTHR - maximum I/O system throughput
SLAVETHR - average slave I/O throughput
dmeth - distribution method
  1: no partitioning required
  2: value partitioned
  4: right is random (round-robin)
  512: left is random (round-robin)
  8: broadcast right and partition left
  16: broadcast left and partition right
  32: partition left using partitioning of right
  64: partition right using partitioning of left
  128: use hash partitioning dimension
  256: use range partitioning dimension
  2048: use list partitioning dimension
  1024: run the join in serial
  0: invalid distribution method
sel - selectivity
ptn - partition
*******************************************
Peeked values of the binds in SQL statement
*******************************************
***************************************
PARAMETERS USED BY THE OPTIMIZER
********************************
  *************************************
  PARAMETERS WITH ALTERED VALUES
  ******************************
  *********************************
  Bug Fix Control Environment
  ***************************
  fix  4611850 = enabled
  fix  4663804 = enabled
  fix  4663698 = enabled
  fix  4545833 = enabled
  fix  3499674 = disabled
  fix  4584065 = enabled
  fix  4602374 = enabled
  fix  4569940 = enabled
  fix  4631959 = enabled
  fix  4519340 = enabled
  fix  4550003 = enabled
  fix  4488689 = enabled
  fix  3118776 = enabled
  fix  4519016 = enabled
  fix  4487253 = enabled
  fix  4556762 = 15     
  fix  4728348 = enabled
  fix  4723244 = enabled
  fix  4554846 = enabled
  fix  4175830 = enabled
  fix  4722900 = enabled
  fix  5094217 = enabled
  fix  4904890 = enabled
  fix  4483286 = disabled
  fix  4969880 = disabled
  fix  4711525 = enabled
  fix  4717546 = enabled
  fix  4904838 = enabled
  fix  5005866 = enabled
  fix  4600710 = enabled
  fix  5129233 = enabled
  fix  5195882 = enabled
  fix  5084239 = enabled
  fix  4595987 = enabled
  fix  4134994 = enabled
  fix  5104624 = enabled
  fix  4908162 = enabled
  fix  5015557 = enabled
  fix  5240607 = enabled
  *************************************
  PARAMETERS WITH DEFAULT VALUES
  ******************************
  optimizer_mode_hinted               = false
  optimizer_features_hinted           = 0.0.0
  parallel_execution_enabled          = true
  parallel_query_forced_dop           = 0
  parallel_dml_forced_dop             = 0
  parallel_ddl_forced_degree          = 0
  parallel_ddl_forced_instances       = 0
  _query_rewrite_fudge                = 90
  optimizer_features_enable           = 10.2.0.3
  _optimizer_search_limit             = 5
  cpu_count                           = 2
  active_instance_count               = 1
  parallel_threads_per_cpu            = 2
  hash_area_size                      = 131072
  bitmap_merge_area_size              = 1048576
  sort_area_size                      = 65536
  sort_area_retained_size             = 0
  _sort_elimination_cost_ratio        = 0
  _optimizer_block_size               = 8192
  _sort_multiblock_read_count         = 2
  _hash_multiblock_io_count           = 0
  _db_file_optimizer_read_count       = 16
  _optimizer_max_permutations         = 2000
  pga_aggregate_target                = 198656 KB
  _pga_max_size                       = 204800 KB
  _query_rewrite_maxdisjunct          = 257
  _smm_auto_min_io_size               = 56 KB
  _smm_auto_max_io_size               = 248 KB
  _smm_min_size                       = 198 KB
  _smm_max_size                       = 39731 KB
  _smm_px_max_size                    = 99328 KB
  _cpu_to_io                          = 0
  _optimizer_undo_cost_change         = 10.2.0.3
  parallel_query_mode                 = enabled
  parallel_dml_mode                   = disabled
  parallel_ddl_mode                   = enabled
  optimizer_mode                      = all_rows
  sqlstat_enabled                     = false
  _optimizer_percent_parallel         = 101
  _always_anti_join                   = choose
  _always_semi_join                   = choose
  _optimizer_mode_force               = true
  _partition_view_enabled             = true
  _always_star_transformation         = false
  _query_rewrite_or_error             = false
  _hash_join_enabled                  = true
  cursor_sharing                      = exact
  _b_tree_bitmap_plans                = true
  star_transformation_enabled         = false
  _optimizer_cost_model               = choose
  _new_sort_cost_estimate             = true
  _complex_view_merging               = true
  _unnest_subquery                    = true
  _eliminate_common_subexpr           = true
  _pred_move_around                   = true
  _convert_set_to_join                = false
  _push_join_predicate                = true
  _push_join_union_view               = true
  _fast_full_scan_enabled             = true
  _optim_enhance_nnull_detection      = true
  _parallel_broadcast_enabled         = true
  _px_broadcast_fudge_factor          = 100
  _ordered_nested_loop                = true
  _no_or_expansion                    = false
  optimizer_index_cost_adj            = 100
  optimizer_index_caching             = 0
  _system_index_caching               = 0
  _disable_datalayer_sampling         = false
  query_rewrite_enabled               = true
  query_rewrite_integrity             = enforced
  _query_cost_rewrite                 = true
  _query_rewrite_2                    = true
  _query_rewrite_1                    = true
  _query_rewrite_expression           = true
  _query_rewrite_jgmigrate            = true
  _query_rewrite_fpc                  = true
  _query_rewrite_drj                  = true
  _full_pwise_join_enabled            = true
  _partial_pwise_join_enabled         = true
  _left_nested_loops_random           = true
  _improved_row_length_enabled        = true
  _index_join_enabled                 = true
  _enable_type_dep_selectivity        = true
  _improved_outerjoin_card            = true
  _optimizer_adjust_for_nulls         = true
  _optimizer_degree                   = 0
  _use_column_stats_for_function      = true
  _subquery_pruning_enabled           = true
  _subquery_pruning_mv_enabled        = false
  _or_expand_nvl_predicate            = true
  _like_with_bind_as_equality         = false
  _table_scan_cost_plus_one           = true
  _cost_equality_semi_join            = true
  _default_non_equality_sel_check     = true
  _new_initial_join_orders            = true
  _oneside_colstat_for_equijoins      = true
  _optim_peek_user_binds              = true
  _minimal_stats_aggregation          = true
  _force_temptables_for_gsets         = false
  workarea_size_policy                = auto
  _smm_auto_cost_enabled              = true
  _gs_anti_semi_join_allowed          = true
  _optim_new_default_join_sel         = true
  optimizer_dynamic_sampling          = 2
  _pre_rewrite_push_pred              = true
  _optimizer_new_join_card_computation = true
  _union_rewrite_for_gs               = yes_gset_mvs
  _generalized_pruning_enabled        = true
  _optim_adjust_for_part_skews        = true
  _force_datefold_trunc               = false
  statistics_level                    = typical
  _optimizer_system_stats_usage       = true
  skip_unusable_indexes               = true
  _remove_aggr_subquery               = true
  _optimizer_push_down_distinct       = 0
  _dml_monitoring_enabled             = true
  _optimizer_undo_changes             = false
  _predicate_elimination_enabled      = true
  _nested_loop_fudge                  = 100
  _project_view_columns               = true
  _local_communication_costing_enabled = true
  _local_communication_ratio          = 50
  _query_rewrite_vop_cleanup          = true
  _slave_mapping_enabled              = true
  _optimizer_cost_based_transformation = linear
  _optimizer_mjc_enabled              = true
  _right_outer_hash_enable            = true
  _spr_push_pred_refspr               = true
  _optimizer_cache_stats              = false
  _optimizer_cbqt_factor              = 50
  _optimizer_squ_bottomup             = true
  _fic_area_size                      = 131072
  _optimizer_skip_scan_enabled        = true
  _optimizer_cost_filter_pred         = false
  _optimizer_sortmerge_join_enabled   = true
  _optimizer_join_sel_sanity_check    = true
  _mmv_query_rewrite_enabled          = true
  _bt_mmv_query_rewrite_enabled       = true
  _add_stale_mv_to_dependency_list    = true
  _distinct_view_unnesting            = false
  _optimizer_dim_subq_join_sel        = true
  _optimizer_disable_strans_sanity_checks = 0
  _optimizer_compute_index_stats      = true
  _push_join_union_view2              = true
  _optimizer_ignore_hints             = false
  _optimizer_random_plan              = 0
  _query_rewrite_setopgrw_enable      = true
  _optimizer_correct_sq_selectivity   = true
  _disable_function_based_index       = false
  _optimizer_join_order_control       = 3
  _optimizer_cartesian_enabled        = true
  _optimizer_starplan_enabled         = true
  _extended_pruning_enabled           = true
  _optimizer_push_pred_cost_based     = true
  _sql_model_unfold_forloops          = run_time
  _enable_dml_lock_escalation         = false
  _bloom_filter_enabled               = true
  _update_bji_ipdml_enabled           = 0
  _optimizer_extended_cursor_sharing  = udo
  _dm_max_shared_pool_pct             = 1
  _optimizer_cost_hjsmj_multimatch    = true
  _optimizer_transitivity_retain      = true
  _px_pwg_enabled                     = true
  optimizer_secure_view_merging       = true
  _optimizer_join_elimination_enabled = true
  flashback_table_rpi                 = non_fbt
  _optimizer_cbqt_no_size_restriction = true
  _optimizer_enhanced_filter_push     = true
  _optimizer_filter_pred_pullup       = true
  _rowsrc_trace_level                 = 0
  _simple_view_merging                = true
  _optimizer_rownum_pred_based_fkr    = true
  _optimizer_better_inlist_costing    = all
  _optimizer_self_induced_cache_cost  = false
  _optimizer_min_cache_blocks         = 10
  _optimizer_or_expansion             = depth
  _optimizer_order_by_elimination_enabled = true
  _optimizer_outer_to_anti_enabled    = true
  _selfjoin_mv_duplicates             = true
  _dimension_skip_null                = true
  _force_rewrite_enable               = false
  _optimizer_star_tran_in_with_clause = true
  _optimizer_complex_pred_selectivity = true
  _optimizer_connect_by_cost_based    = true
  _gby_hash_aggregation_enabled       = true
  _globalindex_pnum_filter_enabled    = true
  _fix_control_key                    = 0
  _optimizer_skip_scan_guess          = false
  _enable_row_shipping                = false
  _row_shipping_threshold             = 80
  _row_shipping_explain               = false
  _optimizer_rownum_bind_default      = 10
  _first_k_rows_dynamic_proration     = true
  _optimizer_native_full_outer_join   = off
  *********************************
  Bug Fix Control Environment
  ***************************
  fix  4611850 = enabled
  fix  4663804 = enabled
  fix  4663698 = enabled
  fix  4545833 = enabled
  fix  3499674 = disabled
  fix  4584065 = enabled
  fix  4602374 = enabled
  fix  4569940 = enabled
  fix  4631959 = enabled
  fix  4519340 = enabled
  fix  4550003 = enabled
  fix  4488689 = enabled
  fix  3118776 = enabled
  fix  4519016 = enabled
  fix  4487253 = enabled
  fix  4556762 = 15     
  fix  4728348 = enabled
  fix  4723244 = enabled
  fix  4554846 = enabled
  fix  4175830 = enabled
  fix  4722900 = enabled
  fix  5094217 = enabled
  fix  4904890 = enabled
  fix  4483286 = disabled
  fix  4969880 = disabled
  fix  4711525 = enabled
  fix  4717546 = enabled
  fix  4904838 = enabled
  fix  5005866 = enabled
  fix  4600710 = enabled
  fix  5129233 = enabled
  fix  5195882 = enabled
  fix  5084239 = enabled
  fix  4595987 = enabled
  fix  4134994 = enabled
  fix  5104624 = enabled
  fix  4908162 = enabled
  fix  5015557 = enabled
  fix  5240607 = enabled
  ***************************************
  PARAMETERS IN OPT_PARAM HINT
  ****************************
***************************************
Column Usage Monitoring is ON: tracking level = 1
***************************************
****************
QUERY BLOCK TEXT
****************
select dname, ename from emp, dept
where emp.deptno = dept.deptno
and emp.ename ='YOUJINGE'
*********************
QUERY BLOCK SIGNATURE
*********************
qb name was generated
signature (optimizer): qb_name=SEL$1 nbfros=2 flg=0
  fro(0): flg=0 objn=51249 hint_alias="DEPT"@"SEL$1"
  fro(1): flg=0 objn=66236 hint_alias="EMP"@"SEL$1"
*****************************
SYSTEM STATISTICS INFORMATION
*****************************
  Using NOWORKLOAD Stats
  CPUSPEED: 470 millions instruction/sec
  IOTFRSPEED: 4096 bytes per millisecond (default is 4096)
  IOSEEKTIM: 10 milliseconds (default is 10)
***************************************
BASE STATISTICAL INFORMATION
***********************
Table Stats::
  Table: DEPT  Alias: DEPT
    #Rows: 5  #Blks:  5  AvgRowLen:  15.00
  Column (#1): DEPTNO(NUMBER)
    AvgLen: 3.00 NDV: 5 Nulls: 0 Density: 0.2 Min: 10 Max: 50
Index Stats::
  Index: PK_DEPT  Col#: 1
    LVLS: 0  #LB: 1  #DK: 5  LB/K: 1.00  DB/K: 1.00  CLUF: 2.00
***********************
Table Stats::
  Table: EMP  Alias: EMP
    #Rows: 14  #Blks:  4  AvgRowLen:  42.00
  Column (#8): DEPTNO(NUMBER)
    AvgLen: 3.00 NDV: 3 Nulls: 2 Density: 0.33333 Min: 10 Max: 30
***************************************
SINGLE TABLE ACCESS PATH
  Column (#2): ENAME(VARCHAR2)
    AvgLen: 6.00 NDV: 12 Nulls: 2 Density: 0.083333
  Table: EMP  Alias: EMP    
    Card: Original: 14  Rounded: 1  Computed: 0.86  Non Adjusted: 0.86
  Access Path: TableScan
    Cost:  3.01  Resp: 3.01  Degree: 0
      Cost_io: 3.00  Cost_cpu: 33269
      Resp_io: 3.00  Resp_cpu: 33269
  Best:: AccessPath: TableScan
         Cost: 3.01  Degree: 1  Resp: 3.01  Card: 0.86  Bytes: 0
***************************************
SINGLE TABLE ACCESS PATH
  Table: DEPT  Alias: DEPT    
    Card: Original: 5  Rounded: 5  Computed: 5.00  Non Adjusted: 5.00
  Access Path: TableScan
    Cost:  3.01  Resp: 3.01  Degree: 0
      Cost_io: 3.00  Cost_cpu: 36457
      Resp_io: 3.00  Resp_cpu: 36457
  Best:: AccessPath: TableScan
         Cost: 3.01  Degree: 1  Resp: 3.01  Card: 5.00  Bytes: 0
***************************************
OPTIMIZER STATISTICS AND COMPUTATIONS
***************************************
GENERAL PLANS
***************************************
Considering cardinality-based initial join order.
Permutations for Starting Table :0
***********************
Join order[1]:  EMP[EMP]#0  DEPT[DEPT]#1
***************
Now joining: DEPT[DEPT]#1
***************
NL Join
  Outer table: Card: 0.86  Cost: 3.01  Resp: 3.01  Degree: 1  Bytes: 9
  Inner table: DEPT  Alias: DEPT
  Access Path: TableScan
    NL Join:  Cost: 6.01  Resp: 6.01  Degree: 0
      Cost_io: 6.00  Cost_cpu: 69726
      Resp_io: 6.00  Resp_cpu: 69726
  Access Path: index (UniqueScan)
    Index: PK_DEPT
    resc_io: 1.00  resc_cpu: 8341
    ix_sel: 0.2  ix_sel_with_filters: 0.2
    NL Join: Cost: 4.01  Resp: 4.01  Degree: 1
      Cost_io: 4.00  Cost_cpu: 41611
      Resp_io: 4.00  Resp_cpu: 41611
  Access Path: index (AllEqUnique)
    Index: PK_DEPT
    resc_io: 1.00  resc_cpu: 8341
    ix_sel: 0.2  ix_sel_with_filters: 0.2
    NL Join: Cost: 4.01  Resp: 4.01  Degree: 1
      Cost_io: 4.00  Cost_cpu: 41611
      Resp_io: 4.00  Resp_cpu: 41611
  Best NL cost: 4.01
          resc: 4.01 resc_io: 4.00 resc_cpu: 41611
          resp: 4.01 resp_io: 4.00 resp_cpu: 41611
Join Card:  0.86 = outer (0.86) * inner (5.00) * sel (0.2)
Join Card - Rounded: 1 Computed: 0.86
SM Join
  Outer table:
    resc: 3.01  card 0.86  bytes: 9  deg: 1  resp: 3.01
  Inner table: DEPT  Alias: DEPT
    resc: 3.01  card: 5.00  bytes: 11  deg: 1  resp: 3.01
    using dmeth: 2  #groups: 1
    SORT resource      Sort statistics
      Sort width:         231 Area size:      202752 Max Area size:    40684544
      Degree:               1
      Blocks to Sort:       1 Row size:           20 Total Rows:              1
      Initial runs:         1 Merge passes:        0 IO Cost / pass:          0
      Total IO sort cost: 0      Total CPU sort cost: 5645344
      Total Temp space used: 0
    SORT resource      Sort statistics
      Sort width:         231 Area size:      202752 Max Area size:    40684544
      Degree:               1
      Blocks to Sort:       1 Row size:           23 Total Rows:              5
      Initial runs:         1 Merge passes:        0 IO Cost / pass:          0
      Total IO sort cost: 0      Total CPU sort cost: 5645867
      Total Temp space used: 0
  SM join: Resc: 8.01  Resp: 8.01  [multiMatchCost=0.00]
  SM cost: 8.01
     resc: 8.01 resc_io: 6.00 resc_cpu: 11360938
     resp: 8.01 resp_io: 6.00 resp_cpu: 11360938
HA Join
  Outer table:
    resc: 3.01  card 0.86  bytes: 9  deg: 1  resp: 3.01
  Inner table: DEPT  Alias: DEPT
    resc: 3.01  card: 5.00  bytes: 11  deg: 1  resp: 3.01
    using dmeth: 2  #groups: 1
    Cost per ptn: 0.50  #ptns: 1
    hash_area: 0 (max=0)   Hash join: Resc: 6.51  Resp: 6.51  [multiMatchCost=0.00]
  HA cost: 6.51
     resc: 6.51 resc_io: 6.00 resc_cpu: 2893048
     resp: 6.51 resp_io: 6.00 resp_cpu: 2893048
Best:: JoinMethod: NestedLoop
       Cost: 4.01  Degree: 1  Resp: 4.01  Card: 0.86  Bytes: 20
***********************
Best so far: Table#: 0  cost: 3.0059  card: 0.8571  bytes: 9
             Table#: 1  cost: 4.0074  card: 0.8571  bytes: 20
***********************
Join order[2]:  DEPT[DEPT]#1  EMP[EMP]#0
***************
Now joining: EMP[EMP]#0
***************
NL Join
  Outer table: Card: 5.00  Cost: 3.01  Resp: 3.01  Degree: 1  Bytes: 11
  Inner table: EMP  Alias: EMP
  Access Path: TableScan
    NL Join:  Cost: 9.04  Resp: 9.04  Degree: 0
      Cost_io: 9.00  Cost_cpu: 202803
      Resp_io: 9.00  Resp_cpu: 202803
  Best NL cost: 9.04
          resc: 9.04 resc_io: 9.00 resc_cpu: 202803
          resp: 9.04 resp_io: 9.00 resp_cpu: 202803
Join Card:  0.86 = outer (5.00) * inner (0.86) * sel (0.2)
Join Card - Rounded: 1 Computed: 0.86
SM Join
  Outer table:
    resc: 3.01  card 5.00  bytes: 11  deg: 1  resp: 3.01
  Inner table: EMP  Alias: EMP
    resc: 3.01  card: 0.86  bytes: 9  deg: 1  resp: 3.01
    using dmeth: 2  #groups: 1
    SORT resource      Sort statistics
      Sort width:         231 Area size:      202752 Max Area size:    40684544
      Degree:               1
      Blocks to Sort:       1 Row size:           23 Total Rows:              5
      Initial runs:         1 Merge passes:        0 IO Cost / pass:          0
      Total IO sort cost: 0      Total CPU sort cost: 5645867
      Total Temp space used: 0
    SORT resource      Sort statistics
      Sort width:         231 Area size:      202752 Max Area size:    40684544
      Degree:               1
      Blocks to Sort:       1 Row size:           20 Total Rows:              1
      Initial runs:         1 Merge passes:        0 IO Cost / pass:          0
      Total IO sort cost: 0      Total CPU sort cost: 5645344
      Total Temp space used: 0
  SM join: Resc: 8.01  Resp: 8.01  [multiMatchCost=0.00]
  SM cost: 8.01
     resc: 8.01 resc_io: 6.00 resc_cpu: 11360938
     resp: 8.01 resp_io: 6.00 resp_cpu: 11360938
SM Join (with index on outer)
  Access Path: index (FullScan)
    Index: PK_DEPT
    resc_io: 3.00  resc_cpu: 23214
    ix_sel: 1  ix_sel_with_filters: 1
    Cost: 3.00  Resp: 3.00  Degree: 1
  Outer table:
    resc: 3.00  card 5.00  bytes: 11  deg: 1  resp: 3.00
  Inner table: EMP  Alias: EMP
    resc: 3.01  card: 0.86  bytes: 9  deg: 1  resp: 3.01
    using dmeth: 2  #groups: 1
    SORT resource      Sort statistics
      Sort width:         231 Area size:      202752 Max Area size:    40684544
      Degree:               1
      Blocks to Sort:       1 Row size:           20 Total Rows:              1
      Initial runs:         1 Merge passes:        0 IO Cost / pass:          0
      Total IO sort cost: 0      Total CPU sort cost: 5645344
      Total Temp space used: 0
  SM join: Resc: 7.01  Resp: 7.01  [multiMatchCost=0.00]
HA Join
  Outer table:
    resc: 3.01  card 5.00  bytes: 11  deg: 1  resp: 3.01
  Inner table: EMP  Alias: EMP
    resc: 3.01  card: 0.86  bytes: 9  deg: 1  resp: 3.01
    using dmeth: 2  #groups: 1
    Cost per ptn: 0.50  #ptns: 1
    hash_area: 0 (max=0)   Hash join: Resc: 6.51  Resp: 6.51  [multiMatchCost=0.00]
  HA cost: 6.51
     resc: 6.51 resc_io: 6.00 resc_cpu: 2893248
     resp: 6.51 resp_io: 6.00 resp_cpu: 2893248
Join order aborted: cost > best plan cost
***********************
(newjo-stop-1) k:0, spcnt:0, perm:2, maxperm:2000
*********************************
Number of join permutations tried: 2
*********************************
(newjo-save)    [1 0 ]
Final - All Rows Plan:  Best join order: 1
  Cost: 4.0074  Degree: 1  Card: 1.0000  Bytes: 20
  Resc: 4.0074  Resc_io: 4.0000  Resc_cpu: 41611
  Resp: 4.0074  Resp_io: 4.0000  Resc_cpu: 41611
kkoipt: Query block SEL$1 (#0)
******* UNPARSED QUERY IS *******
SELECT "DEPT"."DNAME" "DNAME","EMP"."ENAME" "ENAME" FROM "SCOTT"."EMP" "EMP","SCOTT"."DEPT" "DEPT" WHERE "EMP"."ENAME"='YOUJINGE' AND "EMP"."DEPTNO" IS NOT NULL AND "EMP"."DEPTNO"="DEPT"."DEPTNO"
kkoqbc-end
          : call(in-use=33276, alloc=0), compile(in-use=36884, alloc=0)
apadrv-end: call(in-use=33276, alloc=0), compile(in-use=37472, alloc=0)
 
sql_id=f435nnbak6z8a.
Current SQL statement for this session:
select dname, ename from emp, dept
where emp.deptno = dept.deptno
and emp.ename ='YOUJINGE'
 
============
Plan Table
============
------------------------------------------------+-----------------------------------+
| Id  | Operation                     | Name    | Rows  | Bytes | Cost  | Time      |
------------------------------------------------+-----------------------------------+
| 0   | SELECT STATEMENT              |         |       |       |     4 |           |
| 1   |  NESTED LOOPS                 |         |     1 |    20 |     4 |  00:00:01 |
| 2   |   TABLE ACCESS FULL           | EMP     |     1 |     9 |     3 |  00:00:01 |
| 3   |   TABLE ACCESS BY INDEX ROWID | DEPT    |     1 |    11 |     1 |  00:00:01 |
| 4   |    INDEX UNIQUE SCAN          | PK_DEPT |     1 |       |     0 |           |
------------------------------------------------+-----------------------------------+
Predicate Information:
----------------------
2 - filter(("EMP"."ENAME"='YOUJINGE' AND "EMP"."DEPTNO" IS NOT NULL))
4 - access("EMP"."DEPTNO"="DEPT"."DEPTNO")
 
Content of other_xml column
===========================
  db_version     : 10.2.0.3
  parse_schema   : SCOTT
  plan_hash      : 351108634
  Outline Data:
  /*+
    BEGIN_OUTLINE_DATA
      IGNORE_OPTIM_EMBEDDED_HINTS
      OPTIMIZER_FEATURES_ENABLE('10.2.0.3')
      ALL_ROWS
      OUTLINE_LEAF(@"SEL$1")
      FULL(@"SEL$1" "EMP"@"SEL$1")
      INDEX_RS_ASC(@"SEL$1" "DEPT"@"SEL$1" ("DEPT"."DEPTNO"))
      LEADING(@"SEL$1" "EMP"@"SEL$1" "DEPT"@"SEL$1")
      USE_NL(@"SEL$1" "DEPT"@"SEL$1")
    END_OUTLINE_DATA
  */
 
Optimizer environment:
  optimizer_mode_hinted               = false
  optimizer_features_hinted           = 0.0.0
  parallel_execution_enabled          = true
  parallel_query_forced_dop           = 0
  parallel_dml_forced_dop             = 0
  parallel_ddl_forced_degree          = 0
  parallel_ddl_forced_instances       = 0
  _query_rewrite_fudge                = 90
  optimizer_features_enable           = 10.2.0.3
  _optimizer_search_limit             = 5
  cpu_count                           = 2
  active_instance_count               = 1
  parallel_threads_per_cpu            = 2
  hash_area_size                      = 131072
  bitmap_merge_area_size              = 1048576
  sort_area_size                      = 65536
  sort_area_retained_size             = 0
  _sort_elimination_cost_ratio        = 0
  _optimizer_block_size               = 8192
  _sort_multiblock_read_count         = 2
  _hash_multiblock_io_count           = 0
  _db_file_optimizer_read_count       = 16
  _optimizer_max_permutations         = 2000
  pga_aggregate_target                = 198656 KB
  _pga_max_size                       = 204800 KB
  _query_rewrite_maxdisjunct          = 257
  _smm_auto_min_io_size               = 56 KB
  _smm_auto_max_io_size               = 248 KB
  _smm_min_size                       = 198 KB
  _smm_max_size                       = 39731 KB
  _smm_px_max_size                    = 99328 KB
  _cpu_to_io                          = 0
  _optimizer_undo_cost_change         = 10.2.0.3
  parallel_query_mode                 = enabled
  parallel_dml_mode                   = disabled
  parallel_ddl_mode                   = enabled
  optimizer_mode                      = all_rows
  sqlstat_enabled                     = false
  _optimizer_percent_parallel         = 101
  _always_anti_join                   = choose
  _always_semi_join                   = choose
  _optimizer_mode_force               = true
  _partition_view_enabled             = true
  _always_star_transformation         = false
  _query_rewrite_or_error             = false
  _hash_join_enabled                  = true
  cursor_sharing                      = exact
  _b_tree_bitmap_plans                = true
  star_transformation_enabled         = false
  _optimizer_cost_model               = choose
  _new_sort_cost_estimate             = true
  _complex_view_merging               = true
  _unnest_subquery                    = true
  _eliminate_common_subexpr           = true
  _pred_move_around                   = true
  _convert_set_to_join                = false
  _push_join_predicate                = true
  _push_join_union_view               = true
  _fast_full_scan_enabled             = true
  _optim_enhance_nnull_detection      = true
  _parallel_broadcast_enabled         = true
  _px_broadcast_fudge_factor          = 100
  _ordered_nested_loop                = true
  _no_or_expansion                    = false
  optimizer_index_cost_adj            = 100
  optimizer_index_caching             = 0
  _system_index_caching               = 0
  _disable_datalayer_sampling         = false
  query_rewrite_enabled               = true
  query_rewrite_integrity             = enforced
  _query_cost_rewrite                 = true
  _query_rewrite_2                    = true
  _query_rewrite_1                    = true
  _query_rewrite_expression           = true
  _query_rewrite_jgmigrate            = true
  _query_rewrite_fpc                  = true
  _query_rewrite_drj                  = true
  _full_pwise_join_enabled            = true
  _partial_pwise_join_enabled         = true
  _left_nested_loops_random           = true
  _improved_row_length_enabled        = true
  _index_join_enabled                 = true
  _enable_type_dep_selectivity        = true
  _improved_outerjoin_card            = true
  _optimizer_adjust_for_nulls         = true
  _optimizer_degree                   = 0
  _use_column_stats_for_function      = true
  _subquery_pruning_enabled           = true
  _subquery_pruning_mv_enabled        = false
  _or_expand_nvl_predicate            = true
  _like_with_bind_as_equality         = false
  _table_scan_cost_plus_one           = true
  _cost_equality_semi_join            = true
  _default_non_equality_sel_check     = true
  _new_initial_join_orders            = true
  _oneside_colstat_for_equijoins      = true
  _optim_peek_user_binds              = true
  _minimal_stats_aggregation          = true
  _force_temptables_for_gsets         = false
  workarea_size_policy                = auto
  _smm_auto_cost_enabled              = true
  _gs_anti_semi_join_allowed          = true
  _optim_new_default_join_sel         = true
  optimizer_dynamic_sampling          = 2
  _pre_rewrite_push_pred              = true
  _optimizer_new_join_card_computation = true
  _union_rewrite_for_gs               = yes_gset_mvs
  _generalized_pruning_enabled        = true
  _optim_adjust_for_part_skews        = true
  _force_datefold_trunc               = false
  statistics_level                    = typical
  _optimizer_system_stats_usage       = true
  skip_unusable_indexes               = true
  _remove_aggr_subquery               = true
  _optimizer_push_down_distinct       = 0
  _dml_monitoring_enabled             = true
  _optimizer_undo_changes             = false
  _predicate_elimination_enabled      = true
  _nested_loop_fudge                  = 100
  _project_view_columns               = true
  _local_communication_costing_enabled = true
  _local_communication_ratio          = 50
  _query_rewrite_vop_cleanup          = true
  _slave_mapping_enabled              = true
  _optimizer_cost_based_transformation = linear
  _optimizer_mjc_enabled              = true
  _right_outer_hash_enable            = true
  _spr_push_pred_refspr               = true
  _optimizer_cache_stats              = false
  _optimizer_cbqt_factor              = 50
  _optimizer_squ_bottomup             = true
  _fic_area_size                      = 131072
  _optimizer_skip_scan_enabled        = true
  _optimizer_cost_filter_pred         = false
  _optimizer_sortmerge_join_enabled   = true
  _optimizer_join_sel_sanity_check    = true
  _mmv_query_rewrite_enabled          = true
  _bt_mmv_query_rewrite_enabled       = true
  _add_stale_mv_to_dependency_list    = true
  _distinct_view_unnesting            = false
  _optimizer_dim_subq_join_sel        = true
  _optimizer_disable_strans_sanity_checks = 0
  _optimizer_compute_index_stats      = true
  _push_join_union_view2              = true
  _optimizer_ignore_hints             = false
  _optimizer_random_plan              = 0
  _query_rewrite_setopgrw_enable      = true
  _optimizer_correct_sq_selectivity   = true
  _disable_function_based_index       = false
  _optimizer_join_order_control       = 3
  _optimizer_cartesian_enabled        = true
  _optimizer_starplan_enabled         = true
  _extended_pruning_enabled           = true
  _optimizer_push_pred_cost_based     = true
  _sql_model_unfold_forloops          = run_time
  _enable_dml_lock_escalation         = false
  _bloom_filter_enabled               = true
  _update_bji_ipdml_enabled           = 0
  _optimizer_extended_cursor_sharing  = udo
  _dm_max_shared_pool_pct             = 1
  _optimizer_cost_hjsmj_multimatch    = true
  _optimizer_transitivity_retain      = true
  _px_pwg_enabled                     = true
  optimizer_secure_view_merging       = true
  _optimizer_join_elimination_enabled = true
  flashback_table_rpi                 = non_fbt
  _optimizer_cbqt_no_size_restriction = true
  _optimizer_enhanced_filter_push     = true
  _optimizer_filter_pred_pullup       = true
  _rowsrc_trace_level                 = 0
  _simple_view_merging                = true
  _optimizer_rownum_pred_based_fkr    = true
  _optimizer_better_inlist_costing    = all
  _optimizer_self_induced_cache_cost  = false
  _optimizer_min_cache_blocks         = 10
  _optimizer_or_expansion             = depth
  _optimizer_order_by_elimination_enabled = true
  _optimizer_outer_to_anti_enabled    = true
  _selfjoin_mv_duplicates             = true
  _dimension_skip_null                = true
  _force_rewrite_enable               = false
  _optimizer_star_tran_in_with_clause = true
  _optimizer_complex_pred_selectivity = true
  _optimizer_connect_by_cost_based    = true
  _gby_hash_aggregation_enabled       = true
  _globalindex_pnum_filter_enabled    = true
  _fix_control_key                    = 0
  _optimizer_skip_scan_guess          = false
  _enable_row_shipping                = false
  _row_shipping_threshold             = 80
  _row_shipping_explain               = false
  _optimizer_rownum_bind_default      = 10
  _first_k_rows_dynamic_proration     = true
  _optimizer_native_full_outer_join   = off
  *********************************
  Bug Fix Control Environment
  ***************************
  fix  4611850 = enabled
  fix  4663804 = enabled
  fix  4663698 = enabled
  fix  4545833 = enabled
  fix  3499674 = disabled
  fix  4584065 = enabled
  fix  4602374 = enabled
  fix  4569940 = enabled
  fix  4631959 = enabled
  fix  4519340 = enabled
  fix  4550003 = enabled
  fix  4488689 = enabled
  fix  3118776 = enabled
  fix  4519016 = enabled
  fix  4487253 = enabled
  fix  4556762 = 15     
  fix  4728348 = enabled
  fix  4723244 = enabled
  fix  4554846 = enabled
  fix  4175830 = enabled
  fix  4722900 = enabled
  fix  5094217 = enabled
  fix  4904890 = enabled
  fix  4483286 = disabled
  fix  4969880 = disabled
  fix  4711525 = enabled
  fix  4717546 = enabled
  fix  4904838 = enabled
  fix  5005866 = enabled
  fix  4600710 = enabled
  fix  5129233 = enabled
  fix  5195882 = enabled
  fix  5084239 = enabled
  fix  4595987 = enabled
  fix  4134994 = enabled
  fix  5104624 = enabled
  fix  4908162 = enabled
  fix  5015557 = enabled
  fix  5240607 = enabled
Query Block Registry:
*********************
SEL$1 0x7666ad0 (PARSER) [FINAL]
Optimizer State Dump: call(in-use=38812, alloc=0), compile(in-use=56848, alloc=0)

你可能感兴趣的:(oracle,事件,tkprof,10046,10053)