SQl query are running slow in comparison to oracle 8i

Hi everybody,
I have two systems one is Oracle 9i on Windows 2000 and
one is Oracle 8i running on Windows 2000. The database structure is the same. When I run the following qry in
Oracle 9i
SELECT COUNT (a.aint_ac_no) AS total_ac_no, adet_int_rate,
SUM (fun_max_cbal_bal (a.aint_ac_no,
a.aint_subsys_cd,
TO_DATE ('30/01/2009', 'DD/MM/YYYY')
) AS balance
FROM domst120 a, domst730 b
WHERE a.aint_interest_slab_cd = b.adet_srno
AND a.aint_subsys_cd = '137'
AND fun_max_cbal_bal (a.aint_ac_no,
a.aint_subsys_cd,
TO_DATE ('30/01/2009', 'DD/MM/YYYY')
) <> 0
AND a.aint_eff_date =
(SELECT MAX (c.aint_eff_date)
FROM domst120 c
WHERE a.aint_bank_cd = c.aint_bank_cd
AND a.aint_branch_cd = c.aint_branch_cd
AND a.aint_bank_cd = '857'
AND a.aint_branch_cd = '6'
AND a.aint_subsys_cd = c.aint_subsys_cd
AND a.aint_ac_no = c.aint_ac_no)
GROUP BY b.adet_int_rate
ORDER BY b.adet_int_rate
it takes 6 min to complete.
the same qry running in Oracle 8i takes 2 seconds
to complete.
The index structure is same in both systems also the tables
were analyzed with compute statistics.

What do you expect?! Oracle 9i and Oracle 8i are different particularly by optimizer cost-based(9i) and rule-based(8i) :)
what about both execution plans?

Similar Messages

  • Parallel hint causes a query to run slower?

    I have an insert...select query where the select is a join between a table with one billion rows (although there is a where clause on an indexed column that restricts it to "only" 300 million), a table with 30 million rows, and a table with about 100,000 rows, where the result is about 20 rows. When I first ran it, it took about 2 hours. I added a Parallel hint, and explain plan showed that it was being used (and v$session showed that I had about 30 additional connections while it ran). but not it takes four hours.
    Is there a reason parallel processing would cause a query to run slower?
    insert /*+ append */ into employees_by_age_group
      pay_plan
    , age_range
    , pay_level
    , fy
    , employee_count
    select /*+ parallel */
           emp.pay_plan
         , to_char(d.min_age) || '-' || to_char(d.max_age) as age_range
         , emp.pay_level
         , pay.fy
         , count(pay.employee_id) as employee_count
    from
      select /*+ index(pay_info pay_info_index_on_site) */
             employee_id
           , extract(year from (dte_ppe_end + 92)) as fy
           , count(employee_id) as num_recs
      from pay_info
      where extract(month from dte_ppe_end) = 10
      and   extract(day from dte_ppe_end) between 14 and 27
      and   substr(pay_type, 1, 1) IN ('A', 'B', 'C')
      and   site like 'Z%'
      group by employee_id, extract(year from (dte_ppe_end + 92))
    ) pay
    join
      select employee_id
           , pay_plan
           , pay_grade
           , pay_step
           , file_date
      from
        select /*+ index(employee_info employee_info_index_on_site) */
               employee_id
             , pay_level
             , file_date
             , max(file_date)
               over (partition by extract(year from (file_date + 61)))
               as last_file_date
        from employee_info
        where site like 'Z%'
      where file_date = last_file_date
    ) emp
    on (
         emp.employee_id = pay.employee_id
         and extract(year from emp.file_date) = pay.fy - 1
    join (
           select employee_id
                , dob
           from (
                  select employee_id
                       , date_birth
                       , row_number() over (partition by employee_id order by date_file desc) as r
                  from employee_birthdates
                  where site like 'Z%'
           where r = 1
         ) dob
    on dob.employee_id = pay.employee_id
    join
                select 20 as min_age, 24 as max_age from dual
      union all select 25 as min_age, 29 as max_age from dual
      union all select 30 as min_age, 34 as max_age from dual
      union all select 35 as min_age, 39 as max_age from dual
      union all select 40 as min_age, 44 as max_age from dual
      union all select 45 as min_age, 49 as max_age from dual
      union all select 50 as min_age, 54 as max_age from dual
      union all select 55 as min_age, 59 as max_age from dual
      union all select 60 as min_age, 64 as max_age from dual
      union all select 65 as min_age, 69 as max_age from dual
      union all select 70 as min_age, 74 as max_age from dual
      union all select 75 as min_age, 79 as max_age from dual
      union all select 80 as min_age, 84 as max_age from dual
      union all select 85 as min_age, 89 as max_age from dual
      union all select 90 as min_age, 94 as max_age from dual
      union all select 95 as min_age, 99 as max_age from dual
    ) d
    group by emp.pay_plan, d.min_age, d.max_age, emp.pay_level, pay.fy;

    Paul - here are three different explain plans
    First, the original one (without the parallel hint):
    INSERT STATEMENT  ALL_ROWS                                              Cost: 26,684,255  Bytes: 114  Cardinality: 1                     
      35 LOAD AS SELECT EMPLOYEES_BY_AGE_GROUP                  
        34 HASH GROUP BY                                                    Cost: 26,684,255  Bytes: 114  Cardinality: 1                 
          33 NESTED LOOPS                                                   Cost: 26,684,254  Bytes: 114  Cardinality: 1               
            14 HASH JOIN                                                    Cost: 26,684,222  Bytes: 108  Cardinality: 1             
              9 MERGE JOIN                                                  Cost: 4,408,803  Bytes: 8,322  Cardinality: 146           
                3 VIEW DONBOT_DBA.                                          Cost: 114,863  Bytes: 29,625,180  Cardinality: 987,506         
                  2 WINDOW SORT PUSHED RANK                                 Cost: 114,863  Bytes: 35,550,216  Cardinality: 987,506       
                    1 TABLE ACCESS FULL TABLE EMPLOYEE_BIRTHDATES           Cost: 108,983  Bytes: 35,550,216  Cardinality: 987,506     
                8 SORT JOIN                                                 Cost: 4,293,940  Bytes: 3,645  Cardinality: 135         
                  7 VIEW DONBOT_DBA.                                        Cost: 4,293,939  Bytes: 3,645  Cardinality: 135       
                    6 SORT GROUP BY                                         Cost: 4,293,939  Bytes: 4,185  Cardinality: 135     
                      5 TABLE ACCESS BY INDEX ROWID TABLE PAY_INFO          Cost: 4,293,938  Bytes: 4,185  Cardinality: 135   
                        4 INDEX RANGE SCAN INDEX PAY_INFO_INDEX_ON_SITE     Cost: 487,124  Cardinality: 402,683,034 
              13 VIEW DONBOT_DBA                                            Cost: 22,275,300  Bytes: 1,160,143,257  Cardinality: 22,747,907           
                12 WINDOW SORT                                              Cost: 22,275,300  Bytes: 841,672,559  Cardinality: 22,747,907         
                  11 TABLE ACCESS BY INDEX ROWID TABLE EMPLOYEE_INFO        Cost: 22,137,046  Bytes: 841,672,559  Cardinality: 22,747,907       
                    10 INDEX RANGE SCAN INDEX EMPLOYEE_INFO_INDEX_ON_SITE   Cost: 50,419  Cardinality: 38,019,281     
            32 VIEW DONBOT_DBA
              31 UNION-ALL           
                15 FAST DUAL  Cost: 2  Cardinality: 1         
                16 FAST DUAL  Cost: 2  Cardinality: 1         
                17 FAST DUAL  Cost: 2  Cardinality: 1         
                18 FAST DUAL  Cost: 2  Cardinality: 1         
                19 FAST DUAL  Cost: 2  Cardinality: 1         
                20 FAST DUAL  Cost: 2  Cardinality: 1         
                21 FAST DUAL  Cost: 2  Cardinality: 1         
                22 FAST DUAL  Cost: 2  Cardinality: 1         
                23 FAST DUAL  Cost: 2  Cardinality: 1         
                24 FAST DUAL  Cost: 2  Cardinality: 1         
                25 FAST DUAL  Cost: 2  Cardinality: 1         
                26 FAST DUAL  Cost: 2  Cardinality: 1         
                27 FAST DUAL  Cost: 2  Cardinality: 1         
                28 FAST DUAL  Cost: 2  Cardinality: 1         
                29 FAST DUAL  Cost: 2  Cardinality: 1         
                30 FAST DUAL  Cost: 2  Cardinality: 1          Next, one with the parallel hint:
    INSERT STATEMENT  ALL_ROWS                                                                              Cost: 26,507,111  Bytes: 114  Cardinality: 1                                       
      51 LOAD AS SELECT EMPLOYEES_BY_AGE_GROUP
        50 PX COORDINATOR                                          
          49 PX SEND QC (RANDOM) PARALLEL_TO_SERIAL SYS.:TQ10005 :Q1005                                     Cost: 26,507,111  Bytes: 114  Cardinality: 1                                 
            48 HASH GROUP BY PARALLEL_COMBINED_WITH_PARENT :Q1005                                           Cost: 26,507,111  Bytes: 114  Cardinality: 1                               
              47 PX RECEIVE PARALLEL_COMBINED_WITH_PARENT :Q1005                                            Cost: 26,507,111  Bytes: 114  Cardinality: 1                             
                46 PX SEND HASH PARALLEL_TO_PARALLEL SYS.:TQ10004 :Q1004                                    Cost: 26,507,111  Bytes: 114  Cardinality: 1                           
                  45 HASH GROUP BY PARALLEL_COMBINED_WITH_PARENT :Q1004                                     Cost: 26,507,111  Bytes: 114  Cardinality: 1                         
                    44 NESTED LOOPS PARALLEL_COMBINED_WITH_PARENT :Q1004                                    Cost: 26,507,111  Bytes: 114  Cardinality: 1                       
                      25 HASH JOIN PARALLEL_COMBINED_WITH_PARENT :Q1004                                     Cost: 26,507,109  Bytes: 108  Cardinality: 1                     
                        17 PX RECEIVE PARALLEL_COMBINED_WITH_PARENT :Q1004                                  Cost: 4,301,500  Bytes: 4,104  Cardinality: 72                   
                          16 PX SEND HASH PARALLEL_TO_PARALLEL SYS.:TQ10003 :Q1003                          Cost: 4,301,500  Bytes: 4,104  Cardinality: 72                 
                            15 HASH JOIN PARALLEL_COMBINED_WITH_PARENT :Q1003                               Cost: 4,301,500  Bytes: 4,104  Cardinality: 72               
                              7 BUFFER SORT PARALLEL_COMBINED_WITH_CHILD :Q1003           
                                6 PX RECEIVE PARALLEL_COMBINED_WITH_PARENT :Q1003                           Cost: 4,293,939  Bytes: 1,809  Cardinality: 67           
                                  5 PX SEND BROADCAST PARALLEL_FROM_SERIAL SYS.:TQ10000                     Cost: 4,293,939  Bytes: 1,809  Cardinality: 67         
                                    4 VIEW DONBOT_DBA.                                                      Cost: 4,293,939  Bytes: 1,809  Cardinality: 67       
                                      3 SORT GROUP BY                                                       Cost: 4,293,939  Bytes: 2,077  Cardinality: 67     
                                        2 TABLE ACCESS BY INDEX ROWID TABLE PAY_INFO                        Cost: 4,293,938  Bytes: 2,077  Cardinality: 67   
                                          1 INDEX RANGE SCAN INDEX PAY_INFO_INDEX_ON_SITE                   Cost: 487,124  Cardinality: 199,756,151 
                              14 VIEW PARALLEL_COMBINED_WITH_PARENT DONBOT_DBA. :Q1003                      Cost: 7,561  Bytes: 29,625,180  Cardinality: 987,506             
                                13 WINDOW SORT PUSHED RANK PARALLEL_COMBINED_WITH_PARENT :Q1003             Cost: 7,561  Bytes: 35,550,216  Cardinality: 987,506           
                                  12 PX RECEIVE PARALLEL_COMBINED_WITH_PARENT :Q1003                        Cost: 7,561  Bytes: 35,550,216  Cardinality: 987,506         
                                    11 PX SEND HASH PARALLEL_TO_PARALLEL SYS.:TQ10002 :Q1002                Cost: 7,561  Bytes: 35,550,216  Cardinality: 987,506       
                                      10 WINDOW CHILD PUSHED RANK PARALLEL_COMBINED_WITH_PARENT :Q1002      Cost: 7,561  Bytes: 35,550,216  Cardinality: 987,506     
                                        9 PX BLOCK ITERATOR PARALLEL_COMBINED_WITH_CHILD :Q1002             Cost: 7,557  Bytes: 35,550,216  Cardinality: 987,506   
                                          8 TABLE ACCESS FULL TABLE PARALLEL_COMBINED_WITH_PARENT EMPLOYEE_BIRTHDATES :Q1002     Cost: 7,557  Bytes: 35,550,216  Cardinality: 987,506 
                        24 BUFFER SORT PARALLEL_COMBINED_WITH_CHILD :Q1004                 
                          23 PX RECEIVE PARALLEL_COMBINED_WITH_PARENT :Q1004                                Cost: 22,205,605  Bytes: 575,504,145  Cardinality: 11,284,395                 
                            22 PX SEND HASH PARALLEL_FROM_SERIAL SYS.:TQ10001                               Cost: 22,205,605  Bytes: 575,504,145  Cardinality: 11,284,395               
                              21 VIEW DONBOT_DBA.                                                           Cost: 22,205,605  Bytes: 575,504,145  Cardinality: 11,284,395             
                                20 WINDOW SORT                                                              Cost: 22,205,605  Bytes: 417,522,615  Cardinality: 11,284,395           
                                  19 TABLE ACCESS BY INDEX ROWID TABLE EMPLOYEE_INFO                        Cost: 22,137,046  Bytes: 417,522,615  Cardinality: 11,284,395         
                                    18 INDEX RANGE SCAN INDEX EMPLOYEE_INFO_INDEX_ON_SITE                   Cost: 50,419  Cardinality: 18,859,958       
                      43 VIEW PARALLEL_COMBINED_WITH_PARENT DONBOT_DBA. :Q1004                              Cost: 32  Bytes: 6  Cardinality: 1                     
                        42 UNION-ALL PARALLEL_COMBINED_WITH_PARENT :Q1004                 
                          26 FAST DUAL PARALLEL_COMBINED_WITH_PARENT :Q1004         Cost: 2  Cardinality: 1                 
                          27 FAST DUAL PARALLEL_COMBINED_WITH_PARENT :Q1004         Cost: 2  Cardinality: 1                 
                          28 FAST DUAL PARALLEL_COMBINED_WITH_PARENT :Q1004         Cost: 2  Cardinality: 1                 
                          29 FAST DUAL PARALLEL_COMBINED_WITH_PARENT :Q1004         Cost: 2  Cardinality: 1                 
                          30 FAST DUAL PARALLEL_COMBINED_WITH_PARENT :Q1004         Cost: 2  Cardinality: 1                 
                          31 FAST DUAL PARALLEL_COMBINED_WITH_PARENT :Q1004         Cost: 2  Cardinality: 1                 
                          32 FAST DUAL PARALLEL_COMBINED_WITH_PARENT :Q1004         Cost: 2  Cardinality: 1                 
                          33 FAST DUAL PARALLEL_COMBINED_WITH_PARENT :Q1004         Cost: 2  Cardinality: 1                 
                          34 FAST DUAL PARALLEL_COMBINED_WITH_PARENT :Q1004         Cost: 2  Cardinality: 1                 
                          35 FAST DUAL PARALLEL_COMBINED_WITH_PARENT :Q1004         Cost: 2  Cardinality: 1                 
                          36 FAST DUAL PARALLEL_COMBINED_WITH_PARENT :Q1004         Cost: 2  Cardinality: 1                 
                          37 FAST DUAL PARALLEL_COMBINED_WITH_PARENT :Q1004         Cost: 2  Cardinality: 1                 
                          38 FAST DUAL PARALLEL_COMBINED_WITH_PARENT :Q1004         Cost: 2  Cardinality: 1                 
                          39 FAST DUAL PARALLEL_COMBINED_WITH_PARENT :Q1004         Cost: 2  Cardinality: 1                 
                          40 FAST DUAL PARALLEL_COMBINED_WITH_PARENT :Q1004         Cost: 2  Cardinality: 1                 
                          41 FAST DUAL PARALLEL_COMBINED_WITH_PARENT :Q1004         Cost: 2  Cardinality: 1                  Finally, one without the parallel hint, and without the index hint on PAY_TABLE:
    INSERT STATEMENT  ALL_ROWS                                              Cost: 23,348,654  Bytes: 114  Cardinality: 1                   
      34 LOAD AS SELECT ARMYMP.EMPLOYEES_BY_AGE                
        33 HASH GROUP BY                                                    Cost: 23,348,654  Bytes: 114  Cardinality: 1               
          32 NESTED LOOPS                                                   Cost: 23,348,653  Bytes: 114  Cardinality: 1             
            13 HASH JOIN                                                    Cost: 23,348,621  Bytes: 108  Cardinality: 1           
              8 MERGE JOIN                                                  Cost: 1,073,202  Bytes: 8,322  Cardinality: 146         
                3 VIEW DONBOT_DBA.                                          Cost: 114,863  Bytes: 29,625,180  Cardinality: 987,506       
                  2 WINDOW SORT PUSHED RANK                                 Cost: 114,863  Bytes: 35,550,216  Cardinality: 987,506     
                    1 TABLE ACCESS FULL TABLE EMPLOYEE_BIRTHDATES           Cost: 108,983  Bytes: 35,550,216  Cardinality: 987,506   
                7 SORT JOIN                                                 Cost: 958,339  Bytes: 3,645  Cardinality: 135       
                  6 VIEW DONBOT_DBA.                                        Cost: 958,338  Bytes: 3,645  Cardinality: 135     
                    5 SORT GROUP BY                                         Cost: 958,338  Bytes: 4,185  Cardinality: 135   
                      4 TABLE ACCESS FULL TABLE PAY_INFO                    Cost: 958,337  Bytes: 4,185  Cardinality: 135 
              12 VIEW DONBOT_DBA.                                           Cost: 22,275,300  Bytes: 1,160,143,257  Cardinality: 22,747,907         
                11 WINDOW SORT                                              Cost: 22,275,300  Bytes: 841,672,559  Cardinality: 22,747,907       
                  10 TABLE ACCESS BY INDEX ROWID TABLE EMPLOYEE_INFO        Cost: 22,137,046  Bytes: 841,672,559  Cardinality: 22,747,907     
                    9 INDEX RANGE SCAN INDEX EMPLOYEE_INFO_UIC              Cost: 50,419  Cardinality: 38,019,281   
            31 VIEW DONBOT_DBA.                                             Cost: 32  Bytes: 6  Cardinality: 1           
              30 UNION-ALL         
                14 FAST DUAL  Cost: 2  Cardinality: 1       
                15 FAST DUAL  Cost: 2  Cardinality: 1       
                16 FAST DUAL  Cost: 2  Cardinality: 1       
                17 FAST DUAL  Cost: 2  Cardinality: 1       
                18 FAST DUAL  Cost: 2  Cardinality: 1       
                19 FAST DUAL  Cost: 2  Cardinality: 1       
                20 FAST DUAL  Cost: 2  Cardinality: 1       
                21 FAST DUAL  Cost: 2  Cardinality: 1       
                22 FAST DUAL  Cost: 2  Cardinality: 1       
                23 FAST DUAL  Cost: 2  Cardinality: 1       
                24 FAST DUAL  Cost: 2  Cardinality: 1       
                25 FAST DUAL  Cost: 2  Cardinality: 1       
                26 FAST DUAL  Cost: 2  Cardinality: 1       
                27 FAST DUAL  Cost: 2  Cardinality: 1       
                28 FAST DUAL  Cost: 2  Cardinality: 1       
                29 FAST DUAL  Cost: 2  Cardinality: 1        I am surprised the cost without the index is less than the cost with it, considering that it is replacing a Table Access By Index Rowid with a Table Access Full on a table with 1 billion (1000 million) records.
    Igor - two questions:
    One - I cannot find "Materialize" in the hints in the SQL Reference anywhere. What does it do?
    Two - does replacing subqueries with With clauses make that much of a difference?

  • Fetching queries that are running slow

    Hi all,
    Is there any tool in Oracle 9i, by which we can fetch queries that are running slow in the entire database on a weekly basis ?

    As mentioned, the statspack tables and the shared pool views from which they take their snapshots - V$SQL / V$SQLAREA - provided various ways for you to idenitify top N statements by cpu time, elapsed time, logical io, physical io, etc.
    For a weekly basis, the statspack tables and statspack reports provided the easiest way to do this, a) providing you're capturing this data and b) depending on how long you're retaining it.

  • How do I find out which query are running??

    My client is connecting to the database and running application through the web. From the Unix system, I know his job took 99% of CPU time and running for 1 hour already. Is there anyway I can find out which query are running in the Oracle?? So I can tune this query?? thanks..

    Hi,
    You can use the following query to identify it.
    set linesize 100
    set pagesize 100
    SELECT substr(sql_text,1,40) sql,executions, rows_processed,
    rows_processed/executions "Rows/Exec",
    hash_value,address
    FROM V$SQLAREA WHERE executions > 100 AND rownum <= 10
    ORDER BY executions DESC;
    Rgds,
    Dhana

  • Executing PL-SQL Query before running a Report

    Hi Guys,
    Can i use a Run a Pl-Sql Query every time before executing a report. Like if i am opening a report then the pl-sql Query should run before it.
    Thanks
    Rondo.

    Try with Evaluate as one of the column's expression.. so that we can limit to specific report..
    or
    Use Connection Pool->Connection Pool Scripts tab->use 'Execute before query'
    Since we can set the repository variables using advanced tab.. the same variable we may validate using Connection pool scripts tab.
    This might be more dev work..
    Edited by: Srini VEERAVALLI on Dec 17, 2012 9:00 PM

  • How to get report (SQL Query) generating Run Time

    There is a Standard report of Payroll which show employee transfer information on the bases of location, grade job or organization, now to get actual query which is generated by run time in report builder including whether single column parameter or lexical parameter " because currently the query in not complicate but the parameter and lexical parameter is much more due to this not quite easy to under stand just copy past it into toad or pl/sql developer,
    Kindly share your experience to get such kind of query in you working time.
    thanks

    Here i try to explain contain of query.
    Parameter
    P_DEPTNO = 10
    P_WHERE_CLAUSE := ' AND EMPNO IS NOT NULL AND SALARY > 100'
    SELECT * FROM EMP
    WHERE DEPTNO = P_DEPTNO
    &P_WHERE_CLAUSE
    REPROT WILL GENERATE QUERY AT RUN TIME IS LIKE THAT
    SELECT * FROM EMP
    WHERE DEPTNO = 10
    AND EMPNO IS NOT NULL AND SALARY > 100
    Now i want to get this query out(Run time) by doing any oracle database feature or sth similar.
    thanks

  • Ever since I updated my ipad2 and iphone5 to ios8, both devices are running slow, apps take forever to download (Google is STILL downloading on both), and they freeze/crash.  This is VERY frustrating!  Anyone else having the same problems?

    Ever since I updated my ipad2 and iphone5 to ios8, both devices are running slow, apps take forever to download (Google is STILL downloading on both), and they freeze/crash.  This is VERY frustrating!  Anyone else having the same problems?
    Message was edited by: Rkkshea

    Had same problem on my iPad2 with the original 8.0 release.  I ended up wiping it completely clean and doing a reset and restore from backup.  That seemed to fix my issues.  I had the same problem when 7 came out and did the same wipe and restore to get everything working well.

  • Give me the sql query which calculte the table size in oracle 10g ecc 6.0

    Hi expert,
    Please  give me the sql query which calculte the table size in oracle 10g ecc 6.0.
    Regards

    Orkun Gedik wrote:
    select segment_name, sum(bytes)/(1024*1024) from dba_segments where segment_name = '<TABLE_NAME>' group by segment_name;
    Hi,
    This delivers possibly wrong data in MCOD installations.
    Depending on Oracle Version and Patchlevel dba_segments does not always have the correct data,
    at any time esp. for indexes right after being rebuild parallel (Even in DB02 because it is using USER_SEGMENTS).
    Takes a day to get the data back in line (never found out, who did the correction at night, could be RSCOLL00 ?).
    Use above statement with "OWNER = " in WHERE for MCOD or connect as schema owner and use USER_SEGMENTS.
    Use with
    segment_name LIKE '<TABLE_NAME>%'
    if you like to see the related indexes as well.
    For partitioned objects, a join from dba_tables / dba_indexes to dba_tab_partitions/dba_ind_partitions to dba_segments
    might be needed, esp. for hash partitioned tables, depending on how they have been created ( partition names SYS_xxxx).
    Volker

  • Oracle Sql Query issue Running on Different DB Version

    Hello All,
    I have come into situation where we are pruning sql queries on different DB version of Oracle and have performance issue. Let me tell you in brief and i really appreciate for your prompt response as its very imperative stuff.
    I have a query which is running on a DB of version 7.3.4 and it takes around 30 mins where as the same query when run on 8i it takes 15sec., its a huge difference. I have run the statistics to analyze on 7.3 and its comparatively very high. Question here is, the sql query trys to select data from same schema table and 2 tables from another DB using DB link and 2 other tables from another DB using DB link.So,how can we optimize this stuff and achieve this run as same time as 8i DB in 7.3. Hope i am clear about my question, Eagerly waiting for your replies.
    Thanks in Advance.
    Message was edited by:
    Ram8

    Difficult to be sure without any more detailed information, but I suspect that O7 is in effect copying the remote tables to local temp space, then joining; 8i is factoring out a better query to send to the remote DBs, which does as much work as possible on the remote DB before shipping remaining rows back to local.
    You should be able to use EXPLAIN PLAN to identify what SQL is being shipped to the remote DB, If you can't (and it's been quite a while since I tried DB links or O7) then get the remote DBs to yourself, and set SQL_TRACE on for the remote instances. Execute the query and then examine the remote trace files, And don't forget to turn off the tracing when you're done.
    Of course it could just be that the CBO got better,,,
    HTH - if not, post your query and plans for the local db, and the remote queries.
    Regards Nigel

  • Webi reports are running slow

    Hi Gurus,
    This may be repeated question but I didn't find suitable answer and need your help.
    There are number of webi reports which is based on olap connection directly on bex query. We are experiencing the slowness while opening the report and even opening for selection screen for prompts.
    This is happening from past few days.
    There is slight slowness in backend BI system as well.
    All the BO servers are running fine.
    BO Version: BO 4.0 sp6.6
    Thanks & Regards,
    Harsh Wardhan

    Sometime the cache got fill , restart the servers once and it should be as before.

  • Sql Query is running fine in one database but running from long in other

    Hi All,
    Please advice me on below:
    One query is running fine on 11gr2 database with having 2GB SGA and cost of the running query is 15, but the same query is running from long time in other database having same 2GB SGA.
    Below is teh Query:
    SELECT CDU.USER_NAME, DECODE(:B2 , 'QUEUE','begin
    dbms_aqadm.grant_queue_privilege(''ALL'','''||:B1
    ||''','''||CDU.USER_NAME||''',true); end;', 'grant '||DECODE(:B2 ,
    'TABLE','SELECT,INSERT,UPDATE,DELETE'||DECODE(CDU.ADMIN,'Y',',REFERENCES
    ',''), 'VIEW',DECODE(:B3 ,NULL,'SELECT','SELECT,INSERT,UPDATE,DELETE'||D
    ECODE(CDU.ADMIN,'Y',',REFERENCES','')), 'TYPE','EXECUTE',
    'SEQUENCE','SELECT', 'EXECUTE')||' on
    '||PACK_UTILS.GET_SCHEMA_OWNER||'.'||:B1 ||' to
    "'||CDU.USER_NAME||'"'||DECODE(CDU.ADMIN,'Y',' WITH GRANT OPTION',''))
    AS GRANT_SOURCE, 'create or replace synonym
    "'||CDU.USER_NAME||'"."'||:B1 ||'" for
    "'||PACK_UTILS.GET_SCHEMA_OWNER||'"."'||:B1 ||'"' AS SYNONYM_SOURCE,
    NVL2( S.TABLE_NAME, 'Y', 'N' ) SYNONYM_EXISTS FROM CD_USERS CDU,
    ALL_SYNONYMS S, ALL_USERS U WHERE :B2 IN
    ('TYPE','TABLE','VIEW','FUNCTION','PROCEDURE','PACKAGE','SEQUENCE','QUEU
    E','SYNONYM') AND CDU.USER_TYPE = 'S' AND CDU.USER_NAME = U.USERNAME
    AND CDU.USER_NAME = S.OWNER AND :B1 = S.TABLE_NAME
    Please advise me as application team is chasing me like anything. what I can find out is that Cost is different in both databases.

    Sorry forr Late reply friends..
    below are the Explian plans for both databases:
                                                      BAD database
    PLAN_TABLE_OUTPUT
    SQL_ID  3bp3rynsds42r, child number 0
    SELECT CDU.USER_NAME, DECODE(:B2 , 'QUEUE','begin
    dbms_aqadm.grant_queue_privilege(''ALL'','''||:B1
    ||''','''||CDU.USER_NAME||''',true); end;', 'grant '||DECODE(:B2 ,
    'TABLE','SELECT,INSERT,UPDATE,DELETE'||DECODE(CDU.ADMIN,'Y',',REFERENCES
    ',''), 'VIEW',DECODE(:B3 ,NULL,'SELECT','SELECT,INSERT,UPDATE,DELETE'||D
    ECODE(CDU.ADMIN,'Y',',REFERENCES','')), 'TYPE','EXECUTE',
    'SEQUENCE','SELECT', 'EXECUTE')||' on
    '||PACK_UTILS.GET_SCHEMA_OWNER||'.'||:B1 ||' to
    "'||CDU.USER_NAME||'"'||DECODE(CDU.ADMIN,'Y',' WITH GRANT OPTION',''))
    PLAN_TABLE_OUTPUT
    AS GRANT_SOURCE, 'create or replace synonym
    "'||CDU.USER_NAME||'"."'||:B1 ||'" for
    "'||PACK_UTILS.GET_SCHEMA_OWNER||'"."'||:B1 ||'"' AS SYNONYM_SOURCE,
    NVL2( S.TABLE_NAME, 'Y', 'N' ) SYNONYM_EXISTS FROM CD_USERS CDU,
    ALL_SYNONYMS S, ALL_USERS U WHERE :B2 IN
    ('TYPE','TABLE','VIEW','FUNCTION','PROCEDURE','PACKAGE','SEQUENCE','QUEU
    E','SYNONYM') AND CDU.USER_TYPE = 'S' AND CDU.USER_NAME = U.USERNAME
    AND CDU.USER_NAME = S.OWNER AND :B1 = S.TABLE_NAME
    Plan hash value: 2404940060
    PLAN_TABLE_OUTPUT
    | Id  | Operation                                            | Name               | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                                     |                    |       |       |       |    94 (100)|          |
    |*  1 |  FILTER                                              |                    |       |       |       |            |          |
    |*  2 |   HASH JOIN                                          |                    |    81 |  6723 |       |    94   (0)| 00:00:01 |
    |   3 |    NESTED LOOPS OUTER                                |                    |    81 |  6480 |       |    91   (0)| 00:00:01 |
    |*  4 |     HASH JOIN                                        |                    |    81 |  3726 |       |    10   (0)| 00:00:01 |
    |*  5 |      HASH JOIN                                       |                    |   137 |  3699 |       |     7   (0)| 00:00:01 |
    |   6 |       TABLE ACCESS FULL                              | TS$                |     7 |    21 |       |     3   (0)| 00:00:01 |
    |*  7 |       TABLE ACCESS FULL                              | USER$              |   137 |  3288 |       |     4   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    |*  8 |      TABLE ACCESS FULL                               | CD_USERS           |    82 |  1558 |       |     3   (0)| 00:00:01 |
    |   9 |     VIEW                                             | ALL_SYNONYMS       |     1 |    34 |       |     1   (0)| 00:00:01 |
    |  10 |      SORT UNIQUE                                     |                    |       |       |       |            |          |
    |  11 |       UNION-ALL PARTITION                            |                    |       |       |       |            |          |
    |* 12 |        FILTER                                        |                    |       |       |       |            |          |
    |  13 |         NESTED LOOPS                                 |                    |     1 |   116 |       |    60   (0)| 00:00:01 |
    |  14 |          NESTED LOOPS                                |                    |     1 |    94 |       |    59   (0)| 00:00:01 |
    |  15 |           NESTED LOOPS                               |                    |    12 |   684 |       |    23   (0)| 00:00:01 |
    |  16 |            TABLE ACCESS BY INDEX ROWID               | USER$              |     1 |    19 |       |     1   (0)| 00:00:01 |
    |* 17 |             INDEX UNIQUE SCAN                        | I_USER1            |     1 |       |       |     0   (0)|          |
    |  18 |            TABLE ACCESS BY INDEX ROWID               | SYN$               |    12 |   456 |       |    22   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    |* 19 |             INDEX SKIP SCAN                          | I_SYN2             |    12 |       |       |    12   (0)| 00:00:01 |
    |* 20 |           TABLE ACCESS BY INDEX ROWID                | OBJ$               |     1 |    37 |       |     3   (0)| 00:00:01 |
    |* 21 |            INDEX RANGE SCAN                          | I_OBJ1             |     1 |       |       |     2   (0)| 00:00:01 |
    |* 22 |          INDEX RANGE SCAN                            | I_USER2            |     1 |    22 |       |     1   (0)| 00:00:01 |
    |* 23 |         FIXED TABLE FULL                             | X$KZSPR            |    17 |   119 |       |     0   (0)|          |
    |* 24 |         FILTER                                       |                    |       |       |       |            |          |
    |* 25 |          FILTER                                      |                    |       |       |       |            |          |
    |  26 |           NESTED LOOPS                               |                    |    27 |  2430 |       |     6   (0)| 00:00:01 |
    |  27 |            NESTED LOOPS                              |                    |     1 |    78 |       |     4   (0)| 00:00:01 |
    |  28 |             NESTED LOOPS                             |                    |     1 |    56 |       |     3   (0)| 00:00:01 |
    |  29 |              TABLE ACCESS BY INDEX ROWID             | USER$              |     1 |    19 |       |     1   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    |* 30 |               INDEX UNIQUE SCAN                      | I_USER1            |     1 |       |       |     0   (0)|          |
    |* 31 |              INDEX RANGE SCAN                        | I_OBJ5             |     1 |    37 |       |     2   (0)| 00:00:01 |
    |* 32 |             INDEX RANGE SCAN                         | I_USER2            |     1 |    22 |       |     1   (0)| 00:00:01 |
    |* 33 |            INDEX RANGE SCAN                          | I_OBJAUTH1         |    28 |   336 |       |     2   (0)| 00:00:01 |
    |* 34 |          FIXED TABLE FULL                            | X$KZSRO            |     1 |     3 |       |     0   (0)|          |
    |  35 |          NESTED LOOPS                                |                    |     1 |    30 |       |     3   (0)| 00:00:01 |
    |* 36 |           INDEX SKIP SCAN                            | I_USER2            |     1 |    20 |       |     1   (0)| 00:00:01 |
    |* 37 |           INDEX RANGE SCAN                           | I_OBJ4             |     1 |    10 |       |     2   (0)| 00:00:01 |
    |  38 |         NESTED LOOPS                                 |                    |     1 |    30 |       |     3   (0)| 00:00:01 |
    |* 39 |          INDEX SKIP SCAN                             | I_USER2            |     1 |    20 |       |     1   (0)| 00:00:01 |
    |* 40 |          INDEX RANGE SCAN                            | I_OBJ4             |     1 |    10 |       |     2   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    |* 41 |        FILTER                                        |                    |       |       |       |            |          |
    |  42 |         NESTED LOOPS                                 |                    |     1 |   129 |       |  4301   (2)| 00:00:39 |
    |  43 |          NESTED LOOPS                                |                    |     1 |   129 |       |  4301   (2)| 00:00:39 |
    |  44 |           NESTED LOOPS                               |                    |     1 |    91 |       |  4299   (2)| 00:00:39 |
    |  45 |            NESTED LOOPS                              |                    |     1 |    69 |       |  4298   (2)| 00:00:39 |
    |  46 |             NESTED LOOPS                             |                    |     2 |    64 |       |  4292   (2)| 00:00:39 |
    |  47 |              TABLE ACCESS BY INDEX ROWID             | USER$              |     1 |    19 |       |     1   (0)| 00:00:01 |
    |* 48 |               INDEX UNIQUE SCAN                      | I_USER1            |     1 |       |       |     0   (0)|          |
    |  49 |              VIEW                                    | _ALL_SYNONYMS_TREE |     2 |    26 |       |  4291   (2)| 00:00:39 |
    |* 50 |               CONNECT BY NO FILTERING WITH START-WITH|                    |       |       |       |            |          |
    |* 51 |                FILTER                                |                    |       |       |       |            |          |
    PLAN_TABLE_OUTPUT
    |* 52 |                 HASH JOIN                            |                    | 18370 |  2080K|       |  4291   (2)| 00:00:39 |
    |  53 |                  INDEX FULL SCAN                     | I_USER2            |   207 |  4554 |       |     1   (0)| 00:00:01 |
    |* 54 |                  HASH JOIN                           |                    | 18370 |  1686K|       |  4290   (2)| 00:00:39 |
    |  55 |                   TABLE ACCESS FULL                  | USER$              |   207 |  3933 |       |     4   (0)| 00:00:01 |
    |* 56 |                   HASH JOIN                          |                    |  2922K|   209M|    18M|  4269   (1)| 00:00:39 |
    |* 57 |                    INDEX FAST FULL SCAN              | I_OBJ2             |   387K|    13M|       |  1323   (1)| 00:00:12 |
    |  58 |                    TABLE ACCESS FULL                 | SYN$               |   400K|    14M|       |   566   (2)| 00:00:06 |
    |  59 |                 NESTED LOOPS                         |                    |     1 |    30 |       |     3   (0)| 00:00:01 |
    |* 60 |                  INDEX SKIP SCAN                     | I_USER2            |     1 |    20 |       |     1   (0)| 00:00:01 |
    |* 61 |                  INDEX RANGE SCAN                    | I_OBJ4             |     1 |    10 |       |     2   (0)| 00:00:01 |
    |* 62 |                FILTER                                |                    |       |       |       |            |          |
    PLAN_TABLE_OUTPUT
    |  63 |                 TABLE ACCESS BY INDEX ROWID          | SYN$               |     1 |    38 |       |     3   (0)| 00:00:01 |
    |* 64 |                  INDEX UNIQUE SCAN                   | I_SYN1             |     1 |       |       |     2   (0)| 00:00:01 |
    |* 65 |                 FILTER                               |                    |       |       |       |            |          |
    |* 66 |                  FILTER                              |                    |       |       |       |            |          |
    |  67 |                   NESTED LOOPS                       |                    |    27 |  2430 |       |     6   (0)| 00:00:01 |
    |  68 |                    NESTED LOOPS                      |                    |     1 |    78 |       |     4   (0)| 00:00:01 |
    |  69 |                     NESTED LOOPS                     |                    |     1 |    56 |       |     3   (0)| 00:00:01 |
    |  70 |                      TABLE ACCESS BY INDEX ROWID     | USER$              |     1 |    19 |       |     1   (0)| 00:00:01 |
    |* 71 |                       INDEX UNIQUE SCAN              | I_USER1            |     1 |       |       |     0   (0)|          |
    |* 72 |                      INDEX RANGE SCAN                | I_OBJ5             |     1 |    37 |       |     2   (0)| 00:00:01 |
    |* 73 |                     INDEX RANGE SCAN                 | I_USER2            |     1 |    22 |       |     1   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    |* 74 |                    INDEX RANGE SCAN                  | I_OBJAUTH1         |    28 |   336 |       |     2   (0)| 00:00:01 |
    |* 75 |                  FIXED TABLE FULL                    | X$KZSRO            |     1 |     3 |       |     0   (0)|          |
    |  76 |                  NESTED LOOPS                        |                    |     1 |    30 |       |     3   (0)| 00:00:01 |
    |* 77 |                   INDEX SKIP SCAN                    | I_USER2            |     1 |    20 |       |     1   (0)| 00:00:01 |
    |* 78 |                   INDEX RANGE SCAN                   | I_OBJ4             |     1 |    10 |       |     2   (0)| 00:00:01 |
    |* 79 |                 FIXED TABLE FULL                     | X$KZSPR            |    17 |   119 |       |     0   (0)|          |
    |* 80 |             TABLE ACCESS BY INDEX ROWID              | OBJ$               |     1 |    37 |       |     3   (0)| 00:00:01 |
    |* 81 |              INDEX RANGE SCAN                        | I_OBJ1             |     1 |       |       |     2   (0)| 00:00:01 |
    |* 82 |            INDEX RANGE SCAN                          | I_USER2            |     1 |    22 |       |     1   (0)| 00:00:01 |
    |* 83 |           INDEX UNIQUE SCAN                          | I_SYN1             |     1 |       |       |     1   (0)| 00:00:01 |
    |* 84 |          TABLE ACCESS BY INDEX ROWID                 | SYN$               |     1 |    38 |       |     2   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    |  85 |         NESTED LOOPS                                 |                    |     1 |    30 |       |     3   (0)| 00:00:01 |
    |* 86 |          INDEX SKIP SCAN                             | I_USER2            |     1 |    20 |       |     1   (0)| 00:00:01 |
    |* 87 |          INDEX RANGE SCAN                            | I_OBJ4             |     1 |    10 |       |     2   (0)| 00:00:01 |
    |  88 |    TABLE ACCESS FULL                                 | TS$                |     7 |    21 |       |     3   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter((:B2='TYPE' OR :B2='TABLE' OR :B2='VIEW' OR :B2='FUNCTION' OR :B2='PROCEDURE' OR :B2='PACKAGE' OR
                  :B2='SEQUENCE' OR :B2='QUEUE' OR :B2='SYNONYM'))
    PLAN_TABLE_OUTPUT
       2 - access("U"."TEMPTS#"="TTS"."TS#")
       4 - access("CDU"."USER_NAME"="U"."NAME")
       5 - access("U"."DATATS#"="DTS"."TS#")
       7 - filter("U"."TYPE#"=1)
       8 - filter("CDU"."USER_TYPE"='S')
      12 - filter(((INTERNAL_FUNCTION("O"."SPARE3") OR ("S"."NODE" IS NULL AND  IS NOT NULL) OR  IS NOT NULL) AND
                  (("O"."TYPE#"<>4 AND "O"."TYPE#"<>5 AND "O"."TYPE#"<>7 AND "O"."TYPE#"<>8 AND "O"."TYPE#"<>9 AND "O"."TYPE#"<>10 AND
                  "O"."TYPE#"<>11 AND "O"."TYPE#"<>12 AND "O"."TYPE#"<>13 AND "O"."TYPE#"<>14 AND "O"."TYPE#"<>22 AND "O"."TYPE#"<>87 AND
                  "O"."TYPE#"<>88) OR BITAND("U"."SPARE1",16)=0 OR (SYS_CONTEXT('userenv','current_edition_name')='ORA$BASE' AND
                  "U"."TYPE#"<>2) OR ("U"."TYPE#"=2 AND "U"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id'))) OR  IS NOT
                  NULL)))
    PLAN_TABLE_OUTPUT
      17 - access("U"."NAME"="CDU"."USER_NAME")
      19 - access("S"."NAME"=:B1)
           filter("S"."NAME"=:B1)
      20 - filter("O"."SPARE3"="U"."USER#")
      21 - access("O"."OBJ#"="S"."OBJ#" AND "O"."TYPE#"=5)
           filter("O"."TYPE#"=5)
      22 - access("O"."OWNER#"="U"."USER#")
      23 - filter((((-"KZSPRPRV")=(-45) OR (-"KZSPRPRV")=(-47) OR (-"KZSPRPRV")=(-48) OR (-"KZSPRPRV")=(-49) OR
                  (-"KZSPRPRV")=(-50)) AND "INST_ID"=USERENV('INSTANCE')))
      24 - filter((("BA"."GRANTOR#"=USERENV('SCHEMAID') OR  IS NOT NULL) AND (("O"."TYPE#"<>4 AND "O"."TYPE#"<>5 AND
                  "O"."TYPE#"<>7 AND "O"."TYPE#"<>8 AND "O"."TYPE#"<>9 AND "O"."TYPE#"<>10 AND "O"."TYPE#"<>11 AND "O"."TYPE#"<>12 AND
    PLAN_TABLE_OUTPUT
                  "O"."TYPE#"<>13 AND "O"."TYPE#"<>14 AND "O"."TYPE#"<>22 AND "O"."TYPE#"<>87 AND "O"."TYPE#"<>88) OR
                  BITAND("U"."SPARE1",16)=0 OR (INTERNAL_FUNCTION("O"."TYPE#") AND
                  ((SYS_CONTEXT('userenv','current_edition_name')='ORA$BASE' AND "U"."TYPE#"<>2) OR ("U"."TYPE#"=2 AND
                  "U"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id'))) OR  IS NOT NULL)))))
      25 - filter(:B1 IS NULL)
      30 - access("BU"."NAME"=:B1)
      31 - access("BU"."USER#"="O"."SPARE3" AND "O"."NAME"=:B1)
      32 - access("O"."OWNER#"="U"."USER#")
      33 - access("BA"."OBJ#"="O"."OBJ#")
      34 - filter("KZSROROL"=:B1)
      36 - access("U2"."TYPE#"=2 AND "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id')))
    PLAN_TABLE_OUTPUT
           filter(("U2"."TYPE#"=2 AND "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id'))))
      37 - access("O2"."DATAOBJ#"=:B1 AND "O2"."TYPE#"=88 AND "O2"."OWNER#"="U2"."USER#")
      39 - access("U2"."TYPE#"=2 AND "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id')))
           filter(("U2"."TYPE#"=2 AND "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id'))))
      40 - access("O2"."DATAOBJ#"=:B1 AND "O2"."TYPE#"=88 AND "O2"."OWNER#"="U2"."USER#")
      41 - filter((("O"."TYPE#"<>4 AND "O"."TYPE#"<>5 AND "O"."TYPE#"<>7 AND "O"."TYPE#"<>8 AND "O"."TYPE#"<>9 AND
                  "O"."TYPE#"<>10 AND "O"."TYPE#"<>11 AND "O"."TYPE#"<>12 AND "O"."TYPE#"<>13 AND "O"."TYPE#"<>14 AND "O"."TYPE#"<>22 AND
                  "O"."TYPE#"<>87 AND "O"."TYPE#"<>88) OR BITAND("U"."SPARE1",16)=0 OR
                  (SYS_CONTEXT('userenv','current_edition_name')='ORA$BASE' AND "U"."TYPE#"<>2) OR ("U"."TYPE#"=2 AND
                  "U"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id'))) OR  IS NOT NULL))
      48 - access("U"."NAME"="CDU"."USER_NAME")
    PLAN_TABLE_OUTPUT
      50 - access("S"."BASE_SYN_ID"=PRIOR NULL)
           filter( IS NOT NULL)
      51 - filter((("O"."TYPE#"<>4 AND "O"."TYPE#"<>5 AND "O"."TYPE#"<>7 AND "O"."TYPE#"<>8 AND "O"."TYPE#"<>9 AND
                  "O"."TYPE#"<>10 AND "O"."TYPE#"<>11 AND "O"."TYPE#"<>12 AND "O"."TYPE#"<>13 AND "O"."TYPE#"<>14 AND "O"."TYPE#"<>22 AND
                  "O"."TYPE#"<>87 AND "O"."TYPE#"<>88) OR BITAND("U"."SPARE1",16)=0 OR
                  (SYS_CONTEXT('userenv','current_edition_name')='ORA$BASE' AND "U"."TYPE#"<>2) OR ("U"."TYPE#"=2 AND
                  "U"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id'))) OR  IS NOT NULL))
      52 - access("O"."OWNER#"="U"."USER#")
      54 - access("S"."OWNER"="BU"."NAME" AND "BU"."USER#"="O"."SPARE3")
      56 - access("S"."NAME"="O"."NAME")
      57 - filter("O"."TYPE#"=5)
    PLAN_TABLE_OUTPUT
      60 - access("U2"."TYPE#"=2 AND "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id')))
           filter(("U2"."TYPE#"=2 AND "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id'))))
      61 - access("O2"."DATAOBJ#"=:B1 AND "O2"."TYPE#"=88 AND "O2"."OWNER#"="U2"."USER#")
      62 - filter(( IS NOT NULL OR ("S"."NODE" IS NULL AND  IS NOT NULL)))
      64 - access("S"."OBJ#"=:B1)
      65 - filter((("BA"."GRANTOR#"=USERENV('SCHEMAID') OR  IS NOT NULL) AND (("O"."TYPE#"<>4 AND "O"."TYPE#"<>5 AND
                  "O"."TYPE#"<>7 AND "O"."TYPE#"<>8 AND "O"."TYPE#"<>9 AND "O"."TYPE#"<>10 AND "O"."TYPE#"<>11 AND "O"."TYPE#"<>12 AND
                  "O"."TYPE#"<>13 AND "O"."TYPE#"<>14 AND "O"."TYPE#"<>22 AND "O"."TYPE#"<>87 AND "O"."TYPE#"<>88) OR
                  BITAND("U"."SPARE1",16)=0 OR (INTERNAL_FUNCTION("O"."TYPE#") AND
                  ((SYS_CONTEXT('userenv','current_edition_name')='ORA$BASE' AND "U"."TYPE#"<>2) OR ("U"."TYPE#"=2 AND
                  "U"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id'))) OR  IS NOT NULL)))))
    PLAN_TABLE_OUTPUT
      66 - filter(:B1 IS NULL)
      71 - access("BU"."NAME"=:B1)
      72 - access("BU"."USER#"="O"."SPARE3" AND "O"."NAME"=:B1)
      73 - access("O"."OWNER#"="U"."USER#")
      74 - access("BA"."OBJ#"="O"."OBJ#")
      75 - filter("KZSROROL"=:B1)
      77 - access("U2"."TYPE#"=2 AND "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id')))
           filter(("U2"."TYPE#"=2 AND "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id'))))
      78 - access("O2"."DATAOBJ#"=:B1 AND "O2"."TYPE#"=88 AND "O2"."OWNER#"="U2"."USER#")
      79 - filter((((-"KZSPRPRV")=(-45) OR (-"KZSPRPRV")=(-47) OR (-"KZSPRPRV")=(-48) OR (-"KZSPRPRV")=(-49) OR
                  (-"KZSPRPRV")=(-50)) AND "INST_ID"=USERENV('INSTANCE')))
    PLAN_TABLE_OUTPUT
      80 - filter("O"."SPARE3"="U"."USER#")
      81 - access("O"."OBJ#"="ST"."SYN_ID" AND "O"."TYPE#"=5)
           filter("O"."TYPE#"=5)
      82 - access("O"."OWNER#"="U"."USER#")
      83 - access("S"."OBJ#"="ST"."SYN_ID")
           filter("O"."OBJ#"="S"."OBJ#")
      84 - filter("S"."NAME"=:B1)
      86 - access("U2"."TYPE#"=2 AND "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id')))
           filter(("U2"."TYPE#"=2 AND "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id'))))
      87 - access("O2"."DATAOBJ#"=:B1 AND "O2"."TYPE#"=88 AND "O2"."OWNER#"="U2"."USER#")
    209 rows selected
    ==============================================================================================
                                                                     Good one
    PLAN_TABLE_OUTPUT
    SQL_ID  3bp3rynsds42r, child number 0
    SELECT CDU.USER_NAME, DECODE(:B2 , 'QUEUE','begin
    dbms_aqadm.grant_queue_privilege(''ALL'','''||:B1
    ||''','''||CDU.USER_NAME||''',true); end;', 'grant '||DECODE(:B2 ,
    'TABLE','SELECT,INSERT,UPDATE,DELETE'||DECODE(CDU.ADMIN,'Y',',REFERENCES
    ',''), 'VIEW',DECODE(:B3 ,NULL,'SELECT','SELECT,INSERT,UPDATE,DELETE'||D
    ECODE(CDU.ADMIN,'Y',',REFERENCES','')), 'TYPE','EXECUTE',
    'SEQUENCE','SELECT', 'EXECUTE')||' on
    '||PACK_UTILS.GET_SCHEMA_OWNER||'.'||:B1 ||' to
    "'||CDU.USER_NAME||'"'||DECODE(CDU.ADMIN,'Y',' WITH GRANT OPTION',''))
    PLAN_TABLE_OUTPUT
    AS GRANT_SOURCE, 'create or replace synonym
    "'||CDU.USER_NAME||'"."'||:B1 ||'" for
    "'||PACK_UTILS.GET_SCHEMA_OWNER||'"."'||:B1 ||'"' AS SYNONYM_SOURCE,
    NVL2( S.TABLE_NAME, 'Y', 'N' ) SYNONYM_EXISTS FROM CD_USERS CDU,
    ALL_SYNONYMS S, ALL_USERS U WHERE :B2 IN
    ('TYPE','TABLE','VIEW','FUNCTION','PROCEDURE','PACKAGE','SEQUENCE','QUEU
    E','SYNONYM') AND CDU.USER_TYPE = 'S' AND CDU.USER_NAME = U.USERNAME
    AND CDU.USER_NAME = S.OWNER AND :B1 = S.TABLE_NAME
    Plan hash value: 2146531909
    PLAN_TABLE_OUTPUT
    | Id  | Operation                                          | Name               | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                                   |                    |       |       |       |    15 (100)|          |
    |*  1 |  FILTER                                            |                    |       |       |       |            |          |
    |   2 |   NESTED LOOPS OUTER                               |                    |     3 |   273 |       |    15   (0)| 00:00:01 |
    |   3 |    NESTED LOOPS                                    |                    |     3 |   153 |       |    12   (0)| 00:00:01 |
    |   4 |     NESTED LOOPS                                   |                    |     3 |   144 |       |     9   (0)| 00:00:01 |
    |   5 |      NESTED LOOPS                                  |                    |     3 |   135 |       |     6   (0)| 00:00:01 |
    |*  6 |       TABLE ACCESS FULL                            | USER$              |    55 |  1375 |       |     4   (0)| 00:00:01 |
    |*  7 |       TABLE ACCESS BY INDEX ROWID                  | CD_USERS           |     1 |    20 |       |     1   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    |*  8 |        INDEX UNIQUE SCAN                           | I1_CD_USERS        |     1 |       |       |     0   (0)|          |
    |   9 |      TABLE ACCESS CLUSTER                          | TS$                |     1 |     3 |       |     1   (0)| 00:00:01 |
    |* 10 |       INDEX UNIQUE SCAN                            | I_TS#              |     1 |       |       |     0   (0)|          |
    |  11 |     TABLE ACCESS CLUSTER                           | TS$                |     1 |     3 |       |     1   (0)| 00:00:01 |
    |* 12 |      INDEX UNIQUE SCAN                             | I_TS#              |     1 |       |       |     0   (0)|          |
    |  13 |    VIEW                                            | ALL_SYNONYMS       |     1 |    40 |       |     1   (0)| 00:00:01 |
    |  14 |     SORT UNIQUE                                    |                    |       |       |       |            |          |
    |  15 |      UNION-ALL PARTITION                           |                    |       |       |       |            |          |
    |* 16 |       FILTER                                       |                    |       |       |       |            |          |
    |  17 |        NESTED LOOPS                                |                    |     1 |   116 |       |    19   (0)| 00:00:01 |
    |  18 |         NESTED LOOPS                               |                    |     1 |    94 |       |    18   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    |  19 |          NESTED LOOPS                              |                    |     1 |    56 |       |    15   (0)| 00:00:01 |
    |  20 |           TABLE ACCESS BY INDEX ROWID              | USER$              |     1 |    20 |       |     1   (0)| 00:00:01 |
    |* 21 |            INDEX UNIQUE SCAN                       | I_USER1            |     1 |       |       |     0   (0)|          |
    |  22 |           TABLE ACCESS BY INDEX ROWID              | SYN$               |     1 |    36 |       |    14   (0)| 00:00:01 |
    |* 23 |            INDEX SKIP SCAN                         | I_SYN2             |     1 |       |       |    12   (0)| 00:00:01 |
    |* 24 |          TABLE ACCESS BY INDEX ROWID               | OBJ$               |     1 |    38 |       |     3   (0)| 00:00:01 |
    |* 25 |           INDEX RANGE SCAN                         | I_OBJ1             |     1 |       |       |     2   (0)| 00:00:01 |
    |* 26 |         INDEX RANGE SCAN                           | I_USER2            |     1 |    22 |       |     1   (0)| 00:00:01 |
    |* 27 |        FIXED TABLE FULL                            | X$KZSPR            |    17 |   119 |       |     0   (0)|          |
    |* 28 |        FILTER                                      |                    |       |       |       |            |          |
    |* 29 |         FILTER                                     |                    |       |       |       |            |          |
    PLAN_TABLE_OUTPUT
    |  30 |          NESTED LOOPS                              |                    |     3 |   279 |       |     5   (0)| 00:00:01 |
    |  31 |           NESTED LOOPS                             |                    |     1 |    80 |       |     4   (0)| 00:00:01 |
    |  32 |            NESTED LOOPS                            |                    |     1 |    58 |       |     3   (0)| 00:00:01 |
    |  33 |             TABLE ACCESS BY INDEX ROWID            | USER$              |     1 |    20 |       |     1   (0)| 00:00:01 |
    |* 34 |              INDEX UNIQUE SCAN                     | I_USER1            |     1 |       |       |     0   (0)|          |
    |* 35 |             INDEX RANGE SCAN                       | I_OBJ5             |     1 |    38 |       |     2   (0)| 00:00:01 |
    |* 36 |            INDEX RANGE SCAN                        | I_USER2            |     1 |    22 |       |     1   (0)| 00:00:01 |
    |* 37 |           INDEX RANGE SCAN                         | I_OBJAUTH1         |     3 |    39 |       |     1   (0)| 00:00:01 |
    |* 38 |         FIXED TABLE FULL                           | X$KZSRO            |     1 |     3 |       |     0   (0)|          |
    |  39 |         NESTED LOOPS                               |                    |     1 |    32 |       |     3   (0)| 00:00:01 |
    |* 40 |          INDEX SKIP SCAN                           | I_USER2            |     1 |    20 |       |     1   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    |* 41 |          INDEX RANGE SCAN                          | I_OBJ4             |     1 |    12 |       |     2   (0)| 00:00:01 |
    |  42 |        NESTED LOOPS                                |                    |     1 |    32 |       |     3   (0)| 00:00:01 |
    |* 43 |         INDEX SKIP SCAN                            | I_USER2            |     1 |    20 |       |     1   (0)| 00:00:01 |
    |* 44 |         INDEX RANGE SCAN                           | I_OBJ4             |     1 |    12 |       |     2   (0)| 00:00:01 |
    |* 45 |       FILTER                                       |                    |       |       |       |            |          |
    |  46 |        NESTED LOOPS                                |                    |     1 |   129 |       |  1065   (1)| 00:00:13 |
    |  47 |         NESTED LOOPS                               |                    |     1 |   107 |       |  1064   (1)| 00:00:13 |
    |  48 |          NESTED LOOPS                              |                    |     1 |    69 |       |  1061   (1)| 00:00:13 |
    |  49 |           NESTED LOOPS                             |                    |     2 |    66 |       |  1059   (1)| 00:00:13 |
    |  50 |            TABLE ACCESS BY INDEX ROWID             | USER$              |     1 |    20 |       |     1   (0)| 00:00:01 |
    |* 51 |             INDEX UNIQUE SCAN                      | I_USER1            |     1 |       |       |     0   (0)|          |
    PLAN_TABLE_OUTPUT
    |  52 |            VIEW                                    | _ALL_SYNONYMS_TREE |     2 |    26 |       |  1058   (1)| 00:00:13 |
    |* 53 |             CONNECT BY NO FILTERING WITH START-WITH|                    |       |       |       |            |          |
    |* 54 |              FILTER                                |                    |       |       |       |            |          |
    |* 55 |               HASH JOIN                            |                    |   705 | 81780 |       |  1058   (1)| 00:00:13 |
    |  56 |                INDEX FULL SCAN                     | I_USER2            |   124 |  2728 |       |     1   (0)| 00:00:01 |
    |* 57 |                HASH JOIN                           |                    |   705 | 66270 |       |  1057   (1)| 00:00:13 |
    |  58 |                 TABLE ACCESS FULL                  | USER$              |   124 |  2480 |       |     4   (0)| 00:00:01 |
    |* 59 |                 HASH JOIN                          |                    | 66964 |  4839K|  2232K|  1052   (1)| 00:00:13 |
    |  60 |                  TABLE ACCESS FULL                 | SYN$               | 47615 |  1673K|       |    78   (2)| 00:00:01 |
    |* 61 |                  INDEX FAST FULL SCAN              | I_OBJ5             | 47862 |  1776K|       |   752   (1)| 00:00:10 |
    |  62 |               NESTED LOOPS                         |                    |     1 |    32 |       |     3   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    |* 63 |                INDEX SKIP SCAN                     | I_USER2            |     1 |    20 |       |     1   (0)| 00:00:01 |
    |* 64 |                INDEX RANGE SCAN                    | I_OBJ4             |     1 |    12 |       |     2   (0)| 00:00:01 |
    |* 65 |              FILTER                                |                    |       |       |       |            |          |
    |  66 |               TABLE ACCESS BY INDEX ROWID          | SYN$               |     1 |    36 |       |     2   (0)| 00:00:01 |
    |* 67 |                INDEX UNIQUE SCAN                   | I_SYN1             |     1 |       |       |     1   (0)| 00:00:01 |
    |* 68 |               FILTER                               |                    |       |       |       |            |          |
    |* 69 |                FILTER                              |                    |       |       |       |            |          |
    |  70 |                 NESTED LOOPS                       |                    |     3 |   279 |       |     5   (0)| 00:00:01 |
    |  71 |                  NESTED LOOPS                      |                    |     1 |    80 |       |     4   (0)| 00:00:01 |
    |  72 |                   NESTED LOOPS                     |                    |     1 |    58 |       |     3   (0)| 00:00:01 |
    |  73 |                    TABLE ACCESS BY INDEX ROWID     | USER$              |     1 |    20 |       |     1   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    |* 74 |                     INDEX UNIQUE SCAN              | I_USER1            |     1 |       |       |     0   (0)|          |
    |* 75 |                    INDEX RANGE SCAN                | I_OBJ5             |     1 |    38 |       |     2   (0)| 00:00:01 |
    |* 76 |                   INDEX RANGE SCAN                 | I_USER2            |     1 |    22 |       |     1   (0)| 00:00:01 |
    |* 77 |                  INDEX RANGE SCAN                  | I_OBJAUTH1         |     3 |    39 |       |     1   (0)| 00:00:01 |
    |* 78 |                FIXED TABLE FULL                    | X$KZSRO            |     1 |     3 |       |     0   (0)|          |
    |  79 |                NESTED LOOPS                        |                    |     1 |    32 |       |     3   (0)| 00:00:01 |
    |* 80 |                 INDEX SKIP SCAN                    | I_USER2            |     1 |    20 |       |     1   (0)| 00:00:01 |
    |* 81 |                 INDEX RANGE SCAN                   | I_OBJ4             |     1 |    12 |       |     2   (0)| 00:00:01 |
    |* 82 |               FIXED TABLE FULL                     | X$KZSPR            |    17 |   119 |       |     0   (0)|          |
    |* 83 |           TABLE ACCESS BY INDEX ROWID              | SYN$               |     1 |    36 |       |     1   (0)| 00:00:01 |
    |* 84 |            INDEX UNIQUE SCAN                       | I_SYN1             |     1 |       |       |     0   (0)|          |
    PLAN_TABLE_OUTPUT
    |* 85 |          TABLE ACCESS BY INDEX ROWID               | OBJ$               |     1 |    38 |       |     3   (0)| 00:00:01 |
    |* 86 |           INDEX RANGE SCAN                         | I_OBJ1             |     1 |       |       |     2   (0)| 00:00:01 |
    |* 87 |         INDEX RANGE SCAN                           | I_USER2            |     1 |    22 |       |     1   (0)| 00:00:01 |
    |  88 |        NESTED LOOPS                                |                    |     1 |    32 |       |     3   (0)| 00:00:01 |
    |* 89 |         INDEX SKIP SCAN                            | I_USER2            |     1 |    20 |       |     1   (0)| 00:00:01 |
    |* 90 |         INDEX RANGE SCAN                           | I_OBJ4             |     1 |    12 |       |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
       1 - filter((:B2='TYPE' OR :B2='TABLE' OR :B2='VIEW' OR :B2='FUNCTION' OR :B2='PROCEDURE' OR :B2='PACKAGE' OR
                  :B2='SEQUENCE' OR :B2='QUEUE' OR :B2='SYNONYM'))
       6 - filter("U"."TYPE#"=1)
       7 - filter("CDU"."USER_TYPE"='S')
       8 - access("CDU"."USER_NAME"="U"."NAME")
      10 - access("U"."DATATS#"="DTS"."TS#")
      12 - access("U"."TEMPTS#"="TTS"."TS#")
      16 - filter(((INTERNAL_FUNCTION("O"."SPARE3") OR ("S"."NODE" IS NULL AND  IS NOT NULL) OR  IS NOT NULL) AND
                  (("O"."TYPE#"<>4 AND "O"."TYPE#"<>5 AND "O"."TYPE#"<>7 AND "O"."TYPE#"<>8 AND "O"."TYPE#"<>9 AND "O"."TYPE#"<>10 AND
                  "O"."TYPE#"<>11 AND "O"."TYPE#"<>12 AND "O"."TYPE#"<>13 AND "O"."TYPE#"<>14 AND "O"."TYPE#"<>22 AND "O"."TYPE#"<>87 AND
                  "O"."TYPE#"<>88) OR BITAND("U"."SPARE1",16)=0 OR (SYS_CONTEXT('userenv','current_edition_name')='ORA$BASE' AND
    PLAN_TABLE_OUTPUT
                  "U"."TYPE#"<>2) OR ("U"."TYPE#"=2 AND "U"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id'))) OR  IS NOT
                  NULL)))
      21 - access("U"."NAME"="CDU"."USER_NAME")
      23 - access("S"."NAME"=:B1)
           filter("S"."NAME"=:B1)
      24 - filter("O"."SPARE3"="U"."USER#")
      25 - access("O"."OBJ#"="S"."OBJ#" AND "O"."TYPE#"=5)
           filter("O"."TYPE#"=5)
      26 - access("O"."OWNER#"="U"."USER#")
      27 - filter((((-"KZSPRPRV")=(-45) OR (-"KZSPRPRV")=(-47) OR (-"KZSPRPRV")=(-48) OR (-"KZSPRPRV")=(-49) OR
                  (-"KZSPRPRV")=(-50)) AND "INST_ID"=USERENV('INSTANCE')))
    PLAN_TABLE_OUTPUT
      28 - filter((("BA"."GRANTOR#"=USERENV('SCHEMAID') OR  IS NOT NULL) AND (("O"."TYPE#"<>4 AND "O"."TYPE#"<>5 AND
                  "O"."TYPE#"<>7 AND "O"."TYPE#"<>8 AND "O"."TYPE#"<>9 AND "O"."TYPE#"<>10 AND "O"."TYPE#"<>11 AND "O"."TYPE#"<>12 AND
                  "O"."TYPE#"<>13 AND "O"."TYPE#"<>14 AND "O"."TYPE#"<>22 AND "O"."TYPE#"<>87 AND "O"."TYPE#"<>88) OR
                  BITAND("U"."SPARE1",16)=0 OR (INTERNAL_FUNCTION("O"."TYPE#") AND
                  ((SYS_CONTEXT('userenv','current_edition_name')='ORA$BASE' AND "U"."TYPE#"<>2) OR ("U"."TYPE#"=2 AND
                  "U"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id'))) OR  IS NOT NULL)))))
      29 - filter(:B1 IS NULL)
      34 - access("BU"."NAME"=:B1)
      35 - access("BU"."USER#"="O"."SPARE3" AND "O"."NAME"=:B1)
      36 - access("O"."OWNER#"="U"."USER#")
      37 - access("BA"."OBJ#"="O"."OBJ#")
    PLAN_TABLE_OUTPUT
      38 - filter("KZSROROL"=:B1)
      40 - access("U2"."TYPE#"=2 AND "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id')))
           filter(("U2"."TYPE#"=2 AND "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id'))))
      41 - access("O2"."DATAOBJ#"=:B1 AND "O2"."TYPE#"=88 AND "O2"."OWNER#"="U2"."USER#")
      43 - access("U2"."TYPE#"=2 AND "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id')))
           filter(("U2"."TYPE#"=2 AND "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id'))))
      44 - access("O2"."DATAOBJ#"=:B1 AND "O2"."TYPE#"=88 AND "O2"."OWNER#"="U2"."USER#")
      45 - filter((("O"."TYPE#"<>4 AND "O"."TYPE#"<>5 AND "O"."TYPE#"<>7 AND "O"."TYPE#"<>8 AND "O"."TYPE#"<>9 AND
                  "O"."TYPE#"<>10 AND "O"."TYPE#"<>11 AND "O"."TYPE#"<>12 AND "O"."TYPE#"<>13 AND "O"."TYPE#"<>14 AND "O"."TYPE#"<>22 AND
                  "O"."TYPE#"<>87 AND "O"."TYPE#"<>88) OR BITAND("U"."SPARE1",16)=0 OR
                  (SYS_CONTEXT('userenv','current_edition_name')='ORA$BASE' AND "U"."TYPE#"<>2) OR ("U"."TYPE#"=2 AND
    PLAN_TABLE_OUTPUT
                  "U"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id'))) OR  IS NOT NULL))
      51 - access("U"."NAME"="CDU"."USER_NAME")
      53 - access("S"."BASE_SYN_ID"=PRIOR NULL)
           filter( IS NOT NULL)
      54 - filter((("O"."TYPE#"<>4 AND "O"."TYPE#"<>5 AND "O"."TYPE#"<>7 AND "O"."TYPE#"<>8 AND "O"."TYPE#"<>9 AND
                  "O"."TYPE#"<>10 AND "O"."TYPE#"<>11 AND "O"."TYPE#"<>12 AND "O"."TYPE#"<>13 AND "O"."TYPE#"<>14 AND "O"."TYPE#"<>22 AND
                  "O"."TYPE#"<>87 AND "O"."TYPE#"<>88) OR BITAND("U"."SPARE1",16)=0 OR
                  (SYS_CONTEXT('userenv','current_edition_name')='ORA$BASE' AND "U"."TYPE#"<>2) OR ("U"."TYPE#"=2 AND
                  "U"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id'))) OR  IS NOT NULL))
      55 - access("O"."OWNER#"="U"."USER#")
      57 - access("S"."OWNER"="BU"."NAME" AND "BU"."USER#"="O"."SPARE3")
    PLAN_TABLE_OUTPUT
      59 - access("S"."NAME"="O"."NAME")
      61 - filter("O"."TYPE#"=5)
      63 - access("U2"."TYPE#"=2 AND "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id')))
           filter(("U2"."TYPE#"=2 AND "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id'))))
      64 - access("O2"."DATAOBJ#"=:B1 AND "O2"."TYPE#"=88 AND "O2"."OWNER#"="U2"."USER#")
      65 - filter(( IS NOT NULL OR ("S"."NODE" IS NULL AND  IS NOT NULL)))
      67 - access("S"."OBJ#"=:B1)
      68 - filter((("BA"."GRANTOR#"=USERENV('SCHEMAID') OR  IS NOT NULL) AND (("O"."TYPE#"<>4 AND "O"."TYPE#"<>5 AND
                  "O"."TYPE#"<>7 AND "O"."TYPE#"<>8 AND "O"."TYPE#"<>9 AND "O"."TYPE#"<>10 AND "O"."TYPE#"<>11 AND "O"."TYPE#"<>12 AND
                  "O"."TYPE#"<>13 AND "O"."TYPE#"<>14 AND "O"."TYPE#"<>22 AND "O"."TYPE#"<>87 AND "O"."TYPE#"<>88) OR
                  BITAND("U"."SPARE1",16)=0 OR (INTERNAL_FUNCTION("O"."TYPE#") AND
    PLAN_TABLE_OUTPUT
                  ((SYS_CONTEXT('userenv','current_edition_name')='ORA$BASE' AND "U"."TYPE#"<>2) OR ("U"."TYPE#"=2 AND
                  "U"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id'))) OR  IS NOT NULL)))))
      69 - filter(:B1 IS NULL)
      74 - access("BU"."NAME"=:B1)
      75 - access("BU"."USER#"="O"."SPARE3" AND "O"."NAME"=:B1)
      76 - access("O"."OWNER#"="U"."USER#")
      77 - access("BA"."OBJ#"="O"."OBJ#")
      78 - filter("KZSROROL"=:B1)
      80 - access("U2"."TYPE#"=2 AND "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id')))
           filter(("U2"."TYPE#"=2 AND "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id'))))
      81 - access("O2"."DATAOBJ#"=:B1 AND "O2"."TY

  • Query Is Running Slow

    Hi all,
    I am runnig the query first time but it is taking very much time to run query . are there any parameter which we need to set from BIW when we run the query first time ?
    when i try to dril down any char. or when i try to move any free characteristic to rows it is taking very much time.
    please tell me the steps to improve the performance.
    Regards,
    Komik Shah

    Hi,
    This info may be helpful.
    General tips
    Using aggregates and compression.
    Using  less and complex cell definitions if possible.
    1. Avoid using too many nav. attr
    2. Avoid RKF and CKF
    3. Many chars in row.
    By using T-codes ST03 or ST03N
    Go to transaction ST03 > switch to expert mode > from left side menu > and there in system load history and distribution for a particual day > check query execution time.
    /people/andreas.vogel/blog/2007/04/08/statistical-records-part-4-how-to-read-st03n-datasets-from-db-in-nw2004
    /people/andreas.vogel/blog/2007/03/16/how-to-read-st03n-datasets-from-db
    Try table rsddstats to get the statistics
    Using cache memoery will decrease the loading time of the report.
    Run reporting agent at night and sending results to email.This will ensure use of OLAP cache. So later report execution will retrieve the result faster from the OLAP cache.
    4. Go to SE38 > Run the program SAP_INFOCUBE_DESIGNS
    It will shown dimension Vs Fact tables Size in percent.If you mean speed of queries on a cube as performance metric of cube,measure query runtime.
    3. To check the performance of the aggregates,see the columns valuation and usage in aggregates.
    Open the Aggregates...and observe VALUATION and USAGE columns.
    "---" sign is the valuation of the aggregate. You can say -3 is the valuation of the aggregate design and usage. ++ means that its compression is good and access is also more (in effect, performance is good). If you check its compression ratio, it must be good. -- means the compression ratio is not so good and access is also not so good (performance is not so good).The more is the positives...more is useful the aggregate and more it satisfies the number of queries. The greater the number of minus signs, the worse the evaluation of the aggregate. The larger the number of plus signs, the better the evaluation of the aggregate.
    if "-----" then it means it just an overhead. Aggregate can potentially be deleted and "+++++" means Aggregate is potentially very useful.
    Refer.
    http://help.sap.com/saphelp_nw70/helpdata/en/b8/23813b310c4a0ee10000000a114084/content.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/60/f0fb411e255f24e10000000a1550b0/frameset.htm
    Note 356732 - Performance Tuning for Queries with Aggregates
    5. Run your query in RSRT and run the query in the debug mode. Select "Display Aggregates Found" and "Do not use cache" in the debug mode. This will tell you if it hit any aggregates while running. If it does not show any aggregates, you might want to redesign your aggregates for the query.
    Also your query performance can depend upon criteria and since you have given selection only on one infoprovider...just check if you are selecting huge amount of data in the report
    Check for the query read mode in RSRT.(whether its A,X or H)..advisable read mode is X.
    Generate Report in RSRT  
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/cccad390-0201-0010-5093-fd9ec8157802
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4c0ab590-0201-0010-bd9a-8332d8b4f09c
    Achieving BI Query Performance Building Business Intelligence
    http://www.dmreview.com/issues/20051001/1038109-1.html
    Performance Tuning with the OLAP Cache
    http://www.sapadvisors.com/resources/Howto...PerformanceTuningwiththeOLAPCache$28pdf$29.pdf
    Business Intelligence Journal Improving Query Performance in Data Warehouses
    http://www.tdwi.org/Publications/BIJournal/display.aspx?ID=7891
    Achieving BI Query Performance Building Business Intelligence
    http://www.dmreview.com/issues/20051001/1038109-1.html
    Hope this helps.
    Thanks,
    JituK

  • SQL Query Report Very slow

    Hi I have a sql query report that is taking very long to render.The query on sql developer comes back in less than a second.Any ideas on what could be wrong?

    Hi
    When posting code on the forum, put {noformat}{noformat} (with the curly brackets and the word code in lowercase) above and below your code like this...
    {noformat}{noformat}
    SELECT *
    FROM emp
    {noformat}{noformat}
    It will then appear like this, preserving formatting...SELECT *
    FROM emp
    Next, how many rows are returned in total, it may be that you have SQL Developer set up to fetch only the first x number of rows?
    Why have you put a CHOOSE hint in there?
    Is it a classic report or an interactive report?
    It looks like you're going over a database link, you really need to provide an explain plan (formatted as I have detailed above), a DRIVING_SITE hint may help you but it's impossible to know without seeing the plan...
    Cheers
    Ben                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Can we change/Modify BI server generated Sql query and run to fetch data

    Hi,
    My client is saying that there is an option to modify bi server generated sql query to fetch data from source.
    question:As a request is made in presentation services, A dynamic sql query is generated and fetches data from source. all this is loggedin Nqlquery log..well can we change/modify the sql query generated and run modified sql query to fetch data from source. ., if so how? if not why?
    Thanks in advance
    Edited by: user10794468 on Jun 16, 2009 6:29 PM
    Edited by: user10794468 on Aug 12, 2009 6:58 PM

    Thank you so much for your reply..
    ..Can we also modify sql query generated by bi server to fetech data. the query's which we see in query log file..

  • SQL Cluster 2008 RTM related issue- One of the Node is automatically disabiling the Agent XP's. However, all SQL Services are running

    Hi All,
    Please help. I am having a Prodution SQL 2008 RTM Cluster with two nodes-where node 1 works without any problem.However, if i failover to node 2-Agent xp's are disabled automatically. When i verify the SQL Services are node 2 are running fine.
    Checked Agent.out file which did not give much info than below:
    2012-09-09 08:00:12 - + [162] Internal request (from SetJobNextRunDate [reason: schedule will not run again]) to deactivate schedule 47
    2012-09-15 06:50:30 - ? [131] SQLSERVERAGENT service stopping due to a stop request from a user, process, or the OS...
    2012-09-15 06:50:41 - ? [098] SQLServerAgent terminated (normally)
    I have verified that hardware and software of both nodes are identical. Still ,this issue persists always.
    Please let me know the solution for this. it really pressurise on Production having one node active and other not active.
    Harithasri

    sp_configure 'show advanced options', 1;
    GO
    RECONFIGURE;
    GO
    sp_configure 'Agent XPs', 1;
    GO
    RECONFIGURE
    GO
    Are the SQL Agent running under the same accounts?
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Blog:
    Large scale of database and data cleansing
    MS SQL Consultants:
    Improves MS SQL Database Performance

Maybe you are looking for

  • Having "Download" Button/Image to download in OBIEE Dashboard

    Hi Experts, Here is what I want.. In OBIEE Reports we Cllick Download & select its subcategories to download the data in that format (eg. download to excel, pdf, text). Instead of user looking out for the download link in the bottom of the Dashboard

  • How can I call a FM in WDA?

    Hi All, Plz tell me, How can I call a function module in WDA. I have an Inputfield and a attribut under a node. I have a FM, too. I need to call the FM in a Method. How can I do it? thx Best Regards Shuo

  • Upgrade mountain lion to mac pro 2007

    Have older Mac Pro, early 2007. Can I uprade to Mountain LIon . The online requirement says 2008 or later

  • I get a "no" symbol when I try to use the basic brush.

    If I switch to an artistic brush it will work, but every time I try to switch back to the basic brush it just switches itself back. VERY FRUSTRATED... Thanx. Debi

  • How to get it back?

    I recently reinstalled Leopard--unfortunately, Final Cut Express did not transfer from my external hard drive (backup) without asking for a key. All I have is my disk, and no key. I just got the program. Am I going to have to purchase it again? Why d