SQL Query taking the different time in Production and Development Env.

Hi All,
Following is the query which is hitting mainly two tables. SA_ORDER & AC_INVOICE.
My Production and Development both has same amount of data. But in Development env. it is just taking 5 secs. to execute but in Production Env. its handing.
I have also execution plans of both env. The difference is in development env. it is showing some view i.e. SYS.VW_NSO_1 which is not getting used in Production env.
And one more input is in Production Env, I don't have DBA privileges.
What setting will I have to make to resolve this performance problem in Production Env. ?
Here is the QUERY:------------
SELECT distinct A.GL_COMPANY_ID,
A.CUSTOMER_GROUP_ID,
A.CUSTOMER_GROUP_NAME,
A.INVOICE_ID,
A.ORDER_ID,
B.ORDER_NAME,
A.CUSTOMER_ID,
A.CUSTOMER_NAME,
c.order_name parent_order_name,
A.INVOICE_DATE,
A.DUE_DATE,
A.TOTAL_INVOICED_AMOUNT,
A.TOTAL_PAID_AMOUNT,
A.CREDITED_AMOUNT,
H.write_off
from ac_invoice a,
sa_order b,
(select parent_invoice_id, sum(total_invoiced_amount) write_off
from ac_invoice
where invoice_type_id = 3
group by parent_invoice_id) H,
(select order_id, order_name from sa_order where order_type_id in (3)) c
WHERE a.order_id = b.order_id and a.invoice_id = H.parent_invoice_id(+) and
b.parent_order_id = c.order_id(+) and
a.invoice_id NOT IN
((SELECT invoice_id
FROM ac_invoice
WHERE parent_invoice_id IS NOT NULL AND invoice_type_id != 3)
UNION
(SELECT parent_invoice_id
FROM ac_invoice
WHERE parent_invoice_id IS NOT NULL AND invoice_type_id != 3)) and
A.GL_COMPANY_ID = 1 and UPPER(A.customer_name) like upper('%KTLA%')
and
invoice_type_id in (1, 3, 4, 5, 2) and a.invoice_status_id = 1
ORDER BY A.INVOICE_ID

Please follow the advice in [url http://forums.oracle.com/forums/thread.jspa?threadID=501834&tstart=15]this thread for both your development and production environment.
Regards,
Rob.

Similar Messages

  • Sql Query taking very long time to complete

    Hi All,
    DB:oracle 9i R2
    OS:sun solaris 8
    Below is the Sql Query taking very long time to complete
    Could any one help me out regarding this.
    SELECT MAX (md1.ID) ID, md1.request_id, md1.jlpp_transaction_id,
    md1.transaction_version
    FROM transaction_data_arc md1
    WHERE md1.transaction_name = :b2
    AND md1.transaction_type = 'REQUEST'
    AND md1.message_type_code = :b1
    AND NOT EXISTS (
    SELECT NULL
    FROM transaction_data_arc tdar2
    WHERE tdar2.request_id = md1.request_id
    AND tdar2.jlpp_transaction_id != md1.jlpp_transaction_id
    AND tdar2.ID > md1.ID)
    GROUP BY md1.request_id,
    md1.jlpp_transaction_id,
    md1.transaction_version
    Any alternate query to get the same results?
    kindly let me know if any one knows.
    regards,
    kk.
    Edited by: kk001 on Apr 27, 2011 11:23 AM

    Dear
    /* Formatted on 2011/04/27 08:32 (Formatter Plus v4.8.8) */
    SELECT   MAX (md1.ID) ID, md1.request_id, md1.jlpp_transaction_id,
             md1.transaction_version
        FROM transaction_data_arc md1
       WHERE md1.transaction_name = :b2
         AND md1.transaction_type = 'REQUEST'
         AND md1.message_type_code = :b1
         AND NOT EXISTS (
                SELECT NULL
                  FROM transaction_data_arc tdar2
                 WHERE tdar2.request_id = md1.request_id
                   AND tdar2.jlpp_transaction_id != md1.jlpp_transaction_id
                   AND tdar2.ID > md1.ID)
    GROUP BY md1.request_id
            ,md1.jlpp_transaction_id
            ,md1.transaction_versionCould you please post here :
    (a) the available indexes on transaction_data_arc table
    (b) the description of transaction_data_arc table
    (c) and the formatted explain plan you will get after executing the query and issuing:
    select * from table (dbms_xplan.display_cursor);Hope this helps
    Mohamed Houri

  • What is the sql query for the real time reports Resource Stats?

    Does anyone know what the query is that the real time report tool uses for the Resource Stats page?  Trying to develop a custom report that displays similar information that is updated regularly.

    Hi,
    009 wrote:
    Hi Frank,
    Just wanted your opinion on the above given SQLI'm not sure I understand it.
    I added some more formatting to help me read it:
    SELECT      A
    ,     CASE WHEN LAG(A,1) OVER (ORDER BY A) IS NULL
              OR A=LAG(A,1) OVER (ORDER BY A)
              THEN LAG(B,1) OVER (ORDER BY A)
         END B_LAG
    ,     B
    FROM     (
         SELECT A, B
         FROM
              SELECT '1'A,'Apple' B FROM DUAL UNION ALL
              SELECT '1'A,'cat'B FROM DUAL UNION ALL
              SELECT '2'A,'bat'B FROM DUAL UNION ALL
              SELECT '3'A,'rat'B FROM DUAL UNION ALL
              SELECT '2'A,'yellow'B FROM DUAL UNION ALL
              SELECT '1'A,'pin'B FROM DUAL
         CONNECT BY PRIOR A=B
         ORDER BY A
    );What is the purpose of the CONNECT BY in what you have so far?
    Is the idea that you will add another CONNECT BY query, using
    CONNECT BY  b_lag  = PRIOR b?
    Do you think that will be better than using ROW_NUMBER?
    Will it work if (a, b) is not unique?

  • Sql query taking 2 much time to execute

    hi every body
    I am trying to JOIN two tables using the following criteria
    GL_JE_LINES.GL_SL_LINK_ID = CST_AE_LINES.GL_SL_LINK_ID
    but it takes too much time .. like (1 hr r more)
    which mens that something is wrong with my logic...
    any guidance will be appreciated ....
    thnx

    Hi,
    Do you run "Gather Schema Statistics" program on regular basis?
    What is the query you are trying to run?
    Please see the following threads.
    When your query takes too long ...
    When your query takes too long ...
    Post a SQL statement tuning request - template posting
    HOW TO: Post a SQL statement tuning request - template posting
    Regards,
    Hussein

  • Consistent gets are reduced by 50% but the query taking more elapsed time.

    Hi All,
    While tuning a application my consistent gets are reduced by 50% but the query is still taking the same time.
    In a Warehouse env data is coming from With clause that is having some 40000 rows .Then these 40K rows are joined to a table that is having 2 Billion records having indexes on primary key and date column(bitmap)indexes .
    It is using Hash Joining method.

    Try forcing a hash join, if possible:
    http://dba-oracle.com/tips_oracle_hash_joins.htm
    Can you post the plans?
    http://www.dba-oracle.com/plsql/t_plsql_plans.htm

  • Executing the SQL query across 2 different databases of Oracle

    Hello All,
    In Microsoft SQL server we can execute following type of SQL query across 2 different databases:
    select * from TEST1.dbo.GENERIC_TABLE1 union select * from TEST2.dbo.GENERIC_TABLE2;
    Here TEST1 and TEST2 are 2 different databases.
    Can we do the same in Oracle?

    yes you can, but first one has to setup a database link
    Look up CREATE DATABASE LINK and then take things from there!
    P;

  • How to compare same SQL query performance in different DB servers.

    We have Production and Validation Environment of Oracle11g DB on two Solaris OSs.
    H/W and DB,etc configurations of two Oracle DBs are almost same in PROD and VAL.
    But we detected large SQL query performace difference in PROD DB and VAL DB in same SQL query.
    I would like to find and solve the cause of this situation.
    How could I do that ?
    I plan to compare SQL execution plan in PROD and VAL DB and index fragmentations.
    Before that I thought I need to keep same condition of DB statistics information in PROD and VAL DB.
    So, I plan to execute alter system FLUSH BUFFER_CACHE;
    But I am worring about bad effects of alter system FLUSH BUFFER_CACHE; to end users
    If we did alter system FLUSH BUFFER_CACHE; and got execution plan of that SQL query in the time end users do not use that system ,
    there is not large bad effect to end users after those operations?
    Could you please let me know the recomendation to compare SQL query performace ?

    Thank you.
    I got AWR report for only VAL DB server but it looks strange.
    Is there any thing wrong in DB or how to get AWR report ?
    Host Name
    Platform
    CPUs
    Cores
    Sockets
    Memory (GB)
    xxxx
    Solaris[tm] OE (64-bit)
    .00
    Snap Id
    Snap Time
    Sessions
    Cursors/Session
    Begin Snap:
    xxxx
    13-Apr-15 04:00:04
    End Snap:
    xxxx
    14-Apr-15 04:00:22
    Elapsed:
    1,440.30 (mins)
    DB Time:
    0.00 (mins)
    Report Summary
    Cache Sizes
    Begin
    End
    Buffer Cache:
    M
    M
    Std Block Size:
    K
    Shared Pool Size:
    0M
    0M
    Log Buffer:
    K
    Load Profile
    Per Second
    Per Transaction
    Per Exec
    Per Call
    DB Time(s):
    0.0
    0.0
    0.00
    0.00
    DB CPU(s):
    0.0
    0.0
    0.00
    0.00
    Redo size:
    Logical reads:
    0.0
    1.0
    Block changes:
    0.0
    1.0
    Physical reads:
    0.0
    1.0
    Physical writes:
    0.0
    1.0
    User calls:
    0.0
    1.0
    Parses:
    0.0
    1.0
    Hard parses:
    W/A MB processed:
    16.7
    1,442,472.0
    Logons:
    Executes:
    0.0
    1.0
    Rollbacks:
    Transactions:
    0.0
    Instance Efficiency Percentages (Target 100%)
    Buffer Nowait %:
    Redo NoWait %:
    Buffer Hit %:
    In-memory Sort %:
    Library Hit %:
    96.69
    Soft Parse %:
    Execute to Parse %:
    0.00
    Latch Hit %:
    Parse CPU to Parse Elapsd %:
    % Non-Parse CPU:
    Shared Pool Statistics
    Begin
    End
    Memory Usage %:
    % SQL with executions>1:
    34.82
    48.31
    % Memory for SQL w/exec>1:
    63.66
    73.05
    Top 5 Timed Foreground Events
    Event
    Waits
    Time(s)
    Avg wait (ms)
    % DB time
    Wait Class
    DB CPU
    0
    100.00
    Host CPU (CPUs: Cores: Sockets: )
    Load Average Begin
    Load Average End
    %User
    %System
    %WIO
    %Idle
    Instance CPU
    %Total CPU
    %Busy CPU
    %DB time waiting for CPU (Resource Manager)
    Memory Statistics
    Begin
    End
    Host Mem (MB):
    SGA use (MB):
    46,336.0
    46,336.0
    PGA use (MB):
    713.6
    662.6
    % Host Mem used for SGA+PGA:
    Time Model Statistics
    No data exists for this section of the report.
    Back to Wait Events Statistics
    Back to Top
    Operating System Statistics
    No data exists for this section of the report.
    Back to Wait Events Statistics
    Back to Top
    Operating System Statistics - Detail
    No data exists for this section of the report.
    Back to Wait Events Statistics
    Back to Top
    Foreground Wait Class
    s - second, ms - millisecond - 1000th of a second
    ordered by wait time desc, waits desc
    %Timeouts: value of 0 indicates value was < .5%. Value of null is truly 0
    Captured Time accounts for % of Total DB time .00 (s)
    Total FG Wait Time: (s) DB CPU time: .00 (s)
    Wait Class
    Waits
    %Time -outs
    Total Wait Time (s)
    Avg wait (ms)
    %DB time
    DB CPU
    0
    100.00
    Back to Wait Events Statistics
    Back to Top
    Foreground Wait Events
    No data exists for this section of the report.
    Back to Wait Events Statistics
    Back to Top
    Background Wait Events
    ordered by wait time desc, waits desc (idle events last)
    Only events with Total Wait Time (s) >= .001 are shown
    %Timeouts: value of 0 indicates value was < .5%. Value of null is truly 0
    Event
    Waits
    %Time -outs
    Total Wait Time (s)
    Avg wait (ms)
    Waits /txn
    % bg time
    log file parallel write
    527,034
    0
    2,209
    4
    527,034.00
    db file parallel write
    381,966
    0
    249
    1
    381,966.00
    os thread startup
    2,650
    0
    151
    57
    2,650.00
    latch: messages
    125,526
    0
    89
    1
    125,526.00
    control file sequential read
    148,662
    0
    54
    0
    148,662.00
    control file parallel write
    41,935
    0
    28
    1
    41,935.00
    Log archive I/O
    5,070
    0
    14
    3
    5,070.00
    Disk file operations I/O
    8,091
    0
    10
    1
    8,091.00
    log file sequential read
    3,024
    0
    6
    2
    3,024.00
    db file sequential read
    1,299
    0
    2
    2
    1,299.00
    latch: shared pool
    722
    0
    1
    1
    722.00
    enq: CF - contention
    4
    0
    1
    208
    4.00
    reliable message
    1,316
    0
    1
    1
    1,316.00
    log file sync
    71
    0
    1
    9
    71.00
    enq: CR - block range reuse ckpt
    36
    0
    0
    13
    36.00
    enq: JS - queue lock
    459
    0
    0
    1
    459.00
    log file single write
    414
    0
    0
    1
    414.00
    enq: PR - contention
    5
    0
    0
    57
    5.00
    asynch descriptor resize
    67,076
    100
    0
    0
    67,076.00
    LGWR wait for redo copy
    5,184
    0
    0
    0
    5,184.00
    rdbms ipc reply
    1,234
    0
    0
    0
    1,234.00
    ADR block file read
    384
    0
    0
    0
    384.00
    SQL*Net message to client
    189,490
    0
    0
    0
    189,490.00
    latch free
    559
    0
    0
    0
    559.00
    db file scattered read
    17
    0
    0
    6
    17.00
    resmgr:internal state change
    1
    100
    0
    100
    1.00
    direct path read
    301
    0
    0
    0
    301.00
    enq: RO - fast object reuse
    35
    0
    0
    2
    35.00
    direct path write
    122
    0
    0
    1
    122.00
    latch: cache buffers chains
    260
    0
    0
    0
    260.00
    db file parallel read
    1
    0
    0
    41
    1.00
    ADR file lock
    144
    0
    0
    0
    144.00
    latch: redo writing
    55
    0
    0
    1
    55.00
    ADR block file write
    120
    0
    0
    0
    120.00
    wait list latch free
    2
    0
    0
    10
    2.00
    latch: cache buffers lru chain
    44
    0
    0
    0
    44.00
    buffer busy waits
    3
    0
    0
    2
    3.00
    latch: call allocation
    57
    0
    0
    0
    57.00
    SQL*Net more data to client
    55
    0
    0
    0
    55.00
    ARCH wait for archivelog lock
    78
    0
    0
    0
    78.00
    rdbms ipc message
    3,157,653
    40
    4,058,370
    1285
    3,157,653.00
    Streams AQ: qmn slave idle wait
    11,826
    0
    172,828
    14614
    11,826.00
    DIAG idle wait
    170,978
    100
    172,681
    1010
    170,978.00
    dispatcher timer
    1,440
    100
    86,417
    60012
    1,440.00
    Streams AQ: qmn coordinator idle wait
    6,479
    48
    86,413
    13337
    6,479.00
    shared server idle wait
    2,879
    100
    86,401
    30011
    2,879.00
    Space Manager: slave idle wait
    17,258
    100
    86,324
    5002
    17,258.00
    pmon timer
    46,489
    62
    86,252
    1855
    46,489.00
    smon timer
    361
    66
    86,145
    238628
    361.00
    VKRM Idle
    1
    0
    14,401
    14400820
    1.00
    SQL*Net message from client
    253,909
    0
    419
    2
    253,909.00
    class slave wait
    379
    0
    0
    0
    379.00
    Back to Wait Events Statistics
    Back to Top
    Wait Event Histogram
    No data exists for this section of the report.
    Back to Wait Events Statistics
    Back to Top
    Wait Event Histogram Detail (64 msec to 2 sec)
    No data exists for this section of the report.
    Back to Wait Events Statistics
    Back to Top
    Wait Event Histogram Detail (4 sec to 2 min)
    No data exists for this section of the report.
    Back to Wait Events Statistics
    Back to Top
    Wait Event Histogram Detail (4 min to 1 hr)
    No data exists for this section of the report.
    Back to Wait Events Statistics
    Back to Top
    Service Statistics
    No data exists for this section of the report.
    Back to Wait Events Statistics
    Back to Top
    Service Wait Class Stats
    No data exists for this section of the report.
    Back to Wait Events Statistics
    Back to Top
    SQL Statistics
    SQL ordered by Elapsed Time
    SQL ordered by CPU Time
    SQL ordered by User I/O Wait Time
    SQL ordered by Gets
    SQL ordered by Reads
    SQL ordered by Physical Reads (UnOptimized)
    SQL ordered by Executions
    SQL ordered by Parse Calls
    SQL ordered by Sharable Memory
    SQL ordered by Version Count
    Complete List of SQL Text
    Back to Top
    SQL ordered by Elapsed Time
    No data exists for this section of the report.
    Back to SQL Statistics
    Back to Top
    SQL ordered by CPU Time
    No data exists for this section of the report.
    Back to SQL Statistics
    Back to Top
    SQL ordered by User I/O Wait Time
    No data exists for this section of the report.
    Back to SQL Statistics
    Back to Top
    SQL ordered by Gets
    No data exists for this section of the report.
    Back to SQL Statistics
    Back to Top
    SQL ordered by Reads
    No data exists for this section of the report.
    Back to SQL Statistics
    Back to Top
    SQL ordered by Physical Reads (UnOptimized)
    No data exists for this section of the report.
    Back to SQL Statistics
    Back to Top
    SQL ordered by Executions
    No data exists for this section of the report.
    Back to SQL Statistics
    Back to Top
    SQL ordered by Parse Calls
    No data exists for this section of the report.
    Back to SQL Statistics
    Back to Top
    SQL ordered by Sharable Memory
    No data exists for this section of the report.
    Back to SQL Statistics
    Back to Top
    SQL ordered by Version Count
    No data exists for this section of the report.
    Back to SQL Statistics
    Back to Top
    Complete List of SQL Text
    No data exists for this section of the report.
    Back to SQL Statistics
    Back to Top
    Instance Activity Statistics
    Instance Activity Stats
    Instance Activity Stats - Absolute Values
    Instance Activity Stats - Thread Activity
    Back to Top
    Instance Activity Stats
    No data exists for this section of the report.
    Back to Instance Activity Statistics
    Back to Top
    Instance Activity Stats - Absolute Values
    No data exists for this section of the report.
    Back to Instance Activity Statistics
    Back to Top
    Instance Activity Stats - Thread Activity
    Statistics identified by '(derived)' come from sources other than SYSSTAT
    Statistic
    Total
    per Hour
    log switches (derived)
    69
    2.87
    Back to Instance Activity Statistics
    Back to Top
    IO Stats
    IOStat by Function summary
    IOStat by Filetype summary
    IOStat by Function/Filetype summary
    Tablespace IO Stats
    File IO Stats
    Back to Top
    IOStat by Function summary
    'Data' columns suffixed with M,G,T,P are in multiples of 1024 other columns suffixed with K,M,G,T,P are in multiples of 1000
    ordered by (Data Read + Write) desc
    Function Name
    Reads: Data
    Reqs per sec
    Data per sec
    Writes: Data
    Reqs per sec
    Data per sec
    Waits: Count
    Avg Tm(ms)
    Others
    28.8G
    20.55
    .340727
    16.7G
    2.65
    .198442
    1803K
    0.01
    Direct Reads
    43.6G
    57.09
    .517021
    411M
    0.59
    .004755
    0
    LGWR
    19M
    0.02
    .000219
    41.9G
    21.87
    .496493
    2760
    0.08
    Direct Writes
    16M
    0.00
    .000185
    8.9G
    1.77
    .105927
    0
    DBWR
    0M
    0.00
    0M
    6.7G
    4.42
    .079670
    0
    Buffer Cache Reads
    3.1G
    3.67
    .037318
    0M
    0.00
    0M
    260.1K
    3.96
    TOTAL:
    75.6G
    81.33
    .895473
    74.7G
    31.31
    .885290
    2065.8K
    0.51
    Back to IO Stats
    Back to Top
    IOStat by Filetype summary
    'Data' columns suffixed with M,G,T,P are in multiples of 1024 other columns suffixed with K,M,G,T,P are in multiples of 1000
    Small Read and Large Read are average service times, in milliseconds
    Ordered by (Data Read + Write) desc
    Filetype Name
    Reads: Data
    Reqs per sec
    Data per sec
    Writes: Data
    Reqs per sec
    Data per sec
    Small Read
    Large Read
    Data File
    53.2G
    78.33
    .630701
    8.9G
    7.04
    .105197
    0.37
    21.51
    Log File
    13.9G
    0.18
    .164213
    41.9G
    21.85
    .496123
    0.02
    2.93
    Archive Log
    0M
    0.00
    0M
    13.9G
    0.16
    .164213
    Temp File
    5.6G
    0.67
    .066213
    8.1G
    0.80
    .096496
    5.33
    3713.27
    Control File
    2.9G
    2.16
    .034333
    2G
    1.46
    .023247
    0.05
    19.98

  • Not to able add sql query in the item source

    Hi,
    I am getting this error when i am trying to add the sql query in the item source
    ORA-20505: Error in DML: p_rowid=3206911131098131, p_alt_rowid=ID, p_rowid2=, p_alt_rowid2=. ORA-01461: can bind a LONG value only for insert into a LONG column
    SELECT
    "UCL"
    FROM
    SELECT
    TRUNC((
    (SUM("EV FINAL" / 100) / COUNT("Object_Name") )
    +
    3 *
    SQRT
    (SUM("EV FINAL" / 100) * SUM("EV FINAL" / 100) ) / COUNT("Object_Name") -
    (SUM("EV FINAL" / 100) / COUNT("Object_Name")) * (SUM("EV FINAL" / 100) / COUNT("Object_Name"))
    ),3) "UCL"
    FROM
    SELECT
    Pro.Project_Name "Project Name",
    POBJ.NAME "Object_Name",
    TRUNC((
    ( ( NVL(AEV."Total Actual",0) - (NVL( (NVL( (MAX(X."Incoming-Doc") / 100),0) * NVL(ID."INCOMMING_DOC",0) ) ,0 ) +
    NVL( (NVL( (MAX(X."Design") / 100),0) * NVL(D."DESIGN",0) ), 0 ) +
    NVL( (NVL( (MAX(X."Build") / 100) ,0) * NVL(B."BUILD",0) ),0 ) +
    NVL( (NVL( (MAX(X."Testing") / 100),0) * NVL(T."TESTING",0) ),0 ) +
    NVL( (NVL( (MAX(X."Release") / 100),0) * NVL(R."RELEASE",0) ),0 ) ) )
    DECODE(
    (NVL( (NVL( (MAX(X."Incoming-Doc") / 100),0) * NVL(ID."INCOMMING_DOC",0) ) ,0 ) +
    NVL( (NVL( (MAX(X."Design") / 100),0) * NVL(D."DESIGN",0) ), 0 ) +
    NVL( (NVL( (MAX(X."Build") / 100) ,0) * NVL(B."BUILD",0) ),0 ) +
    NVL( (NVL( (MAX(X."Testing") / 100),0) * NVL(T."TESTING",0) ),0 ) +
    NVL( (NVL( (MAX(X."Release") / 100),0) * NVL(R."RELEASE",0) ),0 ) ),0,NULL,
    (NVL( (NVL( (MAX(X."Incoming-Doc") / 100),0) * NVL(ID."INCOMMING_DOC",0) ) ,0 ) +
    NVL( (NVL( (MAX(X."Design") / 100),0) * NVL(D."DESIGN",0) ), 0 ) +
    NVL( (NVL( (MAX(X."Build") / 100) ,0) * NVL(B."BUILD",0) ),0 ) +
    NVL( (NVL( (MAX(X."Testing") / 100),0) * NVL(T."TESTING",0) ),0 ) +
    NVL( (NVL( (MAX(X."Release") / 100),0) * NVL(R."RELEASE",0) ),0 ) ) ) ) * 100),2)
    || '%' "EV_INITIAL",
    TRUNC((
    ( (NVL(AEV."Total Actual",0) - ( NVL( (NVL( (MAX(X."Incoming-Doc") / 100),0) * NVL(IDR."INCOMMING_DOC_REPLAN",0) ),0) +
    NVL( (NVL( (MAX(X."Design") / 100),0) * NVL(DR."DESIGN_REPLAN",0)),0) +
    NVL( (NVL( (MAX(X."Build")/100),0) * NVL(BR."BUILD_REPLAN",0)),0) +
    NVL( (NVL( (MAX(X."Testing") / 100),0) * NVL(TR."TESTING_REPLAN",0)),0) +
    NVL( (NVL( (MAX(X."Release")/100),0) * NVL(RR."RELEASE_REPLAN",0)),0) ) )
    DECODE(
    ( NVL( (NVL( (MAX(X."Incoming-Doc") / 100),0) * NVL(IDR."INCOMMING_DOC_REPLAN",0) ),0) +
    NVL( (NVL( (MAX(X."Design") / 100),0) * NVL(DR."DESIGN_REPLAN",0)),0) +
    NVL( (NVL( (MAX(X."Build")/100),0) * NVL(BR."BUILD_REPLAN",0)),0) +
    NVL( (NVL( (MAX(X."Testing") / 100),0) * NVL(TR."TESTING_REPLAN",0)),0) +
    NVL( (NVL( (MAX(X."Release")/100),0) * NVL(RR."RELEASE_REPLAN",0)),0) ) ,0,NULL,
    ( NVL( (NVL( (MAX(X."Incoming-Doc") / 100),0) * NVL(IDR."INCOMMING_DOC_REPLAN",0) ),0) +
    NVL( (NVL( (MAX(X."Design") / 100),0) * NVL(DR."DESIGN_REPLAN",0)),0) +
    NVL( (NVL( (MAX(X."Build")/100),0) * NVL(BR."BUILD_REPLAN",0)),0) +
    NVL( (NVL( (MAX(X."Testing") / 100),0) * NVL(TR."TESTING_REPLAN",0)),0) +
    NVL( (NVL( (MAX(X."Release")/100),0) * NVL(RR."RELEASE_REPLAN",0)),0) ) ) ) * 100),2) "EV FINAL",
    TRUNC(BRV."RSV",2) "Revised SV"
    FROM
    PROJECTS PRO,
    PROJECT_OBJECTS POBJ,
    INITIAL_EFFORT IE,
    SCHEDULE_VARIANCES SV,
    INITIAL_EFFORT_VIEW IEV,
    INCOMMING_DOC ID,
    DESIGN D,
    BUILD B,
    TESTING T,
    RELEASE R,
    INCOMMING_DOC_REPLAN IDR,
    DESIGN_REPLAN DR,
    BUILD_REPLAN BR,
    TESTING_REPLAN TR,
    RELEASE_REPLAN RR,
    ACTUAL_EFFORT_VIEW AEV,
    REPLAN_INITIAL_EFFORT_VIEW RIEV,
    BSV_RSV_VIEW BRV,
    SELECT
    distinct
    pro.project_name "Project Name",
    pobj.name "Object Name",
    PRO.ID "PRO_ID",
    POBJ.ID "POBJ_ID",
    CASE
    WHEN
    ts.status in ('CLOSE','CLOSED','Closed') AND
    tsk.name in ('Incomming-Doc Review','Incoming Doc- Review',
    'Incoming Doc- Review','FDD - Review') THEN
    TO_CHAR('100')
    WHEN
    upper(ts.status) like upper('ACCEPTED') AND
    tsk.name in ('Incomming-Doc Review','Incoming Doc- Review',
    'Incoming Doc- Review','FDD - Review') THEN
    TO_CHAR('75')
    WHEN
    ts.status IN ('RIP','WIP','REJECTED','Rejected') AND
    tsk.name in ('Incomming-Doc Review','Incoming Doc- Review',
    'Incoming Doc- Review','FDD - Review') THEN
    TO_CHAR('50')
    WHEN
    POBJ.ID IN (SELECT POBJ.ID FROM projects pro,project_objects pobj,task tsk,skip_phase sp,employees
    emp,employee_project_pairs epp
    WHERE pobj.pro_id = pro.id and epp.pro_id = pro.id AND sp.tas_id = tsk.id and
    pobj.id = sp.OBJ_ID and pro.id = sp.pro_id
    and tsk.name in ('Incomming-Doc Review','Incoming Doc- Review',
    'Incoming Doc- Review','FDD - Review')
    AND PRO.ID = :p2_projects ) THEN
    TO_CHAR('100')
    END "Incoming-Doc",
    CASE
    WHEN
    ts.status in ('CLOSE','CLOSED','Closed') AND
    tsk.name in ('Design Review','Design - Review','TDD - Review') THEN
    TO_CHAR('100')
    WHEN
    UPPER(ts.status) LIKE UPPER('ACCEPTED') AND
    tsk.name in ('Design Review','Design - Review','TDD - Review') THEN
    TO_CHAR('75')
    WHEN
    ts.status IN ('RIP','WIP','REJECTED','Rejected') AND
    tsk.name in ('Design Review','Design - Review','TDD - Review')
    THEN
    TO_CHAR('50')
    WHEN
    POBJ.ID IN (SELECT POBJ.ID FROM projects pro,project_objects pobj,task tsk,skip_phase sp,employees
    emp,employee_project_pairs epp
    WHERE pobj.pro_id = pro.id and epp.pro_id = pro.id AND sp.tas_id = tsk.id and
    pobj.id = sp.OBJ_ID and pro.id = sp.pro_id
    and tsk.name in ('Design Review','Design - Review','TDD - Review')
    AND PRO.ID = :p2_projects ) THEN
    TO_CHAR('100')
    END "Design",
    CASE
    WHEN
    ts.status in ('CLOSE','CLOSED','Closed') AND
    tsk.name in ('Build Review','Build - Review','Code - Review','Code') THEN
    TO_CHAR('100')
    WHEN
    UPPER(ts.status) LIKE UPPER('ACCEPTED') AND
    tsk.name in ('Build Review','Build - Review','Code - Review','Code') THEN
    TO_CHAR('75')
    WHEN
    ts.status IN ('RIP','WIP','REJECTED','Rejected') AND
    tsk.name in ('Build Review','Build - Review','Code - Review','Code') THEN
    TO_CHAR('50')
    WHEN
    POBJ.ID IN (SELECT POBJ.ID FROM projects pro,project_objects pobj,task tsk,skip_phase sp,employees
    emp,employee_project_pairs epp
    WHERE pobj.pro_id = pro.id and epp.pro_id = pro.id AND sp.tas_id = tsk.id and
    pobj.id = sp.OBJ_ID and pro.id = sp.pro_id
    and tsk.name in ('Build Review','Build - Review','Code - Review','Code')
    AND PRO.ID = :p2_projects ) THEN
    TO_CHAR('100')
    END "Build",
    CASE
    WHEN
    ts.status in ('CLOSE','CLOSED','Closed') AND
    tsk.name in ('Test Result Review','Test Result - Review','UTR - Review') THEN
    TO_CHAR('100')
    WHEN
    UPPER(ts.status) LIKE UPPER('ACCEPTED') AND
    tsk.name in ('Test Result Review','Test Result - Review','UTR - Review') THEN
    TO_CHAR('75')
    WHEN
    ts.status IN ('RIP','WIP','REJECTED','Rejected') AND
    tsk.name in ('Test Result Review','Test Result - Review','UTR - Review') THEN
    TO_CHAR('50')
    WHEN
    POBJ.ID IN (SELECT POBJ.ID FROM projects pro,project_objects pobj,task tsk,skip_phase sp,employees
    emp,employee_project_pairs epp
    WHERE pobj.pro_id = pro.id and epp.pro_id = pro.id AND sp.tas_id = tsk.id and
    pobj.id = sp.OBJ_ID and pro.id = sp.pro_id
    and tsk.name in ('Test Result Review','Test Result - Review','UTR - Review')
    AND PRO.ID = :p2_projects ) THEN
    TO_CHAR('100')
    END "Testing",
    CASE
    WHEN
    ts.status in ('CLOSE','CLOSED','Closed') AND
    tsk.name in ('Release-Review','Release - Verification',
    'Migration & Release - Review') THEN
    TO_CHAR('100')
    WHEN
    UPPER(ts.status) LIKE UPPER('ACCEPTED') AND
    tsk.name in ('Release-Review','Release - Verification',
    'Migration & Release - Review') THEN
    TO_CHAR('75')
    WHEN
    ts.status IN ('RIP','WIP','REJECTED','Rejected') AND
    tsk.name in ('Release-Review','Release - Verification','Migration & Release - Review') THEN
    TO_CHAR('50')
    WHEN
    POBJ.ID IN (SELECT POBJ.ID FROM projects pro,project_objects pobj,task tsk,skip_phase sp,employees
    emp,employee_project_pairs epp
    WHERE pobj.pro_id = pro.id and epp.pro_id = pro.id AND sp.tas_id = tsk.id and
    pobj.id = sp.OBJ_ID and pro.id = sp.pro_id
    and tsk.name in ('Release-Review','Release - Verification','Migration & Release - Review' )
    AND PRO.ID = :p2_projects ) THEN
    TO_CHAR('100')
    END "Release"
    FROM
    task_status ts,projects pro,project_objects pobj,task tsk
    ,employees emp,employee_project_pairs epp,REVIEW_ITEMS RI
    WHERE
    pobj.pro_id = pro.id
    and pro.id = ts.pro_id
    and pobj.id = ts.pro_obj_id
    and tsk.id = ts.task_id
    and emp.id = epp.emp_id
    and epp.pro_id = pro.id
    and ts.id = ri.ts_id
    AND PRO.ID = :p2_projects
    and tsk.name in ('Incomming-Doc Review','Incoming Doc- Review',
    'Incoming Doc- Review','FDD - Review','Design Review','Design - Review','TDD - Review',
    'Build Review','Build - Review','Code - Review','Code',
    'Test Result Review','Test Result - Review','UTR - Review',
    'Release-Review','Release - Verification','Migration & Release - Review')
    and ri.open_timestamp in
    SELECT
    distinct
    max(ri.open_timestamp)
    FROM
    task_status ts,projects pro,project_objects pobj,task tsk
    ,employees emp,employee_project_pairs epp,REVIEW_ITEMS RI
    WHERE
    pobj.pro_id = pro.id
    and pro.id = ts.pro_id
    and pobj.id = ts.pro_obj_id
    and tsk.id = ts.task_id
    and emp.id = epp.emp_id
    and epp.pro_id = pro.id
    and ts.id = ri.ts_id
    and tsk.name in ('Incomming-Doc Review','Incoming Doc- Review',
    'Incoming Doc- Review','FDD - Review','Design Review','Design - Review','TDD - Review',
    'Build Review','Build - Review','Code - Review','Code',
    'Test Result Review','Test Result - Review','UTR - Review',
    'Release-Review','Release - Verification','Migration & Release - Review')
    AND PRO.ID = :p2_projects
    GROUP BY POBJ.NAME,TSK.NAME )
    UNION
    select
    distinct
    pro.project_name "Project Name",
    pobj.name "Object Name",
    PRO.ID "PRO_ID",
    POBJ.ID "POBJ_ID",
    case
    when
    tsk.name in ('Incomming-Doc Review','Incoming Doc- Review',
    'Incoming Doc- Review','FDD - Review') THEN
    TO_CHAR('100')
    end "Incoming-Doc",
    case
    when
    tsk.name in ('Design Review','Design - Review','TDD - Review') THEN
    TO_CHAR('100')
    end "Design",
    case
    when
    tsk.name in ('Build Review','Build - Review','Code - Review','Code') THEN
    TO_CHAR('100')
    end "Build",
    case
    when
    tsk.name in ('Test Result Review','Test Result - Review','UTR - Review') THEN
    TO_CHAR('100')
    end "Testing",
    case
    when
    tsk.name in ('Release-Review','Release - Verification',
    'Migration & Release - Review') THEN
    TO_CHAR('100')
    end "Release"
    FROM
    projects pro
    ,project_objects pobj
    ,task tsk
    ,skip_phase sp
    ,employees emp
    ,employee_project_pairs epp
    WHERE
    pobj.pro_id = pro.id
    and epp.pro_id = pro.id
    AND sp.tas_id = tsk.id
    and pobj.id = sp.OBJ_ID
    and pro.id = sp.pro_id
    and tsk.name in ('Incomming-Doc Review','Incoming Doc- Review',
    'Incoming Doc- Review','FDD - Review','Design Review','Design - Review',
    'TDD - Review','Build Review','Build - Review','Code - Review','Code',
    'Test Result Review','Test Result - Review','UTR - Review',
    'Release-Review','Release - Verification','Migration & Release - Review')
    and pro.id = :p2_projects ) X
    WHERE
    PRO.ID = POBJ.PRO_ID AND
    PRO.ID = IE.PROJECT_NAME AND
    UPPER(POBJ.NAME) = UPPER(IE.OBJECT_NAME) AND
    PRO.ID = SV.PROJECT_NAME AND
    UPPER(POBJ.NAME) = UPPER(SV.OBJECT_NAME) AND
    PRO.ID = :p2_projects
    AND PRO.ID = X."PRO_ID"
    AND POBJ.ID = X."POBJ_ID"(+)
    AND PRO.ID = IEV."PRO_ID"
    AND POBJ.ID = IEV."POBJ_ID"
    AND PRO.ID = ID."PRO_ID"
    AND POBJ.ID = ID."POBJ_ID"
    AND PRO.ID = D."PRO_ID"
    AND POBJ.ID = D."POBJ_ID"
    AND PRO.ID = B."PRO_ID"
    AND POBJ.ID = B."POBJ_ID"
    AND PRO.ID = T."PRO_ID"
    AND POBJ.ID = T."POBJ_ID"
    AND PRO.ID = R."PRO_ID"
    AND POBJ.ID = R."POBJ_ID"
    AND PRO.ID = IDR."PRO_ID"
    AND POBJ.ID = IDR."POBJ_ID"
    AND PRO.ID = DR."PRO_ID"
    AND POBJ.ID = DR."POBJ_ID"
    AND PRO.ID = BR."PRO_ID"
    AND POBJ.ID = BR."POBJ_ID"
    AND PRO.ID = TR."PRO_ID"
    AND POBJ.ID = TR."POBJ_ID"
    AND PRO.ID = RR."PRO_ID"
    AND POBJ.ID = RR."POBJ_ID"
    AND PRO.ID = AEV."PRO_ID"
    AND POBJ.ID = AEV."POBJ_ID"
    AND PRO.ID = RIEV."PRO_ID"
    AND POBJ.ID = RIEV."POBJ_ID"
    AND PRO.ID = BRV."PRO_ID"
    AND POBJ.ID = BRV."POBJ_ID"
    group by
    PRO.PROJECT_NAME,
    POBJ.NAME,
    SV.status,
    sv.comments,
    ID."INCOMMING_DOC",D."DESIGN",B."BUILD",T."TESTING",R."RELEASE",
    IDR."INCOMMING_DOC_REPLAN",DR."DESIGN_REPLAN",BR."BUILD_REPLAN",TR."TESTING_REPLAN",RR."RELEASE_REPLAN",
    AEV."Total Actual",IEV."Total Plan",RIEV."Total Plan",
    BRV."BSV",BRV."RSV",POBJ.Complexity,POBJ.PROGRAM_TYPE,pro.id,pobj.id,BRV."Status"
    wht is the mistake i am doing here please suggets
    thanks
    Sudhir

    Can you just setup an Excel/Essbase retrieval to get the data you need? You can't use SQL to query Essbase; here is a blog post that talks about it:
    http://timtows-hyperion-blog.blogspot.com/2008/01/why-you-cant-use-sql-to-query-essbase.html
    Since I made that post, I have found out that Essbase has now been integrated into the latest version of the Oracle BI Server and, technically, you could use SQL to query the data in Essbase via the Oracle BI Server if you have the right version.
    Tim Tow
    Applied OLAP, Inc

  • How can I connect to Oracle and SQL server at the same time?

    I have been trying to find a way to connect to Oracle Database through the developer 2000 and SQL server at the same time. I need to return some data from Oracle Database and some from the Sql Server Database. And update both through SQL. I find there is such a thing as the Oracle Transparent Gateway for SQL server. I can't find it on any of my CD's or through OTN downloadable files. If anyone can point me where to get this. Or tell of another way this can be accomplished I would appreciate it. TIA.
    [email protected]

    I have been trying to find a way to connect to Oracle Database through the developer 2000 and SQL server at the same time. I need to return some data from Oracle Database and some from the Sql Server Database. And update both through SQL. I find there is such a thing as the Oracle Transparent Gateway for SQL server. I can't find it on any of my CD's or through OTN downloadable files. If anyone can point me where to get this. Or tell of another way this can be accomplished I would appreciate it. TIA.
    [email protected]
    As far as I know you have 3 options depending on your specifications. I don't think option #3 will work if you need to actually join a
    SQL Server table to an Oracle table.
    1. Oracle Transparent Gateway. I haven't used the Oracle Transparent Gateway but my understanding is that Oracle gateways are
    separate purchased products from Oracle. I've never seen any free/development versions of it anywhere. You'll need to contact
    your Oracle sales rep about it.
    2. Heterogeneous Connectivity. There's something called Heterogeneous Connectivity that could work for you - depends on what
    version of Oracle you're on and what OS. You basically set up an ODBC data source on the Oracle server and modify the listener.ora
    and tnsnames.ora files. You can then create a database link to SQL Server just like you would to any other Oracle database. You can
    check your Oracle documentation for how this works. There's also some very good documents on Metalink that tell you how to do this
    as well as a Heterogeneous Connectivity forum on this site.
    3. Use the exec_sql package available in Developer 2000. This allows you to open and execute cursors to remote databases within
    Developer. We have an account validation process that uses this - when a person enters an account number in a form while logged
    into Oracle it validates the account is valid in our main accounting DB2 database. We also pull HR information from DB2 into Oracle
    this way. If you're using Forms 6i exec_sql is a built-in command, in Forms 5.0 and 5.5 you have to add it as an attached library to
    the form. I think you also need the OCA options installed from the Developer software to have access to the library in Forms 5.0 and
    5.5. The library will be in the $ORACLE_HOME\oca20\plsqllib directory for these versions. The Developer documentation should have
    additional information.
    HTH

  • Analyze a Query which takes longer time in Production server with ST03 only

    Hi,
    I want to Analyze a Query which takes longer time in Production server with ST03 t-code only.
    Please provide me with detail steps as to perform the same with ST03
    ST03 - Expert mode- then I need to know the steps after this. I have checked many threads. So please don't send me the links.
    Write steps in detail please.
    <REMOVED BY MODERATOR>
    Regards,
    Sameer
    Edited by: Alvaro Tejada Galindo on Jun 12, 2008 12:14 PM

    Then please close the thread.
    Greetings,
    Blag.

  • Inserting Data from Oracle to SQL Server on the Real Time Basis.

    Hi Everyone,
    I need to insert data from Oracle to SQL Server on the Real Time basis, we have to fetch data from oracle approx 20 tables, and each table has more than 30 Fields. I need to fetch data in every 15 mins.
    I have created a job using SQL SERVER Agent by writing insert queries for all the tables with conditions that no rows will be inserted which is already in SQL. note that this job is taking only 1 min to execute.
    But in this way our SQL Server getting hanged and it giving problems to other application running in the SQL SERVER.
    So i m requesting all of you that what is the best way to insert huge amount of data on the real time basis.
    Thanx in Advance.

    1) Create Linked server 
    2) insert data using openquery  and set job in sql agent
    3) run job after 15 minutes

  • Can the format of a SQL Statement modify the execution time of an SQL ....

    Can the format of a SQL Statement modify the execution time of an SQL statement?
    Thanks in advance

    It depends on:
    1) What oracle version are you using
    2) What do you mean for "format"
    For example: if you're on Oracle9i and changing format means changing the order of the tables in the FROM clause and you're using Rule Based Optimizer then the execution plan and the execution time can be very different...
    Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com/2009/12/29/estrarre-i-dati-in-formato-xml-da-sql/]

  • Creative Cloud is taking too much time to load and is not downloading the one month trial for Photoshop I just paid money for.

    Creative Cloud is taking too much time to load and is not downloading the one month trial for Photoshop I just paid money for.

    stop the download if it's stalled, and restart your download.

  • Extracting the Logical sql query for the specified report  in OBIEE 11g

    Hi ,
    I want to extract the logical SQL Query for the Particular report in OBIEE 11.1.1.5.
    Any pointers related to this will be very helpful.
    Thanks,
    Sonali

    for a try please add Logical sql view to ur report it will dispaly the Logical sql for that Report..
    Hope it will helps you.

  • Physical SQL Query of the BI Publisher Report

    Hi,
    Where can we see the Physical SQL Query of the BI Publisher Report with OBIEE as a Data Source? As you people might be knowing, when we chose OBIEE - a logical SQL will/need to be placed.
    Thanks,
    Vency

    I don't see it in NQQuery log:(
    Ideally, it should be because it will hit BI Server. Moreover, I can see it (report's logical SQL) in BI Server Cache.
    Any other thoughts?

Maybe you are looking for