楼主: mypengchen2000

[精华] 存储过程的效率问题!!(今晚在线等)

[复制链接]
论坛徽章:
63
版主7段
日期:2012-05-15 15:24:11itpub13周年纪念徽章
日期:2014-10-08 15:16:50itpub13周年纪念徽章
日期:2014-10-08 15:16:50itpub13周年纪念徽章
日期:2014-10-08 15:16:50itpub13周年纪念徽章
日期:2014-10-10 14:34:59马上加薪
日期:2015-01-08 15:39:192015年新春福章
日期:2015-03-04 14:19:112015年新春福章
日期:2015-03-06 11:57:31
51#
发表于 2003-7-2 14:38 | 只看该作者
改成8.1.7就可以了.

使用道具 举报

回复
论坛徽章:
0
52#
发表于 2003-7-2 14:45 | 只看该作者
手工改成817么?那不是要重新启动数据库么?恐怕这样的改动不太可行吧?

使用道具 举报

回复
论坛徽章:
0
53#
 楼主| 发表于 2003-7-2 16:02 | 只看该作者
我用了session的trace,但trace文件内容太多了,我看了下也不知有什么问题,我怎么能以文件形式贴trace上来呢??急啊,大家再帮帮忙;

使用道具 举报

回复
论坛徽章:
0
54#
 楼主| 发表于 2003-7-2 16:12 | 只看该作者
附件是我运行存储过程时对session做的trace,请大家帮帮看看,到底可能那里出问题了!!急啊,谢谢先!!!

ora_442096.rar

8.21 KB, 下载次数: 34

使用道具 举报

回复
论坛徽章:
0
55#
 楼主| 发表于 2003-7-2 16:14 | 只看该作者
请大家帮我看看,自己顶一下!!

使用道具 举报

回复
论坛徽章:
5
授权会员
日期:2005-10-30 17:05:33
56#
发表于 2003-7-2 16:18 | 只看该作者
用tkprof处理一下再看.

使用道具 举报

回复
论坛徽章:
63
版主7段
日期:2012-05-15 15:24:11itpub13周年纪念徽章
日期:2014-10-08 15:16:50itpub13周年纪念徽章
日期:2014-10-08 15:16:50itpub13周年纪念徽章
日期:2014-10-08 15:16:50itpub13周年纪念徽章
日期:2014-10-10 14:34:59马上加薪
日期:2015-01-08 15:39:192015年新春福章
日期:2015-03-04 14:19:112015年新春福章
日期:2015-03-06 11:57:31
57#
发表于 2003-7-2 16:20 | 只看该作者

自己看看吧

TKPROF: Release 8.1.7.0.0 - Production on 星期三 7月 2 16:15:01 2003

(c) Copyright 2000 Oracle Corporation.  All rights reserved.

Trace file: ora_442096.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
********************************************************************************

select file#
from
file$ where ts#=:1


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse       34      0.01       0.01          0          0          0           0
Execute     34      0.00       0.00          0          0          0           0
Fetch      170      0.00       0.01          0        306          0         136
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total      238      0.01       0.02          0        306          0         136

Misses in library cache during parse: 0
Optimizer goal: CHOOSE
Parsing user id: SYS   (recursive depth: 2)

Rows     Row Source Operation
-------  ---------------------------------------------------
      4  TABLE ACCESS BY INDEX ROWID FILE$
      5   INDEX RANGE SCAN (object id 39)

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

select file#,block#,length
from
uet$ where ts#=:1 and segfile#=:2 and segblock#=:3 and ext#=:4


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse       14      0.00       0.00          0          0          0           0
Execute     14      0.00       0.01          0          0          0           0
Fetch       14      0.01       0.00          0         56          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total       42      0.01       0.01          0         56          0           0

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: SYS   (recursive depth: 2)

Rows     Row Source Operation
-------  ---------------------------------------------------
      0  TABLE ACCESS CLUSTER UET$
      2   INDEX UNIQUE SCAN (object id 9)

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

insert into uet$ (segfile#,segblock#,ext#,ts#,file#,block#,length)
values
(:1, :2, :3, :4, :5, :6, :7)


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

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: SYS   (recursive depth: 2)
********************************************************************************

delete from fet$
where
file#=:1 and block#=:2 and ts#=:3


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

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: SYS   (recursive depth: 2)

Rows     Row Source Operation
-------  ---------------------------------------------------
      1  DELETE FET$
      2   TABLE ACCESS CLUSTER FET$
      2    INDEX UNIQUE SCAN (object id 7)

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

update seg$ set type#=:4,blocks=:5,extents=:6,minexts=:7,maxexts=:8,extsize=
  :9,extpct=:10,user#=:11,iniexts=:12,lists=decode(:13, 65535, NULL, :13),
  groups=decode(:14, 65535, NULL, :14), cachehint=:15, hwmincr=:16, spare1=
  DECODE(:17,0,NULL,:17)
where
ts#=:1 and file#=:2 and block#=:3


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse       14      0.00       0.01          0          0          0           0
Execute     14      0.02       0.01          0         84         14          14
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total       28      0.02       0.02          0         84         14          14

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: SYS   (recursive depth: 2)

Rows     Row Source Operation
-------  ---------------------------------------------------
      1  UPDATE SEG$
      2   TABLE ACCESS CLUSTER SEG$
      2    INDEX UNIQUE SCAN (object id 9)

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

select  file#,block#,length
from
fet$       where length>=:1 and ts#=:2 and file#=:3


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse       11      0.01       0.00          0          0          0           0
Execute     11      0.00       0.00          0          0          0           0
Fetch      328      0.01       0.01          0        350          0         317
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total      350      0.02       0.01          0        350          0         317

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: SYS   (recursive depth: 2)

Rows     Row Source Operation
-------  ---------------------------------------------------
     29  TABLE ACCESS CLUSTER FET$
      2   INDEX UNIQUE SCAN (object id 7)

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

select length
from
fet$ where file#=:1 and block#=:2 and ts#=:3


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

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: SYS   (recursive depth: 2)

Rows     Row Source Operation
-------  ---------------------------------------------------
      0  TABLE ACCESS CLUSTER FET$
      2   INDEX UNIQUE SCAN (object id 7)

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

insert into fet$ (file#,block#,ts#,length)
values
(:1,:2,:3,:4)


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

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: SYS   (recursive depth: 2)
********************************************************************************

INSERT INTO UC_BUSINESS1 ( CAL_DATE,USER_DINNER,DEVELOP_DEPT_NO,USER_KIND,
  CREDIT_WAY,CREDIT_DINNER,CREDIT_LIMIT_ID,URGE_FLAG,AGE_RANGE,SEX,
  OPER_DEPT_NO,PAY_TYPE,MAC_TYPE,IN_NET_DATE,LEAVE_DATE,EXCHANGE_DATE,
  TOTAL_USERS,ASSNO_USERS )  SELECT :b1,B.USER_DINNER,B.DEVELOP_DEPT_NO,
  B.USER_KIND,B.CREDIT_WAY,B.CREDIT_DINNER,D.CL_ID,B.URGE_FLAG,C.CL_ID,B.SEX,
  B.OPER_DEPT_NO,B.PAY_TYPE,B.MAC_TYPE,B.CIN_NET_DATE IN_NET_DATE,
  B.CLEAVE_DATE LEAVE_DATE,B.CEXCHANGE_DATE EXCHANGE_DATE,COUNT(*)
  TOTAL_USERS,SUM(DECODE(B.ASSURE_NO, NULL ,0,1)) ASSNO_USERS   FROM
  MV_USER_INFO B,UC_RANGE C,UC_RANGE D  WHERE B.CUSTOMER_NAME != '广州'  AND
  B.CUSTOMER_NAME != '广州市'  AND C.MIN_LMT <= DECODE(LENGTH(B.BIRTHDAY),8,
  TO_NUMBER(TO_CHAR(:b2,'YYYY')) - TO_NUMBER(SUBSTR(B.BIRTHDAY,1,4)) ,-1)  
  AND C.MAX_LMT > DECODE(LENGTH(B.BIRTHDAY),8,TO_NUMBER(TO_CHAR(:b2,'YYYY'))
  - TO_NUMBER(SUBSTR(B.BIRTHDAY,1,4)) ,-1)  AND C.CL_SCM_ID = 4  AND
  D.MIN_LMT <= B.CREDIT_LIMIT  AND D.MAX_LMT > B.CREDIT_LIMIT  AND
  D.CL_SCM_ID = 2  AND B.IN_NET_DATE < :b2 + 1   GROUP BY B.USER_DINNER,
  B.DEVELOP_DEPT_NO,B.USER_KIND,B.CREDIT_WAY,B.CREDIT_DINNER,D.CL_ID,
  B.URGE_FLAG,C.CL_ID,B.SEX,B.OPER_DEPT_NO,B.PAY_TYPE,B.MAC_TYPE,
  B.CIN_NET_DATE,B.CLEAVE_DATE,B.CEXCHANGE_DATE


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        0      0.00       0.00          0          0          0           0
Execute      2      0.00       0.00       1592     474892     530722       97085
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2      0.00       0.00       1592     474892     530722       97085

Misses in library cache during parse: 0
Misses in library cache during execute: 1
Optimizer goal: CHOOSE
Parsing user id: 34     (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
  97086  SORT GROUP BY
206165   NESTED LOOPS
206166    NESTED LOOPS
      7     TABLE ACCESS BY INDEX ROWID UC_RANGE
      7      INDEX RANGE SCAN (object id 34553)
206171     TABLE ACCESS BY INDEX ROWID MV_USER_INFO
1707924      INDEX RANGE SCAN (object id 34688)
206165    TABLE ACCESS BY INDEX ROWID UC_RANGE
412330     INDEX RANGE SCAN (object id 34553)

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

DELETE FROM UC_IN_NET_USERS
WHERE
CAL_DATE = :b1


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.01          0          0          0           0
Execute      1      0.00       0.21          3          3          5           1
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2      0.00       0.22          3          3          5           1

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 34     (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
      1  DELETE UC_IN_NET_USERS
      1   INDEX UNIQUE SCAN (object id 34550)

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

INSERT INTO UC_IN_NET_USERS SELECT :b1,COUNT(*)   FROM MV_USER_INFO A  WHERE
  (LEAVE_DATE >= :b2 + 1   OR LEAVE_DATE IS NULL ) AND (EXCHANGE_DATE >= :b2
  + 1   OR EXCHANGE_DATE IS NULL ) AND A.FLAG != '1'  AND IN_NET_DATE < :b2 +
  1


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.01       0.00          0          0          0           0
Execute      1      0.80       0.82          1       7642          4           1
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2      0.81       0.82          1       7642          4           1

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 34     (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
      2  SORT AGGREGATE
265667   TABLE ACCESS BY INDEX ROWID MV_USER_INFO
284654    INDEX RANGE SCAN (object id 34688)

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

DELETE FROM UC_STATUS_CHANGE
WHERE
CAL_DATE = :b1


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      1      2.30      10.21        246        476     131587        9820
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2      2.30      10.21        246        476     131587        9820

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 34     (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
      1  DELETE UC_STATUS_CHANGE
   9821   TABLE ACCESS BY INDEX ROWID UC_STATUS_CHANGE
   9821    INDEX RANGE SCAN (object id 33684)

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

INSERT INTO UC_STATUS_CHANGE ( CAL_DATE,DEVELOP_DEPT_NO,USER_KIND,
  CREDIT_DINNER,USER_DINNER,PAY_TYPE,STATUS_CODE_OLD,STATUS_CODE_NEW,
  PAY_TYPE_OLD,PAY_TYPE_NEW,CREDIT_DINNER_OLD,CREDIT_DINNER_NEW,URGE_FLAG_OLD,
  URGE_FLAG_NEW,TOTAL_USERS )  SELECT :b1,A.DEVELOP_DEPT_NO,A.USER_KIND,
  A.CREDIT_DINNER,A.USER_DINNER,A.PAY_TYPE,B.STATUS_CODE_OLD,
  B.STATUS_CODE_NEW,C.PAY_TYPE_OLD,C.PAY_TYPE PAY_TYPE_NEW,
  D.CREDIT_DINNER_OLD,D.CREDIT_DINNER_NEW,E.URGE_FLAG_OLD,E.URGE_FLAG_NEW,
  COUNT(*)   FROM MV_USER_INFO A,(SELECT *   FROM UC_LOG_USER_STATUS  WHERE
  SERVICE_ID IN (SELECT MAX(SERVICE_ID)   FROM UC_LOG_USER_STATUS  WHERE
  OPER_DATE >= :b2  AND OPER_DATE < :b2 + 1   AND STATUS_CODE_OLD !=
  STATUS_CODE_NEW  GROUP BY USER_NO )) B,(SELECT *   FROM UC_LOG_INFO_PAY  
  WHERE SERVICE_ID IN (SELECT MAX(SERVICE_ID)   FROM UC_LOG_INFO_PAY  WHERE
  OPER_DATE >= :b2  AND OPER_DATE < :b2 + 1   AND PAY_TYPE_OLD != PAY_TYPE  
  GROUP BY PAY_NO )) C,(SELECT DEVICE_NUMBER,CREDIT_DINNER_OLD,
  CREDIT_DINNER_NEW   FROM UC_LOG_MODIFY_CREDIT  WHERE SERVICE_ID IN (SELECT
  MAX(SERVICE_ID)   FROM UC_LOG_MODIFY_CREDIT  WHERE OPER_DATE >= :b2  AND
  OPER_DATE < :b2 + 1   AND CREDIT_DINNER_OLD != CREDIT_DINNER_NEW  GROUP BY
  DEVICE_NUMBER )) D,(SELECT DEVICE_NUMBER,URGE_FLAG_OLD,URGE_FLAG_NEW   FROM
  UC_LOG_MODIFY_CREDIT  WHERE SERVICE_ID IN (SELECT MAX(SERVICE_ID)   FROM
  UC_LOG_MODIFY_CREDIT  WHERE OPER_DATE >= :b2  AND OPER_DATE < :b2 + 1   AND
  URGE_FLAG_OLD != URGE_FLAG_NEW  GROUP BY DEVICE_NUMBER )) E  WHERE
  A.CUSTOMER_NAME != '广州'  AND A.CUSTOMER_NAME != '广州市'  AND A.USER_NO =
  B.USER_NO (+)    AND A.DEVICE_NUMBER = C.DEVICE_NUMBER (+)    AND
  A.DEVICE_NUMBER = D.DEVICE_NUMBER (+)    AND A.DEVICE_NUMBER =
  E.DEVICE_NUMBER (+)    AND A.IN_NET_DATE < :b2 + 1   GROUP BY
  A.DEVELOP_DEPT_NO,A.USER_KIND,A.CREDIT_DINNER,A.USER_DINNER,A.PAY_TYPE,
  B.STATUS_CODE_OLD,B.STATUS_CODE_NEW,C.PAY_TYPE_OLD,C.PAY_TYPE,
  D.CREDIT_DINNER_OLD,D.CREDIT_DINNER_NEW,E.URGE_FLAG_OLD,E.URGE_FLAG_NEW


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.01       0.02          0          0          0           0
Execute      2     13.31      17.51       5315      97168      38797        9820
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        3     13.32      17.53       5315      97168      38797        9820

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 34     (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
   9821  SORT GROUP BY
206165   HASH JOIN OUTER
206165    HASH JOIN OUTER
206165     HASH JOIN OUTER
206165      HASH JOIN OUTER
206165       TABLE ACCESS BY INDEX ROWID MV_USER_INFO
284654        INDEX RANGE SCAN (object id 34688)
   2608       VIEW
   2608        NESTED LOOPS
   2609         VIEW VW_NSO_1
   2609          SORT UNIQUE
   2608           SORT GROUP BY
   3262            TABLE ACCESS FULL UC_LOG_USER_STATUS
   2608         TABLE ACCESS FULL UC_LOG_USER_STATUS
     13      VIEW
     13       NESTED LOOPS
     14        VIEW VW_NSO_2
     14         SORT UNIQUE
     13          SORT GROUP BY
     13           TABLE ACCESS FULL UC_LOG_INFO_PAY
     13        TABLE ACCESS FULL UC_LOG_INFO_PAY
    113     VIEW
    113      NESTED LOOPS
    114       VIEW VW_NSO_3
    114        SORT UNIQUE
    113         SORT GROUP BY
    116          TABLE ACCESS FULL UC_LOG_MODIFY_CREDIT
    113       TABLE ACCESS FULL UC_LOG_MODIFY_CREDIT
      4    VIEW
      4     NESTED LOOPS
      5      VIEW VW_NSO_4
      5       SORT UNIQUE
      4        SORT GROUP BY
      4         TABLE ACCESS FULL UC_LOG_MODIFY_CREDIT
      4      TABLE ACCESS FULL UC_LOG_MODIFY_CREDIT

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

DELETE FROM UC_FAKE_USERS
WHERE
CAL_DATE = :b1


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

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 34     (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
      1  DELETE UC_FAKE_USERS
      1   INDEX UNIQUE SCAN (object id 34548)

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

SELECT COUNT(DISTINCT USER_NO)   
FROM
MV_USER_INFO  WHERE (CUSTOMER_NAME = '广州'  OR CUSTOMER_NAME = '广州市' )
  AND IN_NET_DATE < :b1 + 1   AND (LEAVE_DATE IS NULL  OR LEAVE_DATE > :b1 )
  AND (EXCHANGE_DATE IS NULL  OR EXCHANGE_DATE > :b1 )


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.64       0.66          4       1890          0           1
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        3      0.65       0.66          4       1890          0           1

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 34     (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
      1  SORT GROUP BY
  76847   INLIST ITERATOR
  76847    TABLE ACCESS BY INDEX ROWID MV_USER_INFO
  78490     INDEX RANGE SCAN (object id 34696)

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

SELECT NVL(SUM(B.CHARGE - B.DERATE_CHARGE  - B.PAY_CHARGE ),0)   
FROM
MV_USER_INFO A,UC_CHARGE_ITEM B  WHERE A.USER_NO = B.USER_NO  AND
  (A.CUSTOMER_NAME = '广州'  OR A.CUSTOMER_NAME = '广州市' ) AND B.STATE =
  '0'  AND A.IN_NET_DATE < :b1 + 1


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      1      0.01       0.00          0          0          0           0
Fetch        1      3.91      10.81       2462     355626          0           1
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        3      3.92      10.81       2462     355626          0           1

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 34     (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
      1  SORT AGGREGATE
116304   NESTED LOOPS
  78489    INLIST ITERATOR
  78490     TABLE ACCESS BY INDEX ROWID MV_USER_INFO
  78490      INDEX RANGE SCAN (object id 34696)
116304    TABLE ACCESS BY INDEX ROWID UC_CHARGE_ITEM
204455     INDEX RANGE SCAN (object id 33575)

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

INSERT INTO UC_FAKE_USERS ( CAL_DATE,FAKE_USERS,CHARGE )  
VALUES
( :b1,:b2,:b3  )


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

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 34     (recursive depth: 1)
********************************************************************************

使用道具 举报

回复
论坛徽章:
63
版主7段
日期:2012-05-15 15:24:11itpub13周年纪念徽章
日期:2014-10-08 15:16:50itpub13周年纪念徽章
日期:2014-10-08 15:16:50itpub13周年纪念徽章
日期:2014-10-08 15:16:50itpub13周年纪念徽章
日期:2014-10-10 14:34:59马上加薪
日期:2015-01-08 15:39:192015年新春福章
日期:2015-03-04 14:19:112015年新春福章
日期:2015-03-06 11:57:31
58#
发表于 2003-7-2 16:20 | 只看该作者
DELETE FROM UC_INCOME
WHERE
CAL_DATE = :b1


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      1      1.29       1.93         12        351      92666        2971
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2      1.29       1.93         12        351      92666        2971

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 34     (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
      1  DELETE UC_INCOME
   2972   TABLE ACCESS BY INDEX ROWID UC_INCOME
   2972    INDEX RANGE SCAN (object id 33604)

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

INSERT INTO UC_INCOME ( CAL_DATE,ACCT_MONTH,DEVELOP_DEPT_NO,OPER_DEPT_NO,
  USER_KIND,CREDIT_DINNER,AGE_RANGE,SEX,USER_DINNER,REG_PAY_TYPE,
  FACT_PAY_TYPE,MAC_TYPE,INCOME,TOTAL_USERS )  SELECT :b1,A.ACCT_MONTH,
  B.DEVELOP_DEPT_NO,A.OPER_DEPT_NO,B.USER_KIND,B.CREDIT_DINNER,C.CL_ID,B.SEX,
  A.USER_DINNER,B.PAY_TYPE,A.PAY_TYPE,B.MAC_TYPE,SUM(A.CHARGE),COUNT(*)   
  FROM (SELECT ACCT_MONTH,OPER_DEPT_NO,USER_DINNER,PAY_TYPE,USER_NO,
  SUM(CHARGE) CHARGE   FROM UC_LOG_WRITE_OFF  WHERE STATE_DATE < :b2 + 1   
  AND STATE_DATE >= :b2  GROUP BY ACCT_MONTH,OPER_DEPT_NO,USER_DINNER,
  PAY_TYPE,USER_NO ) A,MV_USER_INFO B,UC_RANGE C  WHERE B.CUSTOMER_NAME !=
  '广州'  AND B.CUSTOMER_NAME != '广州市'  AND B.USER_NO = A.USER_NO  AND
  C.MIN_LMT <= DECODE(LENGTH(B.BIRTHDAY),8,TO_NUMBER(TO_CHAR(:b2,'YYYY')) -
  TO_NUMBER(SUBSTR(B.BIRTHDAY,1,4)) ,-1)  AND C.MAX_LMT >
  DECODE(LENGTH(B.BIRTHDAY),8,TO_NUMBER(TO_CHAR(:b2,'YYYY')) -
  TO_NUMBER(SUBSTR(B.BIRTHDAY,1,4)) ,-1)  AND C.CL_SCM_ID = 4  GROUP BY
  A.ACCT_MONTH,B.DEVELOP_DEPT_NO,A.OPER_DEPT_NO,B.USER_KIND,B.CREDIT_DINNER,
  C.CL_ID,B.SEX,A.USER_DINNER,B.PAY_TYPE,A.PAY_TYPE,B.MAC_TYPE  UNION ALL
  SELECT :b1,A.ACCT_MONTH,B.DEVELOP_DEPT_NO,A.OPER_DEPT_NO,B.USER_KIND,
  B.CREDIT_DINNER,C.CL_ID,B.SEX,A.USER_DINNER,B.PAY_TYPE,'全部',B.MAC_TYPE,
  SUM(A.CHARGE),COUNT(*)   FROM (SELECT ACCT_MONTH,OPER_DEPT_NO,USER_DINNER,
  USER_NO,SUM(CHARGE) CHARGE   FROM UC_LOG_WRITE_OFF  WHERE STATE_DATE < :b2
  + 1   AND STATE_DATE >= :b2  GROUP BY ACCT_MONTH,OPER_DEPT_NO,USER_DINNER,
  USER_NO ) A,MV_USER_INFO B,UC_RANGE C  WHERE B.CUSTOMER_NAME != '广州'  AND
  B.CUSTOMER_NAME != '广州市'  AND B.USER_NO = A.USER_NO  AND C.MIN_LMT <=
  DECODE(LENGTH(B.BIRTHDAY),8,TO_NUMBER(TO_CHAR(:b2,'YYYY')) -
  TO_NUMBER(SUBSTR(B.BIRTHDAY,1,4)) ,-1)  AND C.MAX_LMT >
  DECODE(LENGTH(B.BIRTHDAY),8,TO_NUMBER(TO_CHAR(:b2,'YYYY')) -
  TO_NUMBER(SUBSTR(B.BIRTHDAY,1,4)) ,-1)  AND C.CL_SCM_ID = 4  GROUP BY
  A.ACCT_MONTH,B.DEVELOP_DEPT_NO,A.OPER_DEPT_NO,B.USER_KIND,B.CREDIT_DINNER,
  C.CL_ID,B.SEX,A.USER_DINNER,B.PAY_TYPE,B.MAC_TYPE


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.01       0.01          0          0          0           0
Execute      2      1.98       3.54        466      91227      22654        2971
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        3      1.99       3.55        466      91227      22654        2971

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 34     (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
   2972  UNION-ALL
   1487   SORT GROUP BY
   2515    NESTED LOOPS
  15097     MERGE JOIN CARTESIAN
   2517      VIEW
   2517       SORT GROUP BY
  23368        TABLE ACCESS BY INDEX ROWID UC_LOG_WRITE_OFF
  23369         INDEX RANGE SCAN (object id 33657)
  17612      SORT JOIN
      6       TABLE ACCESS BY INDEX ROWID UC_RANGE
      7        INDEX RANGE SCAN (object id 34553)
   2515     TABLE ACCESS BY INDEX ROWID MV_USER_INFO
  30186      INDEX RANGE SCAN (object id 34694)
   1486   SORT GROUP BY
   2515    NESTED LOOPS
  15097     MERGE JOIN CARTESIAN
   2517      VIEW
   2517       SORT GROUP BY
  23368        TABLE ACCESS BY INDEX ROWID UC_LOG_WRITE_OFF
  23369         INDEX RANGE SCAN (object id 33657)
  17612      SORT JOIN
      6       TABLE ACCESS BY INDEX ROWID UC_RANGE
      7        INDEX RANGE SCAN (object id 34553)
   2515     TABLE ACCESS BY INDEX ROWID MV_USER_INFO
  30186      INDEX RANGE SCAN (object id 34694)

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

DELETE FROM UC_PAY
WHERE
CAL_DATE = :b1


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.01       0.00          0          0          0           0
Execute      1      1.11       1.69          1         34      81802        3536
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2      1.12       1.69          1         34      81802        3536

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 34     (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
      1  DELETE UC_PAY
   3537   TABLE ACCESS BY INDEX ROWID UC_PAY
   3537    INDEX RANGE SCAN (object id 33658)

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

INSERT INTO UC_PAY ( CAL_DATE,DEVELOP_DEPT_NO,USER_KIND,AGE_RANGE,SEX,
  USER_DINNER,REG_PAY_TYPE,FACT_PAY_TYPE,CREDIT_DINNER,TOTAL_USERS,TOTAL_FEE )
    SELECT :b1,B.DEVELOP_DEPT_NO,B.USER_KIND,C.CL_ID,B.SEX,B.USER_DINNER,
  B.PAY_TYPE,A.PAY_TYPE,B.CREDIT_DINNER,COUNT(*),SUM(CHARGE / D.COUNT_USERS )
    FROM (SELECT PAY_TYPE,SUM(CHARGE) CHARGE,PAY_NO   FROM UC_LOG_PAY  WHERE
  STATE_DATE < :b2 + 1   AND STATE_DATE >= :b2  GROUP BY PAY_NO,PAY_TYPE ) A,
  MV_USER_INFO B,UC_RANGE C,(SELECT PAY_NO,COUNT(*) COUNT_USERS   FROM
  MV_USER_INFO  GROUP BY PAY_NO ) D  WHERE B.CUSTOMER_NAME != '广州'  AND
  B.CUSTOMER_NAME != '广州市'  AND B.PAY_NO = A.PAY_NO  AND B.PAY_NO =
  D.PAY_NO  AND C.MIN_LMT <= DECODE(LENGTH(B.BIRTHDAY),8,
  TO_NUMBER(TO_CHAR(:b2,'YYYY')) - TO_NUMBER(SUBSTR(B.BIRTHDAY,1,4)) ,-1)  
  AND C.MAX_LMT > DECODE(LENGTH(B.BIRTHDAY),8,TO_NUMBER(TO_CHAR(:b2,'YYYY'))
  - TO_NUMBER(SUBSTR(B.BIRTHDAY,1,4)) ,-1)  AND C.CL_SCM_ID = 4  AND
  B.IN_NET_DATE < :b2 + 1   GROUP BY B.DEVELOP_DEPT_NO,B.USER_KIND,C.CL_ID,
  B.SEX,B.USER_DINNER,B.PAY_TYPE,A.PAY_TYPE,B.CREDIT_DINNER  UNION ALL SELECT
  :b1,B.DEVELOP_DEPT_NO,B.USER_KIND,C.CL_ID,B.SEX,B.USER_DINNER,B.PAY_TYPE,
  '全部',B.CREDIT_DINNER,COUNT(*),SUM(CHARGE / D.COUNT_USERS )   FROM (SELECT
  SUM(CHARGE) CHARGE,PAY_NO   FROM UC_LOG_PAY  WHERE STATE_DATE < :b2 + 1   
  AND STATE_DATE >= :b2  GROUP BY PAY_NO ) A,MV_USER_INFO B,UC_RANGE C,
  (SELECT PAY_NO,COUNT(*) COUNT_USERS   FROM MV_USER_INFO  GROUP BY PAY_NO )
  D  WHERE B.CUSTOMER_NAME != '广州'  AND B.CUSTOMER_NAME != '广州市'  AND
  B.PAY_NO = A.PAY_NO  AND B.PAY_NO = D.PAY_NO  AND C.MIN_LMT <=
  DECODE(LENGTH(B.BIRTHDAY),8,TO_NUMBER(TO_CHAR(:b2,'YYYY')) -
  TO_NUMBER(SUBSTR(B.BIRTHDAY,1,4)) ,-1)  AND C.MAX_LMT >
  DECODE(LENGTH(B.BIRTHDAY),8,TO_NUMBER(TO_CHAR(:b2,'YYYY')) -
  TO_NUMBER(SUBSTR(B.BIRTHDAY,1,4)) ,-1)  AND C.CL_SCM_ID = 4  AND
  B.IN_NET_DATE < :b2 + 1   GROUP BY B.DEVELOP_DEPT_NO,B.USER_KIND,C.CL_ID,
  B.SEX,B.USER_DINNER,B.PAY_TYPE,B.CREDIT_DINNER


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.01       0.01          0          0          0           0
Execute      2   3550.75    5084.50    4493497      60392      20313        3536
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        3   3550.76    5084.51    4493497      60392      20313        3536

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 34     (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
   3537  UNION-ALL
   1772   SORT GROUP BY
   5016    NESTED LOOPS
   5017     NESTED LOOPS
   5017      NESTED LOOPS
   5017       VIEW
   5017        SORT GROUP BY
   5288         TABLE ACCESS BY INDEX ROWID UC_LOG_PAY
   5289          INDEX RANGE SCAN (object id 33640)
  10032       TABLE ACCESS BY INDEX ROWID MV_USER_INFO
  10032        INDEX RANGE SCAN (object id 34698)
  10032      TABLE ACCESS BY INDEX ROWID UC_RANGE
  10032       INDEX RANGE SCAN (object id 34553)
   5016     VIEW
1528957056      SORT GROUP BY
304890       INDEX FAST FULL SCAN (object id 34698)
   1766   SORT GROUP BY
   5014    NESTED LOOPS
   5015     NESTED LOOPS
   5015      NESTED LOOPS
   5015       VIEW
   5015        SORT GROUP BY
   5288         TABLE ACCESS BY INDEX ROWID UC_LOG_PAY
   5289          INDEX RANGE SCAN (object id 33640)
  10028       TABLE ACCESS BY INDEX ROWID MV_USER_INFO
  10028        INDEX RANGE SCAN (object id 34698)
  10028      TABLE ACCESS BY INDEX ROWID UC_RANGE
  10028       INDEX RANGE SCAN (object id 34553)
   5014     VIEW
1528347424      SORT GROUP BY
304890       INDEX FAST FULL SCAN (object id 34698)

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

select i.obj#,i.ts#,i.file#,i.block#,i.intcols,i.type#,i.flags, i.property,
  i.pctfree$,i.initrans,i.maxtrans,i.blevel,i.leafcnt,i.distkey, i.lblkkey,
  i.dblkkey,i.clufac,i.cols,i.analyzetime,i.samplesize,i.dataobj#,
  nvl(i.degree,1),nvl(i.instances,1),i.rowcnt,mod(i.pctthres$,256),
  i.indmethod#,i.trunccnt,nvl(c.unicols,0),nvl(c.deferrable#+c.valid#,0),
  nvl(i.spare1,i.intcols),i.spare4,spare2,decode(i.pctthres$,null,null,
  mod(trunc(i.pctthres$/256),256))
from
ind$ i, (select enabled, min(cols) unicols, min(to_number(bitand(defer,1)))
  deferrable#, min(to_number(bitand(defer,4))) valid# from cdef$ where obj#=
  :1 and enabled > 1 group by enabled) c where i.obj#=c.enabled(+) and i.bo#=
  :1


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           0
Fetch       12      0.01       0.00          0         12          0          10
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total       16      0.01       0.00          0         12          0          10

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: SYS   (recursive depth: 2)
********************************************************************************

select pos#,intcol#,col#,spare1
from
icol$ where obj#=:1


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        2      0.00       0.00          0          0          0           0
Execute     10      0.00       0.00          0          0          0           0
Fetch       20      0.00       0.00          0         40          0          10
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total       32      0.00       0.00          0         40          0          10

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: SYS   (recursive depth: 2)
********************************************************************************

select name,intcol#,segcol#,type#,length,nvl(precision#,0),decode(type#,2,
  nvl(scale,-127/*MAXSB1MINAL*/),178,scale,179,scale,180,scale,181,scale,182,
  scale,183,scale,231,scale,0),null$,fixedstorage,nvl(deflength,0),default$,
  rowid,col#,property, charsetid,charsetform,spare1,spare2
from
col$ where obj#=:1 order by intcol#


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           0
Fetch       18      0.00       0.00          0          8          0          16
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total       22      0.00       0.00          0          8          0          16

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: SYS   (recursive depth: 2)
********************************************************************************

select con#,obj#,rcon#,enabled,nvl(defer,0)
from
cdef$ where robj#=:1


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           0
Fetch        2      0.00       0.01          0          2          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        6      0.00       0.01          0          2          0           0

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: SYS   (recursive depth: 2)
********************************************************************************

select con#,type#,condlength,intcols,robj#,rcon#,match#,refact,nvl(enabled,0),
  rowid,cols,nvl(defer,0),mtime,nvl(spare1,0)
from
cdef$ where obj#=:1


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           0
Fetch        8      0.00       0.00          0         10          0           6
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total       12      0.00       0.00          0         10          0           6

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: SYS   (recursive depth: 2)
********************************************************************************

select u.name,o.name, t.update$, t.insert$, t.delete$, t.enabled  
from
obj$ o,user$ u,trigger$ t  where t.baseobject=:1 and t.obj#=o.obj# and
  o.owner#=u.user#  order by o.obj#


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

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: SYS   (recursive depth: 2)

Rows     Row Source Operation
-------  ---------------------------------------------------
      0  SORT ORDER BY
      0   NESTED LOOPS
      1    NESTED LOOPS
      1     TABLE ACCESS BY INDEX ROWID TRIGGER$
      1      INDEX RANGE SCAN (object id 119)
      0     TABLE ACCESS BY INDEX ROWID OBJ$
      0      INDEX UNIQUE SCAN (object id 33)
      0    TABLE ACCESS CLUSTER USER$
      0     INDEX UNIQUE SCAN (object id 11)

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

DELETE FROM UC_SUM_PREPAY
WHERE
CAL_DATE = :b1


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.01       0.01          0          0          0           0
Execute      1      4.13      10.81        618        679     249870       12406
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2      4.14      10.82        618        679     249870       12406

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 34     (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
      1  DELETE UC_SUM_PREPAY
  12407   TABLE ACCESS BY INDEX ROWID UC_SUM_PREPAY
  12407    INDEX RANGE SCAN (object id 33694)

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

select intcol#,nvl(pos#,0),col#
from
ccol$ where con#=:1


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      6      0.00       0.00          0          0          0           0
Fetch       12      0.00       0.00          0         24          0           6
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total       19      0.00       0.00          0         24          0           6

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: SYS   (recursive depth: 2)
********************************************************************************

INSERT INTO UC_SUM_PREPAY ( CAL_DATE,DEVELOP_DEPT_NO,USER_KIND,AGE_RANGE,SEX,
  USER_DINNER,PAY_TYPE,CREDIT_DINNER,URGE_FLAG,PREPAY_USERS,PREPAY_FEE )  
  SELECT :b1,B.DEVELOP_DEPT_NO,B.USER_KIND,C.CL_ID,B.SEX,B.USER_DINNER,
  B.PAY_TYPE,B.CREDIT_DINNER,B.URGE_FLAG,COUNT(*),SUM(A.PREPAY_CHARGE /
  D.COUNT_USERS )   FROM UC_CHARGE_PREPAY A,MV_USER_INFO B,UC_RANGE C,(SELECT
  COUNT(*) COUNT_USERS,PAY_NO   FROM MV_USER_INFO  GROUP BY PAY_NO ) D  WHERE
  B.CUSTOMER_NAME != '广州'  AND B.CUSTOMER_NAME != '广州市'  AND A.PAY_NO =
  B.PAY_NO  AND A.PAY_NO = D.PAY_NO  AND C.MIN_LMT <=
  DECODE(LENGTH(B.BIRTHDAY),8,TO_NUMBER(TO_CHAR(:b2,'YYYY')) -
  TO_NUMBER(SUBSTR(B.BIRTHDAY,1,4)) ,-1)  AND C.MAX_LMT >
  DECODE(LENGTH(B.BIRTHDAY),8,TO_NUMBER(TO_CHAR(:b2,'YYYY')) -
  TO_NUMBER(SUBSTR(B.BIRTHDAY,1,4)) ,-1)  AND C.CL_SCM_ID = 4  AND
  B.IN_NET_DATE < :b2 + 1   GROUP BY B.DEVELOP_DEPT_NO,B.USER_KIND,C.CL_ID,
  B.SEX,B.USER_DINNER,B.PAY_TYPE,B.CREDIT_DINNER,B.URGE_FLAG


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      1   2646.50    3937.93    3586189       8201         15           0
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2   2646.50    3937.93    3586189       8201         15           0

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 34     (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
      0  SORT GROUP BY
      0   NESTED LOOPS
   8003    HASH JOIN
206165     TABLE ACCESS BY INDEX ROWID MV_USER_INFO
284654      INDEX RANGE SCAN (object id 34688)
787218     MERGE JOIN CARTESIAN
      7      TABLE ACCESS BY INDEX ROWID UC_RANGE
      7       INDEX RANGE SCAN (object id 34553)
787218      SORT JOIN
131203       TABLE ACCESS FULL UC_CHARGE_PREPAY
   8002    VIEW
2439137632     SORT GROUP BY
304890      INDEX FAST FULL SCAN (object id 34698)




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

OVERALL TOTALS FOR ALL NON-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


OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS

call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse      149      0.09       0.12          0          0          0           0
Execute    167   6222.21    9069.20    8087942     741260    1168496      142202
Fetch      598      4.58      11.50       2466     358358          0         503
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total      914   6226.88    9080.82    8090408    1099618    1168496      142705

Misses in library cache during parse: 28
Misses in library cache during execute: 1

   15  user  SQL statements in session.
  135  internal SQL statements in session.
  150  SQL statements in session.
********************************************************************************
Trace file: ora_442096.trc
Trace file compatibility: 8.00.04
Sort options: default

       1  session in tracefile.
      15  user  SQL statements in trace file.
     135  internal SQL statements in trace file.
     150  SQL statements in trace file.
      30  unique SQL statements in trace file.
    1921  lines in trace file.

使用道具 举报

回复
论坛徽章:
86
ITPUB元老
日期:2005-02-28 12:57:002012新春纪念徽章
日期:2012-01-04 11:49:542012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20咸鸭蛋
日期:2012-05-08 10:27:19版主8段
日期:2012-05-15 15:24:112013年新春福章
日期:2013-02-25 14:51:24
59#
发表于 2003-7-2 16:20 | 只看该作者

请做下面步骤后再trace session

SQL> alter system set timed_statistics        = true;

System altered.

SQL>

使用道具 举报

回复
论坛徽章:
63
版主7段
日期:2012-05-15 15:24:11itpub13周年纪念徽章
日期:2014-10-08 15:16:50itpub13周年纪念徽章
日期:2014-10-08 15:16:50itpub13周年纪念徽章
日期:2014-10-08 15:16:50itpub13周年纪念徽章
日期:2014-10-10 14:34:59马上加薪
日期:2015-01-08 15:39:192015年新春福章
日期:2015-03-04 14:19:112015年新春福章
日期:2015-03-06 11:57:31
60#
发表于 2003-7-2 16:21 | 只看该作者
重点优化cpu    elapsed比较大的sql.

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表