Statement using 25% CPU

Hi
the following statement is taking 25% CPU to run. Although the statement completes in around 30 seconds, I have been advised that the CPU usage needs to be reduced as we can have over 4 instances of the same process running at any one time. Please can anyone make any suggestions to reduce the amount of CPU used?
The statement is:
    INSERT /*+APPEND */ INTO LINE_CALL_OVER_20P
    (ID,RUN_DATA,BILL_DATA,TEL_LINE_ID,CALL_DETS_TOTS,LINE_CALL_CHGS,LINE_TYPE,EXP_SEQ1,DESCR_CODE,AMT,DESCR_TEXT,DUR_MINS,DUR_SECS,TOTAL_AMT)
    (SELECT                      1,                                                                        -- ID
                                 U1.SITE_ID || U1.PROCESS_CTRL,                                            -- RUN DATA
                                 U1.ACCT_NUM || U1.STMT_CODE,                                              -- BILL DATA
                                 O1.SRV_ACCT_NUM||U1.CAT_CODE||U1.SRV_OCCUR,                               -- TEL LINE ID
                                 U1.ACCT_NUM || U1.SEQ_1,                                                  -- CALL DETS TOTALS
                                 1,                                                                        -- LINE CALL CHGS
                                 u1.line_type,                                                             -- LINE TYPE
                                 u1.seq_1,                                                                 -- SEQ 1
                                 u1.descr_code,                                                            -- DESCR CODE
                                 (CASE
                                  WHEN REGEXP_LIKE(SUM(u1.usage_amt), '^[0-9]+$') AND REGEXP_LIKE(SUM(u11.usage_amt), '^[0-9]+$') THEN
                                     SUM(SUBSTR(u1.usage_amt,1,LENGTH(u1.usage_amt)- 4) ||'.'|| SUBSTR(u1.usage_amt,LENGTH(u1.usage_amt)-(4+1)))
                                     - SUM(SUBSTR(u11.usage_amt,1,LENGTH(u11.usage_amt)- 4) ||'.'|| SUBSTR(u11.usage_amt,LENGTH(u11.usage_amt)-(4+1)))
                                  WHEN REGEXP_LIKE(SUM(u1.usage_amt), '^[0-9]+$') AND NOT REGEXP_LIKE(SUM(u11.usage_amt), '^[0-9]+$') THEN
                                     SUM(SUBSTR(u1.usage_amt,1,LENGTH(u1.usage_amt)- 4) ||'.'|| SUBSTR(u1.usage_amt,LENGTH(u1.usage_amt)-(4+1)))
                                     - SUM('-'||TRANSLATE(SUBSTR(u11.usage_amt,1,LENGTH(u11.usage_amt)- 4) ||'.'|| SUBSTR(u11.usage_amt,LENGTH(u11.usage_amt)- (4 + 1)),'},J,K,L,M,N,O,P,Q,R','0,1,2,3,4,5,6,7,8,9'))
                                  WHEN NOT REGEXP_LIKE(SUM(u1.usage_amt), '^[0-9]+$') AND REGEXP_LIKE(SUM(u11.usage_amt), '^[0-9]+$') THEN
                                     SUM('-'||TRANSLATE(SUBSTR(u1.usage_amt,1,LENGTH(u1.usage_amt)- 4) ||'.'|| SUBSTR(u1.usage_amt,LENGTH(u1.usage_amt)- (4 + 1)),'},J,K,L,M,N,O,P,Q,R','0,1,2,3,4,5,6,7,8,9'))
                                     - SUM(SUBSTR(u11.usage_amt,1,LENGTH(u11.usage_amt)- 4) ||'.'|| SUBSTR(u11.usage_amt,LENGTH(u11.usage_amt)-(4+1)))
                                  ELSE
                                     SUM('-'||TRANSLATE(SUBSTR(u1.usage_amt,1,LENGTH(u1.usage_amt)- 4) ||'.'|| SUBSTR(u1.usage_amt,LENGTH(u1.usage_amt)- (4 + 1)),'},J,K,L,M,N,O,P,Q,R','0,1,2,3,4,5,6,7,8,9'))
                                     - SUM('-'||TRANSLATE(SUBSTR(u11.usage_amt,1,LENGTH(u11.usage_amt)- 4) ||'.'|| SUBSTR(u11.usage_amt,LENGTH(u11.usage_amt)- (4 + 1)),'},J,K,L,M,N,O,P,Q,R','0,1,2,3,4,5,6,7,8,9'))
                                 END),
                                 h2.descr,                                                                 -- descr_text
                                 SUM(u2.USAGE_MINUTES),
                                 SUM(u2.USAGE_SECONDS),
                                 COUNT(u2.USAGE_AMT)
                            FROM stmtu1p u1,
                                 stmtu1p u11,
                                 stmtu1p u2,
                                 stmto1p o1,
                                 stmth2p h2
                           WHERE (u1.descr_code = h2.descr_code(+))
                             AND u1.acct_num          = u11.acct_num
                             AND u1.stmt_code         = u11.stmt_code
                             AND u1.srv_acct_num      = u11.srv_acct_num
                             AND u1.srv_occur         = u11.srv_occur
                             AND u1.acct_num          = u2.acct_num
                             AND u1.stmt_code         = u2.stmt_code
                             AND u1.srv_acct_num      = u2.srv_acct_num
                             AND u1.srv_occur         = u2.srv_occur
                             AND u1.acct_num          = o1.acct_num
                             AND u1.srv_acct_num      = o1.srv_acct_num
                             AND u1.stmt_code         = o1.stmt_code
                             AND u1.srv_occur         = o1.srv_occur
                             AND u1.line_type         = 'OS'
                             AND u1.seq_1             = 330
                             AND u11.line_type        = 'DZ'
                             AND u2.line_type         = 'DU'
                        GROUP BY u1.site_id,
                                 u1.process_ctrl,
                                 u1.acct_num,
                                 u1.stmt_code,
                                 O1.SRV_ACCT_NUM,
                                 o1.area_code,
                                 o1.exch_id,
                                 o1.phone_num,
                                 u1.seq_1,
                                 u1.line_type,
                                 u1.descr_code,
                                 u1.cat_code,
                                 u1.srv_occur,
                                 h2.descr)The execution plan for the statement is:
PLAN_TABLE_OUTPUT
Plan hash value: 3269235626
| Id  | Operation               | Name               | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
|   0 | INSERT STATEMENT        |                    |    88 | 15312 |       | 19465   (5)| 00:03:54 |
|   1 |  LOAD AS SELECT         | LINE_CALL_OVER_20P |       |       |       |            |          |
|   2 |   HASH GROUP BY         |                    |    88 | 15312 |       | 19465   (5)| 00:03:54 |
|*  3 |    HASH JOIN OUTER      |                    |    88 | 15312 |       | 19464   (5)| 00:03:54 |
|*  4 |     HASH JOIN           |                    |    88 | 14344 |       | 19382   (5)| 00:03:53 |
|*  5 |      HASH JOIN          |                    |   126 | 15246 |       | 13050   (5)| 00:02:37 |
|*  6 |       HASH JOIN         |                    |  2390 |   207K|  2160K| 12816   (5)| 00:02:34 |
|*  7 |        TABLE ACCESS FULL| STMTU1P            | 47050 |  1608K|       |  6262   (5)| 00:01:16 |
|*  8 |        TABLE ACCESS FULL| STMTU1P            | 57060 |  3009K|       |  6265   (5)| 00:01:16 |
|   9 |       TABLE ACCESS FULL | STMTO1P            | 59033 |  1844K|       |   232   (7)| 00:00:03 |
|* 10 |      TABLE ACCESS FULL  | STMTU1P            |   790K|    31M|       |  6309   (6)| 00:01:16 |
|  11 |     TABLE ACCESS FULL   | STMTH2P            | 39680 |   426K|       |    80   (7)| 00:00:01 |
Predicate Information (identified by operation id):
   3 - access("U1"."DESCR_CODE"="H2"."DESCR_CODE"(+))
   4 - access("U1"."ACCT_NUM"="U2"."ACCT_NUM" AND "U1"."STMT_CODE"="U2"."STMT_CODE" AND
              "U1"."SRV_ACCT_NUM"="U2"."SRV_ACCT_NUM" AND "U1"."SRV_OCCUR"="U2"."SRV_OCCUR")
   5 - access("U1"."ACCT_NUM"="O1"."ACCT_NUM" AND "U1"."SRV_ACCT_NUM"="O1"."SRV_ACCT_NUM" AND
              "U1"."STMT_CODE"="O1"."STMT_CODE" AND "U1"."SRV_OCCUR"="O1"."SRV_OCCUR")
   6 - access("U1"."ACCT_NUM"="U11"."ACCT_NUM" AND "U1"."STMT_CODE"="U11"."STMT_CODE" AND
              "U1"."SRV_ACCT_NUM"="U11"."SRV_ACCT_NUM" AND "U1"."SRV_OCCUR"="U11"."SRV_OCCUR")
   7 - filter("U11"."LINE_TYPE"='DZ')
   8 - filter("U1"."LINE_TYPE"='OS' AND "U1"."SEQ_1"=330)
  10 - filter("U2"."LINE_TYPE"='DU')The tkprof file for the statement is:
TKPROF: Release 10.2.0.1.0 - Production on Sun Feb 17 11:29:08 2008
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Trace file: /u01/app/oracle/admin/ORATEST/udump/oratest_ora_1396968.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
alter session set sql_trace=true
call     count       cpu    elapsed       disk      query    current        rows
Parse        0      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        1      0.00       0.00          0          0          0           0
Misses in library cache during parse: 0
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 85  (PREPROC1)
    INSERT /*+APPEND */ INTO LINE_CALL_OVER_20P
    (ID,RUN_DATA,BILL_DATA,TEL_LINE_ID,CALL_DETS_TOTS,LINE_CALL_CHGS,LINE_TYPE,EXP_SEQ1,DESCR_CODE,AMT,DESCR_TEXT,DUR_MINS,DUR_SECS,TOTAL_AMT)
    (SELECT                      1,                                                                        -- ID
                                 U1.SITE_ID || U1.PROCESS_CTRL,                                            -- RUN DATA
                                 U1.ACCT_NUM || U1.STMT_CODE,                                              -- BILL DATA
                                 O1.SRV_ACCT_NUM||U1.CAT_CODE||U1.SRV_OCCUR,                               -- TEL LINE ID
                                 U1.ACCT_NUM || U1.SEQ_1,                                                  -- CALL DETS TOTALS
                                 1,                                                                        -- LINE CALL CHGS
                                 u1.line_type,                                                             -- LINE TYPE
                                 u1.seq_1,                                                                 -- SEQ 1
                                 u1.descr_code,                                                            -- DESCR CODE
                                 (CASE
                                  WHEN REGEXP_LIKE(SUM(u1.usage_amt), '^[0-9]+$') AND REGEXP_LIKE(SUM(u11.usage_amt), '^[0-9]+$') THEN
                                     SUM(SUBSTR(u1.usage_amt,1,LENGTH(u1.usage_amt)- 4) ||'.'|| SUBSTR(u1.usage_amt,LENGTH(u1.usage_amt)-(4+1)))
                                     - SUM(SUBSTR(u11.usage_amt,1,LENGTH(u11.usage_amt)- 4) ||'.'|| SUBSTR(u11.usage_amt,LENGTH(u11.usage_amt)-(4+1)))
                                  WHEN REGEXP_LIKE(SUM(u1.usage_amt), '^[0-9]+$') AND NOT REGEXP_LIKE(SUM(u11.usage_amt), '^[0-9]+$') THEN
                                     SUM(SUBSTR(u1.usage_amt,1,LENGTH(u1.usage_amt)- 4) ||'.'|| SUBSTR(u1.usage_amt,LENGTH(u1.usage_amt)-(4+1)))
                                     - SUM('-'||TRANSLATE(SUBSTR(u11.usage_amt,1,LENGTH(u11.usage_amt)- 4) ||'.'|| SUBSTR(u11.usage_amt,LENGTH(u11.usage_amt)- (4 + 1)),'},J,K,L,M,N,O,P,Q,R','0,1,2,3,4,5,6,7,8,9'))
                                  WHEN NOT REGEXP_LIKE(SUM(u1.usage_amt), '^[0-9]+$') AND REGEXP_LIKE(SUM(u11.usage_amt), '^[0-9]+$') THEN
                                     SUM('-'||TRANSLATE(SUBSTR(u1.usage_amt,1,LENGTH(u1.usage_amt)- 4) ||'.'|| SUBSTR(u1.usage_amt,LENGTH(u1.usage_amt)- (4 + 1)),'},J,K,L,M,N,O,P,Q,R','0,1,2,3,4,5,6,7,8,9'))
                                     - SUM(SUBSTR(u11.usage_amt,1,LENGTH(u11.usage_amt)- 4) ||'.'|| SUBSTR(u11.usage_amt,LENGTH(u11.usage_amt)-(4+1)))
                                  ELSE
                                     SUM('-'||TRANSLATE(SUBSTR(u1.usage_amt,1,LENGTH(u1.usage_amt)- 4) ||'.'|| SUBSTR(u1.usage_amt,LENGTH(u1.usage_amt)- (4 + 1)),'},J,K,L,M,N,O,P,Q,R','0,1,2,3,4,5,6,7,8,9'))
                                     - SUM('-'||TRANSLATE(SUBSTR(u11.usage_amt,1,LENGTH(u11.usage_amt)- 4) ||'.'|| SUBSTR(u11.usage_amt,LENGTH(u11.usage_amt)- (4 + 1)),'},J,K,L,M,N,O,P,Q,R','0,1,2,3,4,5,6,7,8,9'))
                                 END),
                                 h2.descr,                                                                 -- descr_text
                                 SUM(u2.USAGE_MINUTES),
                                 SUM(u2.USAGE_SECONDS),
                                 COUNT(u2.USAGE_AMT)
                            FROM stmtu1p u1,
                                 stmtu1p u11,
                                 stmtu1p u2,
                                 stmto1p o1,
                                 stmth2p h2
                           WHERE (u1.descr_code = h2.descr_code(+))
                             AND u1.acct_num          = u11.acct_num
                             AND u1.stmt_code         = u11.stmt_code
                             AND u1.srv_acct_num      = u11.srv_acct_num
                             AND u1.srv_occur         = u11.srv_occur
                             AND u1.acct_num          = u2.acct_num
                             AND u1.stmt_code         = u2.stmt_code
                             AND u1.srv_acct_num      = u2.srv_acct_num
                             AND u1.srv_occur         = u2.srv_occur
                             AND u1.acct_num          = o1.acct_num
                             AND u1.srv_acct_num      = o1.srv_acct_num
                             AND u1.stmt_code         = o1.stmt_code
                             AND u1.srv_occur         = o1.srv_occur
                             AND u1.line_type         = 'OS'
                             AND u1.seq_1             = 330
                             AND u11.line_type        = 'DZ'
                             AND u2.line_type         = 'DU'
                        GROUP BY u1.site_id,
                                 u1.process_ctrl,
                                 u1.acct_num,
                                 u1.stmt_code,
                                 O1.SRV_ACCT_NUM,
                                 o1.area_code,
                                 o1.exch_id,
                                 o1.phone_num,
                                 u1.seq_1,
                                 u1.line_type,
                                 u1.descr_code,
                                 u1.cat_code,
                                 u1.srv_occur,
                                 h2.descr)
call     count       cpu    elapsed       disk      query    current        rows
Parse        1      0.03       0.04          0          0          0           0
Execute      1     12.95      18.41      28872      94074        608       39018
Fetch        0      0.00       0.00          0          0          0           0
total        2     12.98      18.46      28872      94074        608       39018
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 85  (PREPROC1)
Rows     Row Source Operation
      1  LOAD AS SELECT  (cr=94126 pr=28872 pw=1727 time=18450373 us)
  39018   HASH GROUP BY (cr=94061 pr=28872 pw=1245 time=17322258 us)
258728    HASH JOIN OUTER (cr=94061 pr=27627 pw=0 time=12275770 us)
258728     HASH JOIN  (cr=93694 pr=27627 pw=0 time=12974313 us)
  46380      HASH JOIN  (cr=62830 pr=23324 pw=0 time=6837995 us)
  46380       HASH JOIN  (cr=61729 pr=23324 pw=0 time=9986105 us)
  46381        TABLE ACCESS FULL STMTU1P (cr=30865 pr=17444 pw=0 time=4545326 us)
  57603        TABLE ACCESS FULL STMTU1P (cr=30864 pr=5880 pw=0 time=2073762 us)
  59033       TABLE ACCESS FULL STMTO1P (cr=1101 pr=0 pw=0 time=77 us)
789379      TABLE ACCESS FULL STMTU1P (cr=30864 pr=4303 pw=0 time=793734 us)
  39954     TABLE ACCESS FULL STMTH2P (cr=367 pr=0 pw=0 time=105 us)
Rows     Execution Plan
      0  INSERT STATEMENT   MODE: ALL_ROWS
      1   LOAD AS SELECT OF 'LINE_CALL_OVER_20P'
  39018    HASH (GROUP BY)
258728     HASH JOIN (OUTER)
258728      HASH JOIN
  46380       HASH JOIN
  46380        HASH JOIN
  46381         TABLE ACCESS   MODE: ANALYZED (FULL) OF 'STMTU1P'
                    (TABLE)
  57603         TABLE ACCESS   MODE: ANALYZED (FULL) OF 'STMTU1P'
                    (TABLE)
  59033        TABLE ACCESS   MODE: ANALYZED (FULL) OF 'STMTO1P'
                   (TABLE)
789379       TABLE ACCESS   MODE: ANALYZED (FULL) OF 'STMTU1P' (TABLE)
  39954      TABLE ACCESS   MODE: ANALYZED (FULL) OF 'STMTH2P' (TABLE)
select file#
from
file$ where ts#=:1
call     count       cpu    elapsed       disk      query    current        rows
Parse        4      0.00       0.00          0          0          1           0
Execute      4      0.01       0.00          0          0          0           0
Fetch       12      0.00       0.00          0         20          0           8
total       20      0.01       0.01          0         20          1           8
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS   (recursive depth: 1)
Rows     Row Source Operation
      2  TABLE ACCESS FULL FILE$ (cr=5 pr=0 pw=0 time=67 us)
update tsq$ set blocks=:3,maxblocks=:4,grantor#=:5,priv1=:6,priv2=:7,priv3=:8
where
ts#=:1 and user#=:2
call     count       cpu    elapsed       disk      query    current        rows
Parse        4      0.00       0.00          0          0          2           0
Execute      4      0.01       0.00          0         12          4           4
Fetch        0      0.00       0.00          0          0          0           0
total        8      0.01       0.01          0         12          6           4
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS   (recursive depth: 1)
Rows     Row Source Operation
      0  UPDATE  TSQ$ (cr=3 pr=0 pw=0 time=267 us)
      1   TABLE ACCESS CLUSTER TSQ$ (cr=3 pr=0 pw=0 time=83 us)
      1    INDEX UNIQUE SCAN I_USER# (cr=1 pr=0 pw=0 time=27 us)(object id 11)
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),scanhint=:18
where
ts#=:1 and file#=:2 and block#=:3
call     count       cpu    elapsed       disk      query    current        rows
Parse        4      0.00       0.00          0          0          0           0
Execute      4      0.01       0.00          0         20          4           4
Fetch        0      0.00       0.00          0          0          0           0
total        8      0.01       0.01          0         20          4           4
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS   (recursive depth: 1)
Rows     Row Source Operation
      0  UPDATE  SEG$ (cr=5 pr=0 pw=0 time=338 us)
      1   TABLE ACCESS CLUSTER SEG$ (cr=5 pr=0 pw=0 time=162 us)
      1    INDEX UNIQUE SCAN I_FILE#_BLOCK# (cr=2 pr=0 pw=0 time=24 us)(object id 9)
commit
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          2         35           0
Fetch        0      0.00       0.00          0          0          0           0
total        2      0.00       0.00          0          2         35           0
Misses in library cache during parse: 0
Parsing user id: 85  (PREPROC1)
alter session set sql_trace=false
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: 1
Optimizer mode: ALL_ROWS
Parsing user id: 85  (PREPROC1)
OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
call     count       cpu    elapsed       disk      query    current        rows
Parse        3      0.03       0.04          0          0          0           0
Execute      4     12.95      18.42      28872      94076        643       39018
Fetch        0      0.00       0.00          0          0          0           0
total        7     12.98      18.47      28872      94076        643       39018
Misses in library cache during parse: 2
Misses in library cache during execute: 1
OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
call     count       cpu    elapsed       disk      query    current        rows
Parse       12      0.00       0.01          0          0          3           0
Execute     12      0.03       0.01          0         32          8           8
Fetch       12      0.00       0.00          0         20          0           8
total       36      0.03       0.03          0         52         11          16
Misses in library cache during parse: 3
Misses in library cache during execute: 3
    4  user  SQL statements in session.
   12  internal SQL statements in session.
   16  SQL statements in session.
    1  statement EXPLAINed in this session.
Trace file: /u01/app/oracle/admin/ORATEST/udump/oratest_ora_1396968.trc
Trace file compatibility: 10.01.00
Sort options: default
       1  session in tracefile.
       4  user  SQL statements in trace file.
      12  internal SQL statements in trace file.
      16  SQL statements in trace file.
       7  unique SQL statements in trace file.
       1  SQL statements EXPLAINed using schema:
           PREPROC1.prof$plan_table
             Default table was used.
             Table was created.
             Table was dropped.
     232  lines in trace file.
      50  elapsed seconds in trace file.Many thanks

Absolutely spot on Rob. Yours is better than mine.
I was looking at something like this. Below ones will be the inner query.
select 1,                                                                        -- ID
       U1.SITE_ID || U1.PROCESS_CTRL,                                            -- RUN DATA
       U1.ACCT_NUM || U1.STMT_CODE,                                              -- BILL DATA
       O1.SRV_ACCT_NUM||U1.CAT_CODE||U1.SRV_OCCUR,                               -- TEL LINE ID
       U1.ACCT_NUM || U1.SEQ_1,                                                  -- CALL DETS TOTALS
       1,                                                                        -- LINE CALL CHGS
       u1.line_type,                                                             -- LINE TYPE
       u1.seq_1,                                                                 -- SEQ 1
       u1.descr_code,                                                            -- DESCR CODE
       sum(case when u1.line_type = 'OS'
       and u1.seq_1 = 330 then
       usage_amt
                 else 0
            end) u1_sum_usage_amt
      ,sum(decode(u1.line_type, 'DZ', usage_amt, 0)) u11_sum_usage_amt
      ,sum(decode(u1.line_type, 'DU', usa_minutes, 0)) u2_sum_minutes
      ,sum(decode(u1.line_type, 'DU', usa_seconds, 0)) u2_sum_seconds
      ,sum(decode(u1.line_type, 'DU', usage_amt, 0)) u2_sum_usage_amt
from stmtu1p u1,
     stmto1p o1,
     stmth2p h2
WHERE u1.descr_code = h2.descr_code(+)
AND u1.acct_num          = o1.acct_num
AND u1.srv_acct_num      = o1.srv_acct_num
AND u1.stmt_code         = o1.stmt_code
AND u1.srv_occur         = o1.srv_occur
AND u1.line_type         = 'OS'
AND u1.seq_1             = 330
AND u11.line_type        = 'DZ'
AND u2.line_type         = 'DU'
GROUP BY u1.site_id,
         u1.process_ctrl,
         u1.acct_num,
         u1.stmt_code,
         O1.SRV_ACCT_NUM,
         o1.area_code,
         o1.exch_id,
         o1.phone_num,
         u1.seq_1,
         u1.line_type,
         u1.descr_code,
         u1.cat_code,
         u1.srv_occur,
         h2.descrAnd then in the outer query he can have something like this.
case when REGEXP_LIKE(u1_sum_usage_amt, '^[0-9]+$') ...He should be able to change the query and gain considerable performance advantage with your start-up.
Cheers
Sarma.

Similar Messages

  • Converting to MP3 causes iTunes to Not Respond while using 50% CPU usage and makes my computer stutter

    Anytime I attempt to "Createa an MP3 Version" of a track, it will take a REALLY long time to work.
    Right now I am attempting to convert an audio book I have which has 88 tracks.  Once I start to convert anything more than 1 track at a time, iTunes immediatly becomes "Not Responding" and takes up about 50% of my CPU the entire time.  It seems like it's doing something in the background but it won't even update the screen anymore, creating weird effects on my screen (Ghost menu bars show up at the top of my screen, etc.).  In addition, once iTunes becomes non-responsive, my entire computer starts to "stutter" meaning that every other second everything momentarily hiccips and stop for a split-second.  This means that while iTunes is converting any multiple MP3 files, if I drag the mouse across the screen, it stops every other second.  Any videos that I try to play pause every other second briefly.  Basically, my computer becomes almost unusable.  Plus, while iTunes is working in the background, different programs randomly jump to the front of the screen.  I will try to be using my web browser while iTunes is working in the background.  Then, suddenly, iTunes pops back up to the foreground in front of my browser (put still won't be responsive to clicks).  My notes program will also flash windows in front of my web browser while surfing, again, only when iTunes is running in the background. 
    I really don't understand:
    1.  Why it takes so much time to convert any file to an MP3 file.  Even converting a single track takes a few minutes.  I'll let my Macbook Pro (with Windows) sit for HOURS upon hours trying to convert the 88 track audio book and it always freezes up and never comes back.
    2.  Why iTunes becomes non-responsive so quickly and won't allow the screen to update once it starts "thinking."  It caps out around 50% of my CPU power so it's not like it doesn't have the headroom to refresh the screen while it works.
    3.  Why does iTunes' working in the background affect every other program I am running?  I don't mind if it uses up CPU cycles in the background, but if it makes my computer unusable while doing so, it's really not worth it.
    I should state that I love Apple products (even though I use Windows on my MBP for school purposes).  However, I absolutely DREAD having to do anything with iTunes anymore because it has become such a hog on my computer.  Someone please tell me that there is something wrong with my iTunes and/or a setting I should change.  I have already re-installed iTunes from scratch before and that didn't help.

    Not a solution, but if the Podcast feed is dormant, why not unsubscribe?
    As to the file structure for media on the device it is deliberately obscured as a countermeasure to casual piracy. See Recover your iTunes library from your iPod or iOS device. Content put on the iPod by a non-iPod aware product is going to treat it like any external drive. The iPod firmware won't read that media.
    tt2

  • What are the database resources when collecting stats using dbms_stats

    Hello,
    We have tables that contain stale stats and would want to collect stats using dbms_stats with estiamte of 30%. What are the database resources that would be consummed when dbms_stats is used on a table? Also, would the table be locked during dbms_stats? Thank you.

    1) I'm not sure what resources you're talking about. Obviously, gathering statistics requires I/O since you've got to read lots of data from the table. It requires CPU particularly if you are gathering histograms. It requires RAM to the extent that you'll be doing sorts in PGA and to the extent that you'll be putting blocks in the buffer cache (and thus causing other blocks to age out), etc. Depending on whether you immediately invalidate query plans, you may force other sessions to start doing a lot more hard parsing as well.
    2) You cannot do DDL on a table while you are gathering statistics, but you can do DML. You would generally not want to gather statistics while an application is active.
    Justin

  • IMovie only using 50% CPU power

    Hi,
    When I export my project in iMovie my CPU usage holds at 50%. I accept this does mean I can do other things but would like the export to go faster.
    Is this usual for iMovie to only use 50% CPU (and only about 1gb of RAM (of 8gb)) or do I need to do something?
    New to Macs so any help appreciated.
    dcbevan

    Hi
    As I get it - Doesn't iMovie take full use of multiple core processors. Not even Pro
    applications does this to 100%
    BUT
    RAM - iMovie or FinalCut are not that RAM hungry - 1 to 2 GB would be OK
    Free Space on Start-up hard disk - VERY IMPORTANT
    • 25Gb my minimum for iDVD
    • 10Gb my minimum for iMovie
    • 5Gb and iMovie runs slow and instable
    • <1Gb and iMovie might not run OK at all
    Other applications running in paralell - results in bad performances
    • Energy Saver
    • Do not spinn down hard disks
    • Use of USB/USB2 external hard disks = Slow and bad performances especially when getting full
    FireWire or internal e-Sata performs best.
    • Screen savers - may be (by directing it to an empty folder - I got the feeling of slight increase
    in performances)
    My list on howto speed up iDVD Slightly - might also applie on iMovie.
    *Speed up iDVD*
    To speed up iDVD
    TO GET IT TO WORK SLIGHTLY FASTER
    • Minimum of 25Gb free space on Start-Up hard disk - if less than 5Gb slow and unstable - less than 1Gb might even not start.
    • Choise of encoding method will give very different productions speeds. On my d-G5 2GHz
    *Professional Quality (movies + menus up to 120 min.)* - BEST
    Takes about 2 x times the other ones - but if quality is of essence
    (Quality might be as good as or even better for movies under 60 minutes - by using Best Performances BUT not for movies up to 120 minutes)
    2 hour movie + menu = about 4 hours to encode at it’s best on my system
    *Best Performances (movies + menus less than 60 min.)* - High quality on final DVD
    1 hour including menu = about 1 hour to encode
    *High Quality* (in iDVD08 or 09) / Best Quality (in iDVD6) *(movies + menus up to 120 min.)* - slightly lower quality than above
    2 hours including menu = about 2 hour to encode
    • Use an as simple DVD-menu possibly without any animation at all. This reduces processing speed dramatically. I use ”Old Theme - and Brushed Metal” and animation turned off.
    • An as fast Mac and as many cores/CPUs possibly. My PowerMac G5 has two CPUs and iDVD uses about 120% = use more than only one CPU/Core. How many it can address I don’t know (anyone ? )
    • If possibly - Use two internally e-Sata drives - Drive access takes a great deal of time
    else FW-800 or FW-400 or USB2 or network storage (slowest and near to useless)
    to work on one (internal, boot, Mac OS, Start-up hard disk - will be BAD - and slow
    Normally my d-G5 2GHz takes about 2 x movie material when iDVD and Mac OS on one internal HD and material is on the other internal one.
    Now with material on an external USB2-drive and an external Lacie FW-400 as Start-up drive material of about 1.5h will need about 4-6 hours to get encoded and burned to DVD.
    Choise and use of hard disks is essential.
    • I guess that a Solid State Disks might improve speed
    • No other programs running in BackGround eg EnergySaver, Internet, AirPort, Bluetooth etc.
    • Don’t let HD spinn down or be turned off (in EnergySave)
    • Move hard disks that are not to be used to Trash - To be disconnected/turned off
    • Goto Spotlight and set the rest of them under Integrity (not to be scanned)
    • Set screensaver to a folder without any photo - then make an active corner (up right for me) and set
    pointer to this - turns on screen saver - to show that it has nothing to show
    • If Mac with only place for one internal hard disk. Then I would try to use an external FW (Mac OS Extended) one as Start-Up hard disk and store material on the internal one.
    eg iMac or ProBook or alike.
    from Karsten -
    • I assume that resolution and codec of source is another factor ... scaling (e.g. 1280x720 to 720x576 = that is an 'un-even' calculation). or, a difference in speed reg. to h264, dv-stream or aic as input ....
    Yours Bengt W

  • "EMPTY" Virtual Circuits causes the dispatcher proces D000 use 100% CPU

    (29th April)
    SQL*Plus: Release 10.2.0.1.0 - Production on Wed Apr 29 14:59:56 2009
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, Data Mining and Real Application Testing options
    Could someone please indicates why the D000 process uses 100% cpu while no XDB action seems to be running? Whe are not using shared server (besides the XML DB usage) and the only value for the dispatcher parameter in the init<SID>.ora = (PROTOCOL=TCP) (SERVICE=<SID>XDB).
    update (30th april)
    When I lookup the virtual circuits I notice 2 VC without server and waiter address and without session info.
    GERE@ARG_DV8>
    # SELECT RAWTOHEX(C.CIRCUIT), RAWTOHEX(C.SERVER) SRV, RAWTOHEX(C.WAITER)WTR,
    2 D.NAME,
    3 S1.NAME,
    4 S.SID,
    5 S.SERIAL#,
    6 C.STATUS,
    7 C.QUEUE,
    8 C.MESSAGES,
    9 C.BYTES
    10 FROM V$CIRCUIT C, V$DISPATCHER D, V$SHARED_SERVER S1, V$SESSION S
    11 WHERE C.DISPATCHER = D.PADDR(+) AND C.SERVER = S1.PADDR(+) AND
    12 C.SADDR = S.SADDR(+)
    13 /
    CIRCUIT SRV WTR NAME NAME SID SERIAL# STATUS QUEUE MESSAGES BYTES
    C0000002398456C0 00 00 D000 NORMAL NONE 6 261
    C000000239840DC0 00 00 D000 NORMAL NONE 7 280
    2 rows selected.
    The SADDR is empty also.
    GERE@ARG_DV8>
    # SELECT SADDR, CIRCUIT, DISPATCHER, SERVER, SUBSTR(QUEUE,1,8) "QUEUE", WAITER
    2 FROM V$CIRCUIT;
    SADDR CIRCUIT DISPATCHER SERVER QUEUE WAITER
    00 C000000239840DC0 C000000214C05FB8 00 NONE 00
    00 C0000002398456C0 C000000214C05FB8 00 NONE 00
    2 rows selected.
    A lsnrctl services shows 2 current
    Service "ARG_DV8XDB" has 1 instance(s).
    Instance "ARG_DV8", status READY, has 1 handler(s) for this service...
    Handler(s):
    "D000" established:58903 refused:0 current:2 max:2046 state:ready
    DISPATCHER <machine: leo, pid: 5672>
    (ADDRESS=(PROTOCOL=tcp)(HOST=leo.argenta.be)(PORT=53044))
    Stop and start of the listener doesn't solve this problem but killing the unix process will do. When I killed the D000 proces a new dispatcher is started (does pmon do this?) and the current shows 0. This workaround is fine on the DVL machine but no sollution on a production DB :-)
    Kind regards,
    Rene
    Edited by: Rene Geilings on Apr 30, 2009 2:28 AM

    By the way... you just could be unlucky hitting a very rare situation that caused the phenomenon decribed by you. Deamon processes also could arise due too standard JDBC, ODBC or other connection methods. As long as you don't provide Oracle Support with a SR, you will not know if it is actually XDB related or not.
    If I would implement XDB functionality in a production system than at least I would:
    a) disable automatic memory management by setting SGA parameters manually
    b) set the large_pool_size to a appropriate value to support the shared server processes
    c) tweak dispatcher and shared server processes to match at least values that represent
       the minimum++ needed processes (= a higher value then needed maximum)
    d) set java_pool size to a decent size (250 Mb or higher)
    e) set an appropriate PGA setting to support XML fragment handling
    f) DISABLE autoregistering database functionality with the listener
       (see amongs others "Registering non-default XMLDB HTTP/WebDAV and FTP ports
       on a non-default Oracle Listener port" - http://www.liberidu.com/blog/?p=116)
    g) alter the xdbconfig.xml file with more appropiate timeouts, locking and cache handling.
    h) dedicate a specific listener (aka a a listener not called "LISTENER") for shared server
       connection handling (this for management reasons and specific debugging).
    i) use version 10.2.0.4.0 or 11.1.0.7.0 for production environments (I know that this
       matches your environment)
    j) always enforce that client software matches the database version
       (as in your case 10.2.0.4.0)
    k) keep NLS settings on client and database equal and support a AL32UTF characterset
       (IMHO a minimum requirement on the database side)

  • Scretching sound when using trackpad/cpu

    I've recently (after installing update 10.9.1) started to notice a scretching sound when i'm using the trackpad.
    It sounds like if there is a non-ssd disk in my Macbook Pro scanning the harddisk.
    The sound only occures when the computer is using more CPU then the idle state.
    When i'm typing this message I dont notice it, when using the touchpad to scroll the page.
    I can reproduce the sound when I run the terminal program "yes" which generated load.
    Thats why I believe the sound comes from the CPU.
    Anyone else experiencing the same?

    I have no suggestions for fixing it your self. Since you do have most of the original 1 years warranty left and the 2 year extended warranty you need to take it in and be looked at.
    It is not probably OK to take it in. It is what you need to do.
    Good Luck.

  • High CPU "% User" after update, but no process using much CPU...

    Hi guys,
    since I did the recent system or security update for my Macbook, my computer crashes a lot and freezes. The fans run constantly, and the weirdest thing is, that in my Activity Monitor no program is actually using much CPU capacity.
    BUT, the usage screen below (wih the red and green squares) is showing that the system is running under full capacity. The cause for that is mentioned next to it the user percentage display "% User" shows values between 50 and 90% or so.
    What is causing it, and how can I get rid of it. At the current state I can't even surf the net properly as Firefox and Safari freeze constantly.
    Thanks for you help in advanced.
    A desperate RigoX.....

    Sorry forgot to give the below details.

  • Can I buy final pro using a Mac in one State and then install it in other State using another Mac?

    Can I buy final cut pro x , using  my mac and then install it in other State using another Mac?

    Yes, as long as both Macs meet the system requirements for it.
    (112783)

  • Write an UPdate statement using the logic used in PL/SQL block (oracle 10g)

    Hi All,
    I have written the following PL/SQL block. I want to write an UPDATE statement using the logic used in the following PL/SQL block. can any one please help me out in this regards.
    DECLARE
       v_hoov_fag   gor_gold_post.hoov_flg%TYPE;
       v_b49n          gor_gold_post.b49n%TYPE;
       CURSOR c
       IS
          SELECT bs_id, loyalty_date, loyalty_period, contract_date
            FROM gor_gold_post
           WHERE tariff_code IN (169, 135, 136);
    BEGIN
       FOR rec IN c
       LOOP
          IF    (TRUNC (ADD_MONTHS (rec.loyalty_date, rec.loyalty_period)
                        - SYSDATE) < 304
             OR (    TRUNC (  ADD_MONTHS (rec.loyalty_date, rec.loyalty_period)
                            - SYSDATE
                           ) IS NULL
                 AND (SYSDATE - TO_DATE (rec.contract_date, 'YYYYMMDD')) > 91.2
          THEN
             v_hoov_flg := 1;
          ELSE
             v_hoover_flag := 99;
          END IF;
          IF    (TRUNC (ADD_MONTHS (rec.loyalty_date, rec.loyalty_period)
                        - SYSDATE) < 121.6
             OR (    TRUNC (  ADD_MONTHS (rec.loyalty_date, rec.loyalty_period)
                            - SYSDATE
                           ) IS NULL
                 AND (SYSDATE - TO_DATE (rec.contract_date, 'YYYYMMDD')) > 91.2
          THEN
             v_b49n := 1;
          ELSE
             v_b49n := 99;
          END IF;
          UPDATE gor_gold_post
             SET hoov_flg = v_hoov_flg,
                 b49n = v_b49n
           WHERE bs_id = rec.bs_id AND tariff_code IN (169, 135, 136);
          COMMIT;
       END LOOP;
    END;Thank you,

    Using case statement.
    UPDATE gor_gold_post
       SET hoov_flag = CASE WHEN TRUNC (ADD_MONTHS (rec.loyalty_date, rec.loyalty_period) - SYSDATE) < 304
                                   OR
                                   (TRUNC (ADD_MONTHS (rec.loyalty_date, rec.loyalty_period) - SYSDATE) IS NULL
                                AND (SYSDATE - TO_DATE (rec.contract_date, 'YYYYMMDD')) > 91.2)
                           THEN 1
                           ELSE 99
                         END,
           b49n      = CASE WHEN TRUNC (ADD_MONTHS (rec.loyalty_date, rec.loyalty_period) - SYSDATE) < 121.6
                             OR
                             (TRUNC (ADD_MONTHS (rec.loyalty_date, rec.loyalty_period) - SYSDATE) IS NULL
                                AND (SYSDATE - TO_DATE (rec.contract_date, 'YYYYMMDD')) > 91.2)
                           THEN 1
                           ELSE 99
                         END
    WHERE tariff_code IN (169, 135, 136);Note: Code not tested.

  • Import statement using DATA BUFFER

    Hi All,
    I am using RFC enabled FM using STARTING NEW TASK, We cannot import data from FM back to the program when we use this statement. So I am exporting data into DATA BUFFER in the FM and trying to import data in the main program. Can you please tell me how can I import data from SHARED MEMORY, Below is my code.
    call function 'YPMLR_SITEBAL_DETAILS'
        starting new task 'ID'
        exporting
          s_cyl       = s_cyl-low
          s_lifnr     = s_lifnr-low
          s_lstyp     = s_lstyp-low
        tables
          s_zlocn     = lt_zlocn
          gt_zmlr_mld = gt_zmlr_mld
          gt_zmlr_lp  = gt_zmlr_lp
          gt_zmlr_mlp = gt_zmlr_mlp
          gt_zmc_loc  = gt_zmc_loc.
    "IMPORT e_rand_no TO e_rand_no from MEMORY ID 'RAND'.
    Here is the export statement used in FM,
    EXPORT e_rand_no FROM e_rand_no  TO DATA BUFFER XSTR.

    Hi,
    Check this link for Export to database instead of memory..
    http://help.sap.com/abapdocu/en/ABAPEXPORT_DATA_CLUSTER_MEDIUM.htm
    Import from database instead of memory
    http://help.sap.com/abapdocu/en/ABAPIMPORT_MEDIUM.htm

  • Discoveryd process uses 100% CPU - Safari Can't find the server

    Hello
    Since upgrading to Yosemite, I lose connection to the internet 2 or 3 times a day. (Outlook goes offline at the same time)
    This is with a wired connection. (Wi-Fi is turned off)
    Safari gives me the "Safari Can't Find the Server" message.
    Restarting the computer solves the issue temporarily.
    While I'm unable to connect to the internet, Activity Monitor shows a process named "discoveryd" that uses 100% CPU.
    Force quitting this process gives me back access to the internet instantly. Unfortunately, I suffered a kernel panic (auto restart) a few minutes after force quitting discoveryd. I'm not 100% sure those 2 are related but it would be an odd coincidence as I never experienced had a single kernel on that system. Haven't tried force quitting that process since.
    I'm using this iMac in a work environment. (Connected to a windows file server and exchange)
    This issue has been happening 2-3 times a day since the day I upgraded to Yosemite.
    Any pointers on what could fix this issue ?
    Thanks

    Start time: 10:04:31 11/11/14
    Model Identifier: iMac11,3
    System Version: OS X 10.10 (14A389)
    Kernel Version: Darwin 14.0.0
    Time since boot: 1:39
    SATA
       WDC WD1001FALS-40Y6A0                  
    USB
       USB-PS/2 Optical Mouse (Logitech Inc.)
    Diagnostic reports
       2014-10-30 Adobe InDesign CC 2014 hang
       2014-10-30 Adobe InDesign CS6 hang
       2014-10-30 Adobe InDesign CS6 crash
       2014-10-30 FileMaker Pro hang x5
       2014-10-30 Finder crash* x2
       2014-10-30 Finder hang
       2014-10-30 Microsoft Outlook hang
       2014-10-30 iTunes hang
       2014-10-31 Adobe InDesign CC 2014 hang
       2014-11-04 Adobe InDesign CC 2014 crash x2
       2014-11-04 Adobe InDesign CC 2014 hang
       2014-11-04 Adobe InDesign CS6 crash x2
       2014-11-04 Microsoft Excel hang
       2014-11-05 Adobe InDesign CS6 hang
       2014-11-05 FileMaker Pro hang
       2014-11-10 Adobe InDesign CC 2014 hang
       2014-11-10 FileMaker Pro hang
       2014-11-11 Adobe Illustrator hang
        * Code injection
    Log
       Nov  5 08:25:33 ** GPU Hardware VM is disabled (multispace: disabled, page table updates with DMA: disabled)
       Nov  5 10:07:01 process discoveryd[49] thread 1190 caught burning CPU! It used more than 50% CPU (Actual recent usage: 82%) over 180 seconds. thread lifetime cpu usage 91.907001 seconds, (77.250009 user, 14.656992 system) ledger info: balance: 90001960650 credit: 91780798965 debit: 1778838315 limit: 90000000000 (50%) period: 180000000000 time since last refill (ns): 109240779280
       Nov  5 10:09:03 ** GPU Hardware VM is disabled (multispace: disabled, page table updates with DMA: disabled)
       Nov  5 11:46:47 process discoveryd[49] thread 1256 caught burning CPU! It used more than 50% CPU (Actual recent usage: 99%) over 180 seconds. thread lifetime cpu usage 91.591946 seconds, (75.959886 user, 15.632060 system) ledger info: balance: 90000109700 credit: 91486467544 debit: 1486357844 limit: 90000000000 (50%) period: 180000000000 time since last refill (ns): 90105095085
       Nov  5 11:54:53 PM notification timeout (pid 275, Creative Cloud)
       Nov  5 11:54:53 PM notification timeout (pid 344, Adobe CEF Helper)
       Nov  5 11:54:53 PM notification timeout (pid 343, Adobe CEF Helper)
       Nov  5 12:35:03 jnl: b(1, 2): replay_journal: from: 57934848 to: 61127168 (joffset 0x1721c000)
       Nov  5 12:35:03 jnl: b(1, 2): journal replay done.
       Nov  5 12:38:37 jnl: b(1, 2): replay_journal: from: 61127168 to: 67488768 (joffset 0x1721c000)
       Nov  5 12:38:37 jnl: b(1, 2): journal replay done.
       Nov  5 12:38:40 ** GPU Hardware VM is disabled (multispace: disabled, page table updates with DMA: disabled)
       Nov  5 13:26:28 process mdworker32[357] thread 8766 caught burning CPU! It used more than 85% CPU (Actual recent usage: 86%) over 40 seconds. thread lifetime cpu usage 81.048638 seconds, (76.580865 user, 4.467773 system) ledger info: balance: 34001309838 credit: 80940733771 debit: 46939423933 limit: 34000000000 (85%) period: 40000000000 time since last refill (ns): 39339579198 [fatal violation]
       Nov  5 14:26:53 PM notification timeout (pid 231, Creative Cloud)
       Nov  5 14:26:53 PM notification timeout (pid 325, Adobe CEF Helper)
       Nov  5 14:26:53 PM notification timeout (pid 326, Adobe CEF Helper)
       Nov  5 14:45:49 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov  5 14:45:49 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov  5 14:47:27 process discoveryd[49] thread 1023 caught burning CPU! It used more than 50% CPU (Actual recent usage: 99%) over 180 seconds. thread lifetime cpu usage 91.572722 seconds, (77.540749 user, 14.031973 system) ledger info: balance: 90015163759 credit: 91483527972 debit: 1468364213 limit: 90000000000 (50%) period: 180000000000 time since last refill (ns): 90121915160
       Nov  5 15:13:33 ** GPU Hardware VM is disabled (multispace: disabled, page table updates with DMA: disabled)
       Nov  6 08:25:36 ** GPU Hardware VM is disabled (multispace: disabled, page table updates with DMA: disabled)
       Nov  6 11:59:36 PM notification timeout (pid 286, Creative Cloud)
       Nov  6 11:59:36 PM notification timeout (pid 355, Adobe CEF Helper)
       Nov  6 11:59:36 PM notification timeout (pid 356, Adobe CEF Helper)
       Nov  6 12:29:24 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov  6 12:29:24 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov  6 12:29:24 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov  6 12:29:24 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov  6 12:29:24 smbsmb2_sm2_b_parse_smchabnge_no_tipfary: ssmb_er_chq_replya failngeed_n ot6if0
       Nov  6 12:29:24 y: smb_rq_reply failed 60
       Nov  6 12:29:24 smb2_ssmmb2_b_spmabr_sparsee_c_hancgeh_naotinfgy: smb_rq_re_epnlyoti failfedy :60 sm
       Nov  6 12:29:24 b_rq_reply failed 60
       Nov  6 12:29:24 rs failed Qsmumber2b_sy m_Inrqfbo __pa60rr
       Nov  6 12:29:24 rse_change_notify: smb_rq_reply failed 60
       Nov  6 12:29:24 ply failed 60smb2_smb_parse_change
       Nov  6 12:29:24 _notify: smsmb_rq_reply failb2_ed smb_6parse_0
       Nov  6 12:29:24 ply failed smb2_smb_pa60
       Nov  6 12:29:24 rse_change_nsmb2otif_smy:b_ spmb_rq_reply failedars e_c60han
       Nov  6 12:29:24 ge_notify: smb_smb2_smb_parse_chrqange__repnotify: smb_rly fq_ailed reply failed 60
       Nov  6 12:29:24 smb2_smb_parssmb2_e_smbchange_pa_nrsote_chifany:ge _nosmb_tifrq_y:re smplb_y rq_fareilply failed 60
       Nov  6 12:29:24 y failed 60
       Nov  6 12:29:24 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov  6 12:29:24 q_reply failed 60
       Nov  6 12:29:24 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov  6 12:29:24 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov  6 12:29:24 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov  6 14:01:02 process discoveryd[49] thread 1259 caught burning CPU!; EXC_RESOURCE supressed due to audio playback
       Nov  6 15:49:49 ** GPU Hardware VM is disabled (multispace: disabled, page table updates with DMA: disabled)
       Nov  6 16:10:23 process Adobe InDesign C[435] caught causing excessive wakeups. Observed wakeups rate (per sec): 309; Maximum permitted wakeups rate (per sec): 150; Observation period: 300 seconds; Task lifetime number of wakeups: 45011
       Nov  7 08:25:38 ** GPU Hardware VM is disabled (multispace: disabled, page table updates with DMA: disabled)
       Nov 10 09:28:46 process discoveryd[49] thread 1195 caught burning CPU! It used more than 50% CPU (Actual recent usage: 99%) over 180 seconds. thread lifetime cpu usage 152.284113 seconds, (127.648543 user, 24.635570 system) ledger info: balance: 90002963251 credit: 152063056684 debit: 62060093433 limit: 90000000000 (50%) period: 180000000000 time since last refill (ns): 90142287445
       Nov 10 09:42:09 ** GPU Hardware VM is disabled (multispace: disabled, page table updates with DMA: disabled)
       Nov 10 11:20:45 process discoveryd[49] thread 1182 caught burning CPU! It used more than 50% CPU (Actual recent usage: 99%) over 180 seconds. thread lifetime cpu usage 150.526060 seconds, (126.552866 user, 23.973194 system) ledger info: balance: 90000111985 credit: 150369654672 debit: 60369542687 limit: 90000000000 (50%) period: 180000000000 time since last refill (ns): 90164134478
       Nov 10 12:14:06 PM notification timeout (pid 261, Creative Cloud)
       Nov 10 12:14:06 PM notification timeout (pid 332, Adobe CEF Helper)
       Nov 10 12:14:06 PM notification timeout (pid 333, Adobe CEF Helper)
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 y failed 60
       Nov 10 12:43:27 failed mb60
       Nov 10 12:43:27 smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:43:27 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 12:46:06 process WindowServer[121] caught causing excessive wakeups. EXC_RESOURCE supressed due to audio playback
       Nov 10 12:49:29 jnl: b(1, 2): replay_journal: from: 27704832 to: 35355648 (joffset 0x1721c000)
       Nov 10 12:49:29 jnl: b(1, 2): journal replay done.
       Nov 10 12:54:05 jnl: b(1, 2): replay_journal: from: 35355648 to: 40313344 (joffset 0x1721c000)
       Nov 10 12:54:05 jnl: b(1, 2): journal replay done.
       Nov 10 12:54:08 ** GPU Hardware VM is disabled (multispace: disabled, page table updates with DMA: disabled)
       Nov 10 14:31:43 PM notification timeout (pid 232, Creative Cloud)
       Nov 10 14:31:43 PM notification timeout (pid 327, Adobe CEF Helper)
       Nov 10 14:31:43 PM notification timeout (pid 324, Adobe CEF Helper)
       Nov 10 15:07:47 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 15:07:47 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 15:07:47 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 15:07:47 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 15:07:47 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 15:07:47 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 15:07:47 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 15:07:47 : smb_rq_reply failesmbd 2_smb_60
       Nov 10 15:07:47 parse_change_notify: smb_rq_reply failed 60
       Nov 10 15:07:47 tify: smb_rq_reply failed 60
       Nov 10 15:07:47 smb2_smb_parse_change_nsotify:mb2 sm_b_rq_reply sfailmed b60
       Nov 10 15:07:47 _parse_change_notify: smbsmb2_rq__rsepmb_parsly failee_d ch60ange_notify
       Nov 10 15:07:47 : smb_rq_reply failed 60
       Nov 10 15:07:47 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 15:07:47 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 15:07:47 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 15:47:46 process discoveryd[49] thread 1013 caught burning CPU! It used more than 50% CPU (Actual recent usage: 99%) over 180 seconds. thread lifetime cpu usage 153.503446 seconds, (128.774521 user, 24.728925 system) ledger info: balance: 90007455004 credit: 153327303891 debit: 63319848887 limit: 90000000000 (50%) period: 180000000000 time since last refill (ns): 90099512937
       Nov 11 08:25:38 ** GPU Hardware VM is disabled (multispace: disabled, page table updates with DMA: disabled)
       Nov 11 09:38:05 process Adobe InDesign C[553] caught causing excessive wakeups. Observed wakeups rate (per sec): 283; Maximum permitted wakeups rate (per sec): 150; Observation period: 300 seconds; Task lifetime number of wakeups: 45017
       Nov 10 14:31:43 PM notification timeout (pid 327, Adobe CEF Helper)
       Nov 10 14:31:43 PM notification timeout (pid 324, Adobe CEF Helper)
       Nov 10 14:31:43 com.apple.dpd: Service exited with abnormal code: 75
       Nov 10 15:07:47 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 15:07:47 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 15:07:47 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 15:07:47 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 15:07:47 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 15:07:47 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 15:07:47 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 15:07:47 : smb_rq_reply failesmbd 2_smb_60
       Nov 10 15:07:47 parse_change_notify: smb_rq_reply failed 60
       Nov 10 15:07:47 tify: smb_rq_reply failed 60
       Nov 10 15:07:47 smb2_smb_parse_change_nsotify:mb2 sm_b_rq_reply sfailmed b60
       Nov 10 15:07:47 _parse_change_notify: smbsmb2_rq__rsepmb_parsly failee_d ch60ange_notify
       Nov 10 15:07:47 : smb_rq_reply failed 60
       Nov 10 15:07:47 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 15:07:47 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 15:07:47 smb2_smb_parse_change_notify: smb_rq_reply failed 60
       Nov 10 15:47:46 process discoveryd[49] thread 1013 caught burning CPU! It used more than 50% CPU (Actual recent usage: 99%) over 180 seconds. thread lifetime cpu usage 153.503446 seconds, (128.774521 user, 24.728925 system) ledger info: balance: 90007455004 credit: 153327303891 debit: 63319848887 limit: 90000000000 (50%) period: 180000000000 time since last refill (ns): 90099512937
       Nov 10 16:47:01 com.apple.WebKit.Networking.UUID: Service exited with abnormal code: 1
       Nov 11 08:25:37 com.apple.Kerberos.kdc: Service exited with abnormal code: 1
       Nov 11 08:25:38 ** GPU Hardware VM is disabled (multispace: disabled, page table updates with DMA: disabled)
       Nov 11 08:56:36 com.apple.dpd: Service exited with abnormal code: 75
       Nov 11 09:38:05 process Adobe InDesign C[553] caught causing excessive wakeups. Observed wakeups rate (per sec): 283; Maximum permitted wakeups rate (per sec): 150; Observation period: 300 seconds; Task lifetime number of wakeups: 45017
    CPU per process: com.apple.WebKit (UID 501) is using 41.2  %
    Daemons
       com.apple.installer.osmessagetracing
       com.microsoft.office.licensing.helper
       com.adobe.fpsaud
    Agents
       com.adobe.CS4ServiceManager
       com.adobe.AdobeCreativeCloud
       com.adobe.ARM.UUID
       com.adobe.ARM.UUID
       com.apple.Safari
       com.adobe.ARM.UUID
       com.google.keystone.user.agent
       com.apple.AirPortBaseStationAgent
    App extensions
       com.apple.InternalFiltersXPC
    Contents of /Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist (checksum 461455494)
       <?xml version="1.0" encoding="UTF-8"?>
       <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
       <plist version="1.0">
       <dict>
        <key>Label</key>
        <string>com.adobe.AdobeCreativeCloud</string>
        <key>Program</key>
        <string>/Applications/Utilities/Adobe Creative Cloud/ACC/Creative Cloud.app/Contents/MacOS/Creative Cloud</string>
        <key>ProgramArguments</key>
        <array>
        <string>/Applications/Utilities/Adobe Creative Cloud/ACC/Creative Cloud.app/Contents/MacOS/Creative Cloud</string>
        <string>--showwindow=false</string>
              <string>--onOSstartup=true</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
       </dict>
       </plist>
    Contents of Library/LaunchAgents/com.adobe.AAM.Updater-1.0.plist (checksum 4071182229)
       <?xml version="1.0" encoding="UTF-8"?>
       <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
       <plist version="1.0">
        <dict>
         <key>Label</key>
         <string>com.adobe.AAM.Scheduler-1.0</string>
         <key>Program</key>
         <string>/Library/Application Support/Adobe/OOBE/PDApp/UWA/UpdaterStartupUtility</string>
         <key>ProgramArguments</key>
         <array>
            <string>/Library/Application Support/Adobe/OOBE/PDApp/UWA/UpdaterStartupUtility</string>
            <string>-mode=scheduled</string>
         </array>
         <key>StartCalendarInterval</key>
         <dict>
           <key>Minute</key>
           <integer>0</integer>
           <key>Hour</key>
           <integer>2</integer>
         </dict>
        </dict>
       </plist>
    Contents of Library/LaunchAgents/com.adobe.ARM.UUID.plist (checksum 394026997)
       <?xml version="1.0" encoding="UTF-8"?>
       <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
       <plist version="1.0">
       <dict>
        <key>Label</key>
        <string>com.adobe.ARM.UUID</string>
        <key>ProgramArguments</key>
        <array>
        <string>/Applications/Adobe Reader.app/Contents/MacOS/Updater/Adobe Reader Updater Helper.app/Contents/MacOS/Adobe Reader Updater Helper</string>
        <string>semi-auto</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
        <key>StartInterval</key>
        <integer>12600</integer>
       </dict>
       </plist>
    Contents of Library/LaunchAgents/com.adobe.ARM.UUID.plist (checksum 4116814193)
       <?xml version="1.0" encoding="UTF-8"?>
       <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
       <plist version="1.0">
       <dict>
        <key>Label</key>
        <string>com.adobe.ARM.UUID</string>
        <key>ProgramArguments</key>
        <array>
        <string>/Applications/Adobe Acrobat XI Pro/Adobe Acrobat Pro.app/Contents/MacOS/Updater/Adobe Acrobat Updater Helper.app/Contents/MacOS/Adobe Acrobat Updater Helper</string>
        <string>semi-auto</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
        <key>StartInterval</key>
        <integer>12600</integer>
       </dict>
       </plist>
    Contents of Library/LaunchAgents/com.adobe.ARM.UUID.plist (checksum 926752576)
       <?xml version="1.0" encoding="UTF-8"?>
       <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
       <plist version="1.0">
       <dict>
        <key>Label</key>
        <string>com.adobe.ARM.UUID</string>
        <key>ProgramArguments</key>
        <array>
        <string>/Applications/Adobe Acrobat X Pro/Adobe Acrobat Pro.app/Contents/MacOS/Updater/Adobe Acrobat Updater Helper.app/Contents/MacOS/Adobe Acrobat Updater Helper</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
        <key>StartInterval</key>
        <integer>12600</integer>
       </dict>
       </plist>
    Contents of Library/LaunchAgents/com.apple.SafariBookmarksSyncer.plist (checksum 4209634474)
       <?xml version="1.0" encoding="UTF-8"?>
       <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
       <plist version="1.0">
       <dict>
        <key>Label</key>
        <string>com.apple.Safari</string>
        <key>LimitLoadToSessionType</key>
        <string>Aqua</string>
        <key>ProgramArguments</key>
        <array>
        <string>/Applications/Safari.app/Contents/SafariSyncClient.app/Contents/MacOS/S afariSyncClient</string>
        <string>--sync</string>
        <string>com.apple.Safari</string>
        <string>--entitynames</string>
        <string>com.apple.bookmarks.Bookmark,com.apple.bookmarks.Folder</string>
        </array>
        <key>RunAtLoad</key>
        <false/>
        <key>ThrottleInterval</key>
        <integer>60</integer>
        <key>WatchPaths</key>
        <array>
        <string>/Users/USER/Library/Safari/Bookmarks.plist</string>
        </array>
       </dict>
       ...and 1 more line(s)
    Contents of Library/LaunchAgents/com.google.keystone.agent.plist (checksum 64800286)
       <?xml version="1.0" encoding="UTF-8"?>
       <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
       <plist version="1.0">
       <dict>
        <key>Label</key>
        <string>com.google.keystone.user.agent</string>
        <key>LimitLoadToSessionType</key>
        <string>Aqua</string>
        <key>ProgramArguments</key>
        <array>
         <string>/Users/USER/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bu ndle/Contents/Resources/GoogleSoftwareUpdateAgent.app/Contents/MacOS/GoogleSoftw areUpdateAgent</string>
         <string>-runMode</string>
         <string>ifneeded</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
        <key>StartInterval</key>
        <integer>3523</integer>
        <key>StandardErrorPath</key>
        <string>/dev/null</string>
        <key>StandardOutPath</key>
        <string>/dev/null</string>
       </dict>
       </plist>
    Bad plists
       Library/Preferences/com.apple.iphotomosaic.plist
    Listeners
       launchd: afpovertcp
       launchd: afpovertcp
       launchd: microsoft-ds
       launchd: ssh
       launchd: microsoft-ds
       launchd: ssh
       kdc: kerberos
    User login items
       Microsoft Outlook
       - /Applications/Microsoft Office 2011/Microsoft Outlook.app
       TransmitMenu
       - /Applications/Transmit.app/Contents/MacOS/TransmitMenu.app
       ClipMenu
       - /Applications/ClipMenu.app
       Dept
       - /Volumes/Dept
       Public
       - /Volumes/Public
       Apps
       - /Volumes/Apps
    Restricted files: 4584
    Lockfiles: 99
    Elapsed time (s): 352

  • Finder and loginwindow use 100% cpu with 10.6.8

    I recently installed the patch to OS X 10.6.8 and now the finder is very unstable and uses 100% cpu and the loginwindow uses 100% cpu also.  Yes I have Parallels 6 on this machine but I already "un-checked" the "show windows applications in doc" option which is the recommended solution.  However, this did not fix the problem.  I do not know how to determine what actual process is causing this finder / loginwindow issue.  I very much appreciate if anyone has suggestion how to fix this problem. 
    This is on a mid-2011 MacBookPro.
    thank you.

    TBauer, I had the same problem with 10.6.8 using 100% of the CPU with Parallels 6 installed.  The following steps solved this problem for me:
    0.  Take a screen shot of your Dock if you wish to remember it as currently set
    1. Launch Activity Monitor and click on the CPU column so you can see Dock using the CPU
    2.  Move   ///Users/ ...  /Library/Preferences/com.apple.dock.plist to the trash
    3.  Click on Dock and click on Quit Process to stop the Dock
    OS X will then rebuild the default Dock
    4.  Put the items back in the Dock that you want
    That solved the problem for me yesterday morning.  I've launched Parallels 6 several times now and moved the machine from my work network to home and the 100% CPU problem hasn't returned.
    Hope that works for you, too!
    I don't think using the combo updater will solve the problem.  The problem appears to be a .plist that is generated with OS X 10.6.7 and earlier that contains icons of a larger than Apple documented size causes the CPU looping.  Rebuilding the dock.plist under OS X 10.6.8 appears to solve the problem.
    Parallels has issued a knowledge bulletin saying they are looking into the problem.  On their web site they have another approach involving moving the offending icon out of the dock to solve the problem.  I like my solution better but theirs works, too.

  • Converting a delete statement using VPD policies and context

    Hello,
    I'm trying to convert a delete statement in a update statement using VPD policies and context.
    +/* Supose the user 'user1' already exists. This is an application user */+
    conn user1/pwd
    create table user1.test_a (
    id                number(4),
    description       varchar2(100),
    deleted           number(1)
    +);+
    alter table user1.test_a add constraint test_a_pk primary key (id);
    insert into user1.test_a (1, 'abc', 0);
    insert into user1.test_a (2, 'def', 0);
    commit;
    I'd like to convert each physical deletion into a logical deletion: statements like "delete from user1.test_a where id = 1" must be converted into "update user1.test_a set deleted = 1 where id = 1".
    I've found the following way: I will create a policy to avoid physical deletion. Additionally, the policy function should update the deletion flag too.
    conn user1/pwd
    +/* Create context package */+
    create or replace package user1.pkg_security_context is
    procedure p_set_ctx(
    i_test_a_id      in   user1.test_a.id   %type
    +);+
    end;
    +/+
    create or replace package body user1.pkg_security_context is
    procedure p_set_ctx (
    i_test_a_id      in   user1.test_a.id   %type
    +) is+
    begin
    dbms_session.set_context( 'user1_ctx', 'test_a_id', i_test_a_id );
    end;
    end;
    +/+
    show errors
    +/* Create trigger to set the context before deletion */+
    create or replace trigger user1.test_a_bef_trg
    before delete on user1.test_a
    for each row
    declare
    pragma autonomous_transaction;
    begin
    -- only commits the preceding update, not the delete that fired the trigger.
    commit;
    user1.pkg_security_context.p_set_ctx( :old.id );
    end;
    +/+
    show errors
    create context user1_ctx using user1.pkg_security_context;
    +/* Policy function */+
    create or replace function user1.f_policy_chk_dels (
    object_schema in   varchar2,
    object_name   in   varchar2
    +) return varchar2+
    is
    out_string                 varchar2(400)   default '1=2 ';
    +/*+
    * out_string is the return value.
    *  - 'WHERE 1=2' means 'nothing to access'
    begin
    if ( loc_logged_usr_authorized > 0 ) then
    +/*+
    * Set the flag deleted to 1
    update user1.test_a set deleted = 1 where id = sys_context( 'user1_ctx', 'test_a_id' );
    out_string := out_string || 'or 1=1 ';
    end if;
    return out_string;
    end;
    +/+
    show errors
    +/*+
    * Create policy
    begin
    dbms_rls.add_policy(
    object_schema   => 'user1'                   ,
    object_name     => 'test_a'                  ,
    policy_name     => 'policy_chk_dels'         ,
    function_schema => 'user1'                   , -- function schema
    policy_function => 'f_policy_chk_dels'       , -- policy function
    statement_types => 'DELETE'
    +);+
    end;
    +/+
    When I try to delete a record of the table test_a:
    conn user1/pwd
    SQL> delete from ilogdia.oplsimulaciones sim       where sim.id = 9999;
    +0 rows deleted+
    No rows has been deleted, but the update stmt does not work. That means, the "deleted" flag has not been updated.
    Any ideas?
    Thank you in advance.
    Marco A. Serrano
    Edited by: albrotar on Oct 15, 2012 8:42 AM
    Edited by: albrotar on Oct 15, 2012 8:42 AM
    Edited by: albrotar on Oct 15, 2012 8:43 AM

    The policy function is applied once per statement execution. The policy function executes first and the UPDATE statement, presumably, updates no rows because the context is not yet populated. The row-level populates the context (I'm assuming that your session can even see context values populated by an autonomous transaction-- I would guess it could but I'd have to test that) after the UPDATE statement is already complete. The COMMIT in the row-level trigger is also pointless-- it only applies to changes made by the current autonomous transaction, of which there are none-- it cannot apply to changes made in other autonomous transactions. Declaring the row-level trigger to use autonomous transactions doesn't seem to accomplish anything other than to open the question of whether the values set in the context by the autonomous transaction are visible in the caller's transaction.
    Even if this, somehow, did work, using autonomous transactions would be a very bad idea since Oracle is free to roll-back a partially executed statement (and the work done by its triggers) and re-execute it. Oracle does that with some regularity to maintain write consistency.
    Justin

  • Need to execute Long Insert (6000 characters)statement using dbms_sql.parse

    I built an insert statement which is more than 6000 (six thousand) characters stored into two varchar2 variables. I need to execute the statement using dbms_sql.parse.
    I tryed using dbms_sql.varchar2s variable and having no success.
    Any ideas or examples?
    Thanks
    JK

    6000 chars shouldn't be a problem.
    What do you mean with no success?Did you get any error?
    Any ideas or examples?See this thread
    Re: execute immediate with a string longer than 32767

  • ITunes will uses 100% cpu and will not close in OSX Lion

    When I start up iTunes, after a few minutes, the fan kicks on and Activity Monitor shows that it is using 100% CPU. The fan kicks up and the MBP gets warm. I have to force close to get it to shut down. iTunes match is constantly running, so maybe that has something to do with it?
    I'm not running it in Mini Player mode or anything like that, so I'm not sure what's causing the problem. Any thoughts on how to diagnose it?

    I also have this problem which has been getting worse with recent successive updates of Firefox. As a long-time user and advocate, I am about ready to look for an alternative browser. Firefox will not close and exit properly, requiring direct cancellation through Task Manager; starts up very slowly (often 1 to 2 minutes); and frequently locks up the CPU with 100% of cycles while doing NOTHING; offers to restart crashed sessions, but cannot recover and reload those sessions; will not operate correctly while any other application accesses the internet, like uTorrent. Firefox is set to delete cookies, etc. whenever the session closes, sqlite database is vacuumed regularly, CCleaner regularly wipes remaining accretions, and disk is defragged. Currently running 3.5.5 but will NOT upgrade until this problem is solved since later builds report the same problems. I know several other users who have experienced the same problem and I can no longer automatically recommend Firefox to users and clients. Is anybody paying any attention to this problem? What is being done to address this fault? Why is there no response to the original poster? Is this really a support forum or just a way to preoccupy and distract the users who suffer this malfunction? Wireless 54Mbps connection. No Adobe Flash, QuickTime, MS Silverlight, etc. installed on this machine. Firefox 3.5.5 with the following add-ons:
    Aardvark 3.0
    Adblock Plus 1.2.1
    Adblock Plus: Element Hiding Helper 1.0.6
    Free Download Manager plugin 1.3.4
    Highlighter 0.1.4
    MR Tech Toolkit 6.0.4
    repagination 2006.4.5.1
    Save Complete 1.0.1
    Session Manager 0.6.8.3
    Tab Mix Plus 0.3.8.4
    Unhide Passwords 1.2.5.1
    User Agent Switcher 0.7.2
    Thanks for any help or suggestions.

Maybe you are looking for