Should I use materialised view?

I am using the following sql in my code. This takes a long time to execute and I need to tune this. Please review and suggest if I should be using a materialized view instead.
Main Select statement for interest calculation
SELECT          intratechgcur.SECURITY, intratechgcur.srl_no, intratechgcur.schg_type,
     CASE WHEN intratechgcur.effective_date < ADt_Start_Date THEN ADt_Start_Date
                         ELSE intratechgcur.effective_date END AS start_date,
     CASE WHEN intratechgcur.effective_date < ADt_End_Date
                         AND NVL(intratechgnext.effective_date, ADt_End_Date) > ADt_End_Date THEN ADt_End_Date
                         ELSE NVL(intratechgnext.effective_date, ADt_End_Date) END AS end_date,
                    intratechgcur.rate, intratechgcur.face_value, intratechgcur.listing_int, intratechgcur.comm_prod_int,
                    intratechgcur.sec_create_int, intratechgcur.int_type, intratechgcur.interest_key, intratechgcur.margin,
                    intratechgcur.FLOOR, intratechgcur.cap, intratechgcur.reset_freq, intratechgcur.cmpd_y_n, intratechgcur.cmpd_freq,
                    intratechgcur.comp_type, intratechgcur.int_day, intratechgcur.int_day_1, intratechgcur.int_day_2, intratechgcur.int_dtls_yn
FROM               v_intratechg intratechgcur, v_intratechg intratechgnext
WHERE               intratechgcur.SECURITY          = AS_Security
AND          intratechgcur.effective_date < ADt_End_Date
AND               intratechgnext.SECURITY          (+)= intratechgcur.SECURITY
AND               intratechgnext.srl_no          (+)= intratechgcur.srl_no + 1
ORDER BY      intratechgcur.SECURITY, intratechgcur.effective_date, intratechgcur.srl_no ;
The code for the view V_intratechg is;
CREATE OR REPLACE VIEW V_INTRATECHG AS
SELECT     security,
     schg_type,
     effective_date,
     SUM(1) over (PARTITION BY security ORDER BY security, effective_date ASC, schg_type ASC) AS srl_no,
     face_value,
     rate,
     listing_int,
     comm_prod_int,
     sec_create_int,
     int_type,
     interest_key,
     margin,
     FLOOR,
     cap,
     NVL(reset_freq, 'DAILY') AS reset_freq,
     NVL(cmpd_y_n, 'N') AS cmpd_y_n,
     NVL(cmpd_freq, 'DAILY') AS cmpd_freq,
     NVL(comp_type, 'N') AS comp_type,
     int_day, int_day_1, int_day_2, int_dtls_yn
FROM
     (SELECT     security.security, 'IM' AS schg_type,
          GREATEST(security.prv_int_dt, NVL(security.allot_date, security.prv_int_dt),
          NVL(security.first_int_date,security.prv_int_dt)) AS effective_date,
          DECODE(intday.int_day_1, 'ACD', NVL((SELECT interest_amt FROM securityschddtls A WHERE security.security = A.security
          AND A.adhoc_schd_date > GREATEST(security.prv_int_dt, NVL(security.allot_date, security.prv_int_dt),
          NVL(security.first_int_date,security.prv_int_dt))
          AND a.rectype ='L' AND A.ADHOC_SCHD_DATE = (SELECT MIN(ADHOC_SCHD_DATE) FROM securityschddtls
WHERE      securityschddtls.adhoc_schd_date > GREATEST(security.prv_int_dt, NVL(security.allot_date, security.prv_int_dt), NVL(security.first_int_date,security.prv_int_dt))
     AND securityschddtls.security = A.security AND securityschddtls.rectype='L')),
          NVL(secchg.rate, security.interest)), NVL(secchg.rate, security.interest)) AS rate,
          NVL(secchg.face_value, security.face_value) AS face_value,
          NVL(secchg.listing_int, security.listing_int) AS listing_int,
          NVL(secchg.comm_prod_int, security.comm_prod_int) AS comm_prod_int,
          NVL(secchg.sec_create_int,security.sec_create_int) AS sec_create_int,
          NVL(secchg.int_type, security.int_type) AS int_type,
          NVL(secchg.interest_key, security.interest_key) AS interest_key,
          NVL(secchg.margin, security.margin) AS margin,
          NVL(secchg.FLOOR, security.FLOOR) AS FLOOR,
          NVL(secchg.cap, security.cap) AS cap,
          NVL(secchg.reset_freq, security.reset_freq) AS reset_freq,
          NVL(secchg.cmpd_y_n, security.cmpd_y_n) AS cmpd_y_n,
          NVL(secchg.cmpd_freq, security.cmpd_freq) AS cmpd_freq,
          NVL(secchg.comp_type, security.comp_type) AS comp_type,
          NVL(secchg.int_day, security.int_day) AS int_day, intday.int_day_1,
          intday.int_day_2, 'Y' AS int_dtls_yn
          FROM          security, assetype, intday, securityschddtls secdtls,
                    (SELECT     secchg.security AS security, secchg.call_date AS effective_date,
                    NVL(secchg.rate,0) AS rate, secchg.face_value,
                    SUM(1) over (PARTITION BY secchg.security ORDER BY secchg.security,
                    secchg.call_date ASC) AS srl_no,
                    NVL(secchg.listing_int,0) AS listing_int, NVL(secchg.comm_prod_int,0) AS comm_prod_int,
                    NVL(secchg.sec_create_int,0) AS sec_create_int,
                    secchg.int_type, secchg.interest_key,
                    nvl(secchg.margin,0) as margin, nvl(secchg.FLOOR,0) as floor,
                    nvl(secchg.cap,0) as cap, secchg.reset_freq,
                    secchg.cmpd_y_n, secchg.cmpd_freq, secchg.comp_type, secchg.int_day FROM          secchg) secchg
          WHERE          security.asset_type     = assetype.asset_type
               AND          security.int_day          = intday.int_day
               AND          assetype.int_y_n           = 'Y'
               AND          security.rectype          = 'L'
               AND          assetype.rectype          = 'L'
               AND          intday.rectype               = 'L'
               AND          secchg.security (+)= security.security
                    AND          secchg.srl_no (+)= 1
                    AND          secdtls.security (+)= security.security
                    AND          secdtls.srl_no (+)= 1
                    AND          secdtls.rectype (+)= 'L'
          UNION ALL
          SELECT     schedules.security,
               DECODE(schedules.schd_past_yn, 'Y', 'RP', 'RS') AS schg_type,
               DECODE(intday.int_day_1, 'ACD',security_cashflow.start_date,security_cashflow.inflow_date) AS effective_date,
               --commented by vijai
               -- DECODE(intday.int_day_1, 'ACD', intschdamt.amount, NVL(intratechg.rate,security.interest)) AS rate,
               DECODE(intday.int_day_1, 'ACD', intschdamt.amount,decode(security_cashflow.start_Date,intratechg.value_Date, intratechg.rate, security.interest)) as rate,
               decode(nvl(schedules.tot_face_value - schedules.cum_face_value,security.face_value),0,security.face_value,schedules.tot_face_value - schedules.cum_face_value,security.face_value) AS face_value,
               NVL(intratechg.listing_int,security.listing_int) as listing_int,
               NVL(intratechg.comm_prod_int,security.comm_prod_int) as comm_prod_int,
               NVL(intratechg.sec_create_int,security.sec_create_int),
               NVL(intratechg.int_type,security.int_type) as int_type,
               nvl(intratechg.interest_key,security.interest_key) as interest_key,
               nvl(intratechg.margin,security.margin) as margin,
               nvl(intratechg.FLOOR,security.floor) as floor,
               nvl(intratechg.cap,security.cap) as cap,
               nvl(intratechg.reset_freq,security.reset_freq) as reset_freq,
               nvl(intratechg.cmpd_y_n,security.cmpd_y_n) as cmpd_y_n,
               nvl(intratechg.cmpd_freq,security.cmpd_freq) as cmpd_freq,
               nvl(intratechg.comp_type,security.comp_type),
               nvl(intratechg.int_day,security.int_day),
               intday.int_day_1, intday.int_day_2,
               DECODE(intratechg.security, NULL, 'N', 'Y') AS int_dtls_yn
          FROM     v_schedules schedules, security, intday, intratechg, v_schedules intschdamt, security_cashflow
          WHERE     schedules.security          = security.security
          AND          schedules.red_yn      = 'Y'
          AND          security.int_day               = intday.int_day
          AND          security.rectype               = 'L'
          AND          intday.rectype                    = 'L'
          AND          intratechg.security (+)= schedules.security
          AND          intratechg.value_date(+)= schedules.schd_date
          AND          intratechg.rectype     (+)= 'L'
          AND          intschdamt.security (+)= schedules.security
          AND          intschdamt.schd_date (+)= schedules.schd_date
          AND          intschdamt.red_yn (+)= 'N'
          AND           security_cashflow.inflow_type      = 'INT'
          AND           security_cashflow.inflow_date     = schedules.schd_date
          AND           security.security               = security_cashflow.security
          AND           schedules.security          = security_cashflow.security
          UNION ALL
          SELECT     intratechg.security, 'IR' AS schg_type,
               intratechg.value_date AS effective_date,
               NVL(intratechg.rate,security.interest),
               security.face_value,
               NVL(intratechg.listing_int,security.listing_int),
               NVL(intratechg.comm_prod_int,security.comm_prod_int),
               NVL(intratechg.sec_create_int,security.sec_create_int),
               nvl(intratechg.int_type,security.int_type),
               nvl(intratechg.interest_key,security.interest_key),
               nvl(intratechg.margin,security.margin),
               nvl(intratechg.FLOOR,security.floor),
               nvl(intratechg.cap,security.cap),
               nvl(intratechg.reset_freq,security.reset_freq),
               nvl(intratechg.cmpd_y_n,security.cmpd_y_n),
               nvl(intratechg.cmpd_freq,security.cmpd_freq),
               nvl(intratechg.comp_type,security.comp_type),
               nvl(intratechg.int_day,security.int_day),
               intday.int_day_1, intday.int_day_2, 'Y' AS int_dtls_yn
          FROM     intratechg, security, intday
          WHERE     intratechg.security          = security.security
          AND     security.int_day               = intday.int_day
          AND     intratechg.rectype          = 'L'
          AND     security.rectype               = 'L'
          AND     intday.rectype                    = 'L'
          AND     NOT EXISTS     (SELECT     1 FROM          v_schedules schedules
                         WHERE          schedules.security     = intratechg.security
                         AND          schedules.schd_date     = intratechg.value_date
                         AND          schedules.red_yn          = 'Y'))
          ORDER BY security, srl_no
The code for the view V_schedules is;
CREATE OR REPLACE VIEW V_SCHEDULES AS
SELECT schdall.security,
          schdall.schd_date,
          schdall.schd_type,
          schdall.percent,
          schdall.units_o,
          schdall.units_n,
          schdall.amount,
          schdall.sequences,
schdall.act_sch_dt,
     schdall.security_n,
          schdall.prior_act,
     schdall.red_amount,
          schdall.ben_refer,
     schdall.round_method,
schdall.round_dec,
schdall.average_y_n,
     schdall.schd_past_yn,
     CASE WHEN schd_type IN(sysschd.red, sysschd.disred) THEN 'Y' ELSE 'N' END AS red_yn,
     SUM( CASE WHEN schd_type IN(sysschd.red, sysschd.disred) THEN schdall.red_amount ELSE 0 END)
                              over(PARTITION BY schdall.security) AS tot_face_value,
SUM( CASE WHEN schd_type IN(sysschd.red, sysschd.disred) THEN schdall.red_amount ELSE 0 END)
                              over(PARTITION BY schdall.security
                                   ORDER BY schdall.security, schdall.schd_date ASC) AS cum_face_value,
     SUM( CASE WHEN schd_type IN(sysschd.red, sysschd.disred) THEN schdall.red_amount ELSE 0 END)
                                   over(PARTITION BY schdall.security
                                   ORDER BY schdall.security, schdall.schd_date DESC) AS to_be_redeemed ,
          SUM(CASE WHEN schd_type =sysschd.INT THEN 0 ELSE 1 END)
                                   over(PARTITION BY schdall.security,schdall.schd_date,schd_type)
                         AS no_of_schd
FROM
               (SELECT      schedules.security_o AS security,
                              schedules.schd_date,
                              schedules.schd_type,
                              schedules.percent,
                              schedules.units_o,
                              schedules.units_n,
                              schedules.amount,
                              schedules.sequences,
                              schedules.act_sch_dt,
                              schedules.security_n,
                              schedules.prior_act,
                              schedules.red_amount,
                              schedules.ben_refer,
                              schedules.round_method,
                              schedules.round_dec,
                              schedules.average_y_n,
                              DECODE(schedules.schd_type,'RED','Y','Y') AS schd_past_yn
          FROM           schdpast schedules
          WHERE           prior_act = 'A'
          AND                rectype = 'L'
          UNION ALL
          SELECT           schedules.security_o AS security,
                              schedules.schd_date,
                              schedules.schd_type,
                              schedules.percent,
                         schedules.units_o,
               schedules.units_n,
                         schedules.amount,
                    schedules.sequences,
                    schedules.act_sch_dt,
               schedules.security_n,
               schedules.prior_act,
                    schedules.red_amount,
                    schedules.ben_refer,
               schedules.round_method,
               schedules.round_dec,
               schedules.average_y_n,
                    'N' AS schd_past_yn
          FROM           schedules
          WHERE           prior_act = 'A'
          AND                rectype = 'L'
          AND                Process_date IS NULL ) schdall,
          (SELECT           MAX(redschdtype) AS red,
                         MAX(disredtype) AS disred,
                              MAX(intschdtype) AS      INT
                              FROM sysparamschd
          WHERE rectype = 'L') sysschd
ORDER BY security, schd_date, schd_type

Too much SQL... makes me eyes hurt.
I think you're running down the wrong alley here. The very first and fundamental principle of performance tuning is identifying the performance problem. Saying that there is a problem is not identifying the actual problem.
You cannot run down the alley with a knife looking for a performance problem to kill if you do not know how it looks like. Good that you are running though - the old Klingon saying of "a running warrior can slit more throats" hold very true. :-)
Why is the existing SQL slow? You first need to identify that. Sure, a materialised view can make the end-query much faster as it has no longer to do all the work - that has now been done in batch by a DBMS_REFRESH job updating and maintaining that materialised view. But that work is still done... so have you actually fixed the cause of the performance problem, or merely hid it by addressing the symptoms?
How does one find and identify the underlaying performance problem with too-much-SQL-that-makes-Billy's-eyes-hurt? Software Engineering 101. Take any complex problem. Break it down into lots of smaller little problems. Solve each on in turn.
Take the SQL, break it down into simpler pieces and check each for performance issues. Look at the execution plan and cost. Determime if you (via the physical db design) are providing optimal I/O paths to the CBO in order for it to get to the required data with as little I/O as possible.
Once you deal with the facts, you can make an informed decision or whether or not a materialised view will actually fix the cause of the performance problem.

Similar Messages

  • What app should I use to view flash video on iPad?

    What app should I use to view flash video on iPad?

    You can also try Puffin or iSwifter. One of those might work for you, depending on the site(s) you need to view. All get mixed reviews, though.
    Regards.

  • Should i use a view

    I have a table that has different columns for recording different costs such as item cost, labor cost and so on.
    I have to develop a report to calculate percentage wise cost for each month.
    Prc item cost for a month = (item cost for the month* 100 )/ total of all cost for that month
    like this i have to calculate prc cost for around 10 different type of costs.
    Is it better to create a view to calculate the monthwise total cost and then use this view in my report coding or to directly calculate the total cost in my report coding? Performance wise, which is better?Please advise.

    Hi,
    It is not quite straight forward to answer for performance related question without more details like OS, Forms/Reports Version, Server Configuration, DB configuration etc.
    However, i would recommend to go for a view as all the calculations would be done in the db level itself and only the data would be passed back to the client for display the value, which would probably reduce the network round trips.
    -Arun

  • Query DB2 tables from oracle using normal view

    This is with regard to querying db2 tables using oracle views. The view is created using dblink. The querying is not an one time activity.querying will be done once in a day. Can i use normal view (will it work ) or should i use materialised view. will i be able to view the added records in db2 table using normal view?
    thanks,
    vinodh

    Vinodh2 wrote:
    This is with regard to querying db2 tables using oracle views. The view is created using dblink. The querying is not an one time activity.querying will be done once in a day. Can i use normal view (will it work ) or should i use materialised view. will i be able to view the added records in db2 table using normal view?How can the SQL select statement via a dblink not work for a view, but the same SQL select statement work for a materialised view?
    Do you think the database link or remote database care whether the select SQL that hits it, comes from a PL/SQL procedure, a view, a materialised view, a job or whatever else? It has no idea what/who is behind that select SQL - and nor does it care.
    As for the benefits of a view vs. a materialised view - that depends on the requirements for needing to use that foreign database's data in the local database.

  • RDB, Oracle 9i and Materialised Views

    Hi all,
    I have a RDB 7.1.5.9.1 and an Oracle 9.0.1.4.0 database and the data from the RDB has to be available for queries in Oracle Discoverer. There is a 1Gb (fixed) line between the databases. I have created a database link and that is working fine.
    The RDB is used 24h a day and it is very important that there are no performance problems. I do not think that a 1-on-1 recreation of the data model of the RDB in the Oracle database (with the use of the database link) is the answer. The advantage is of course that the data is always up to date, but when multiple queries are started in Oracle Discoverer I think we have a problem. And the users are used to the fact that the data is not refreshed during the day, so that isn’t an issue.
    So I was thinking of using Materialised Views. Because RDB doesn’t understand Materialised View Logs I can only do a complete refresh of these Materialised Views in Oracle. I can spread the time in which these are refreshed, but I only got about 1 hour (from 7 AM to 8 AM) to refresh about 1200Mb (that is not a lot), but in the future there will be an increase in the amount that has te be refrshed.
    Does anybody know what a complete refresh will do to the performance of the RDB?
    And what happens if someone is querying on a Materialised View during a refresh?
    Of course, any other ideas are more then welcome. I am also considering the use of triggers in the RDB to INSERT-UPDATE-DELETE the data in Oracle and the use of LogMinor, although this last option is a tricky one because the Redo-statements contain rowid’s except from the INSERT statements.
    Thanks!

    in oracle9i database you can create materialized views with logs option but it works only under certain conditions. there is another option in oracle9i database of materialized views in which you can use time refresh.you specify time period after which your database refrsh automatically.
    Yes freshing of materialized view cause performance cost on the server but it is only for time based refresh.as well as concern to the queries their is no problem with them when m-vies is in refresh state.oracle's own infrastructure can handel it.

  • Insufficient priv error when creating a materialised view using DB link!!!!

    Hi,
    I have a two databases db1 and db2.
    I have created a database link from db2 to access user1 schema in db1.
    When i try to create a materialised view by accessing user1 table using user 'user2' in db2 database, i get error "ORA-1031: Insufficient Privilege".
    The user2 has the priviliges "create view", "create any view", "create materialised view" etc.
    I am able to select data, of the table using the database link, but creating materialised view gives this error.
    I want to know if the user "user1" should be granting any privilige to user2, if so how is it possible as user2 dosent exist in db1!
    i.e should i give command something like "grant select on user1.table to user2@db2"(this dosent work as it says user2@db2 dosent exist, obviously as its taking user2@db2 as a username in db1 schema)
    or is this a problem with user2 priviliges in db2 database, if so what are all the priviliges that have to be given to user2 in db2 schema.
    regards,

    Hi,
    User from db1 can not assign any privs to user on db2 database. If user from db1 want to access any object from db2 database, then on local level user2 on db2 should have all the acess to required object. Then you can use user2 on db2 using dblink from db1 user to access those objects residing on remote database.
    If user1 from db1 can grant privs to user2 on db2 database on any objects on db2 database then it is highly security issue. This is not permitted.
    Regards
    e.g.
    conn userx@db2
    grant select on userx.table1 to user2;
    conn user2@db2
    select count(*) from userx.table1;
    conn user1@db1
    select count(*) from userx.table1@db2_dblink;
    Edited by: skvaish1 on Apr 29, 2010 3:57 PM

  • What are the logical database source (SQVI) should i use for quick viewer

    Dear expert,
    Would like to seek for your help, how to use (SQVI) quick viewer/SAP query to generate the listing of   and can I use SQVI -quick viewer and select the data source as logical database source to generate in order to generate the listing of GL account number,GL account descrition , tax category,posting without tax allowed column in the query by company?
    Between, what are the data source should I use for logical database to generate the query with listing of GL account number,GL account descrition , tax category,posting without tax allowed column in the query by company?
    Please help.
    Many Thanks.
    Regards,
    Karen

    Hi,
    Thank you for the prompt reply, what I would like the query to generate is the master data GL listing for GL account,GL description,Tax category, posting without tax allowed column where i use BRF as the data source for logical database to generate the quick viewver but the BRF data source do not have the GL description.
    How I can join table/join query or what are the data source should i use so that i can able to generate the query with GL master data listing by company code by display GL account,GL description,Tax category, posting without tax allowed?
    Between,do you have any reference/link/document on the how to use the SQV1?
    Also, what the difference between SQV1 and SQ01 ?
    And also what are the sap query,inforset query,quick viewer mean for and what are the difference between them also when should i use sap query,inforset query,quick viewer  to generate the query?
    Please help.
    Many thanks.
    KH

  • TS2972 I assume my Apple TV should allow me to view all events,albums and slideshows but It only allows four events to display on my TV. I'm using a Optus mini Wi Fi for my home network. Could this be the reason for limited access via my iMac computer? Ch

    I assume my Apple TV should allow me to view all events, albums and slideshows in my iPhotos app but it only allows four events and four albums to display on my television. I'm using a Optus mini Wi Fi for my home network. Could this be the reason for limited access via my iMac computer?
    Chris

    No, I have not chosen photos to share as I assumed that the Apple TV would access all photos and music that are stored on my iMac. 
    Thanks for your advice. I will check it out.
    Chris

  • What is the use of materialised view in ORACLE

    Hi All,
    What is the use of Materialised view in ORACLE.Can anyone please help me out by giving a real time example in banking application (How MV is used in banking applications).
    Thanks & Regards,
    SB2013

    SB2013 wrote:
    What is the use of Materialised view in ORACLE.Can anyone please help me out by giving a real time example in banking application (How MV is used in banking applications).http://docs.oracle.com/cd/E11882_01/server.112/e25789/schemaob.htm#CNCPT411
    Just add for example in a banking application at the end of each paragraph
    E.g.
    >
    In data warehouses, you can use materialized views to compute and store data generated from aggregate functions such as sums and averages, for example in a banking application

  • Which view object classes should be used by managed bean in ViewController?

    I just like to find out which java implementation classes created for a view object should be referenced in a managed bean on the UI side.
    For my view object InfoVO, I can create the following classes:
    View Object class: InfoVOImpl
    View Row class: InfoVORowImpl
    View Row Client Interface: InfoVORow
    View Row Client Class: InfoVORowClient
    Currently, I use InfoVOImpl and InfoVORowImpl in my managed bean so that I can use the getter methods conveniently to access the attributes with proper data types.
    I am not sure when I should use InfoVORow and InfoVORowClient instead of InfoVORowImpl.
    What are the context and reasons for using InfoVORow or InfoVORowClient instead of InfoVORowImpl?

    Hi,
    all of these are wrong. If you want to access a method exposed on a ViewObjectImpl class, the you expose the method as a clientMethod (or clientInterface) in the Java options for the View Object (or Application Module if the method is on AMImpl). You should avoid using implementation classes directly in the managed bean. If you need to access a View Object, use its interface ViewObject. If you need anything more specific than that, expose a method on the client interface after which you can access it through the binding layer.
    Frank

  • Which app should we use view photos installed by the pen drive.?

    which app shoul we use to view a photo installed by the pendrive?

    Use Preview.
    Hope that helps.

  • Materialised view runs for ever ...

    Hi
    I'd appreciate if someone could shine some light on an issue I'm having with a materialised view.
    I inherited this when I came into my current project, so before you ask me why tables are not partitioned or why a MV is being used for such a scenario, the answer is I don't know!!
    Anyway ... I'm using "Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod" running on SUSE ...
    There are a number of normalised tables two of which contain in the region of 400million rows each and tend to grow at the rate of 27000 rows per day.
    There's a materialised view (for the purposes of providing fast interactive reporting) that is setup as a normal join between 4 tables; the above two and the other two are just basic dictionary type lookups each containing around 100 or so rows.
    SELECT .... FROM LargeTable1, LargeTable2, Lookup3, Lookup4 WHERE Lookup3.ID=LargeTable1.LID and LargeTable2.ID=LargeTable1.ID and LargeTable2.LID=Lookup4.ID ;
    Running a FULL refresh on the MV failes with a 'ora-01555 snapshot too old' error after about 5 days!! Then takes around the same amount of time to rollback. Can't do a FAST refresh, I think because logs and/or mv indecies are out of sync.
    Table space is 63% full and undo space is set to auto-extend.
    I've tried /*+RULE */ but that doesn't seem to make a huge difference.
    Why does it take so long? Why does it fail? What can I do to speed it up?
    Thanks in advance for your assistance.
    Edited by: 883758 on Sep 7, 2011 2:16 PM

    You should approach this as a SQL tuning exercise, without the ability to change the query itself.
    Are table statistics up to date? Look at the execution plan – does it look reasonable for you? Are there any indexes that can help? (I am thinking covering indexes on the large tables …)
    Iordan Iotzov
    http://iiotzov.wordpress.com/

  • Materialised Views

    Oracle Version 9.2.0.2
    I'm trying to improve what is currently terrible performance with BI Beans!! I have 1 fact table with 3 dimensions, and 1 hierarchy, stored in a simple star schema.
    I've defined my metatdata using OEM.
    Reading the 9i OLAP Users Guide, you must create materialised views that are specifically for use by the OLAP API. Use the DBMS_ODB package.
    I run all 4 procedures and sucessfully generate scripts to create MV on the fact and dimensions. However, when I attempt executing the line...
    execute cwm2_olap_cube.set_mv_summary_code('SECTOR', 'CR2_DATA_CUBE', 'ROLLUP')
    I get an error that the following file is missing...
    library file /opt/oracle/product/Ora9iAS_infra/lib/libamd.so
    Anybody have any ideas, or advice about creating materialised views for the OLAP API. Are there any patches that need to be applied to 9.2.0.2, specifically for OLAP?
    Thanks in advance
    Dylan.

    I managed to generate the MV scripts using DBMS_ODB procedures, and create the actual MV in the database using these scripts. However, performance has not improved. Working with my DBA I can see that the SQL generated by the BI Beans does not utilise the MV!!!
    The query is running against the lowest level data, no query rewrite appears to have been completed.
    I generated my metadata using the Enterprise Manager (simplest approach), and I am now trying to recreate my metadata using the CWM2 procedures, in the hope that this will correctly link the materialized views with metadata, and that query rewrite will occur.
    However I am having problems with the cwm2_olap_table_map.map_facttbl_levelkey procedure.
    cwm2_olap_table_map.map_facttbl_levelkey'SECTOR', 'CR2_DATA_CUBE', 'SECTOR', 'CR2_DATA', 'LOWEST LEVEL', 'DIM:COUNTERPARTY/HIER:COUNTERPARTY_HIER/GID:COUNTERPARTY_CIS_CODE/LVL:CIS_CODE/COL:COUNTERPARTY_CIS_CODE;');
    ERROR at line 1:
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "OLAPSYS.CWM2_OLAP_TABLE_MAP", line 143
    ORA-06512: at line 1
    Can someone explain to me in simple terms, what the GID and COL parameters should contain? e.g. foreign key on dimension table etc.
    Also... the manual suggests that each dimension specification must be in the following form:
    DIM:dimname /HIER:hiername /GID:columnname /LVL:levelname/COL:columnname;
    What if I have no hierarchy on a dimension?
    Thanks in advance
    Dylan.

  • Materialised view construct

    Hi all,
    I have some queries that do a lot of calculations based on year passed from front-end.
    I am unable to figure out how could i use a materialised view so that calaculations should be done on current data rather than the entire data.
    As calculations are done based on date passed from front-end,How to convert such queries to a materialised view?
    Here is a sample query :
    select mjcd,desc1,
    bm.amt,
    nvl(sum(case when to_char(v_date,'RRRR')||
        lpad(to_char(v_date,'MM'),2,'0')='200710'
         then gross_amt end),0)monthly_amt,
    nvl(sum(gross_amt),0)progressive
       from v_billent be,mjhd mj
    ,v_bm bm
       where v_date>='01-MAR-07' and v_date<='30-OCT-07'
       and mjcd>='2011'
    and bm.fin_year='20072008'
      and mj.mjcd=be.src_mjcd(+)
      and bm.h_code(+)=mj.mjcd
       group by mjcd,desc1
    ,bm.amtorder by 1
    Kindly guide how can I use advantage of a materialised view?
    Thanks

    Materialized view are greatly used to increase the performance of pre existing aggregate queries.
    See a small example below.
    SQL> create table t
      2  as
      3  select * from all_objects
      4  /
    Table created.
    SQL> exec dbms_stats.gather_table_stats('SYSADM','T')
    PL/SQL procedure successfully completed.Now i want to execute a query like this.
    SQL> explain plan for
      2  select object_type, count(1)
      3    from t
      4  group by object_type
      5  /
    Explained.
    SQL> set linesize 250
    SQL>
    SQL> select * from table(dbms_xplan.display)
      2  /
    PLAN_TABLE_OUTPUT
    Plan hash value: 47235625
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |    21 |   168 |   374   (7)| 00:00:05 |
    |   1 |  HASH GROUP BY     |      |    21 |   168 |   374   (7)| 00:00:05 |
    |   2 |   TABLE ACCESS FULL| T    |   117K|   914K|   358   (2)| 00:00:05 |
    9 rows selected.Lets say over a period of time the data in table T has increased so much and
    i am facing a big performance problem. so to over come that i create a Materialized
    view.
    SQL> create materialized view t_mv
      2  enable query rewrite
      3  as
      4  select object_type, count(1)
      5    from t
      6  group by object_type
      7  /
    Materialized view created.Now when is issue the same query see what happens
    SQL> delete from plan_table
      2  /
    4 rows deleted.
    SQL> explain plan for
      2  select object_type, count(1)
      3    from t
      4  group by object_type
      5  /
    Explained.
    SQL> select * from table(dbms_xplan.display)
      2  /
    PLAN_TABLE_OUTPUT
    Plan hash value: 139569370
    | Id  | Operation                    | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT             |      |    31 |   744 |     3   (0)| 00:00:01 |
    |   1 |  MAT_VIEW REWRITE ACCESS FULL| T_MV |    31 |   744 |     3   (0)| 00:00:01 |
    Note
    PLAN_TABLE_OUTPUT
       - dynamic sampling used for this statement
    12 rows selected.
    SQL>instead of picking from my base table T it goes for the materialized view T_MV.
    And check out the cost it got reduced drastically.
    There is lot more than what i have said about materialized view. You can read the doc
    for more info.

  • Adobe 9.1.3 and FireFox 3.5.1+ "...can not be used to view PDF files in a Web Browser"

    This is the issue but I'm not sure there is a resolution:
    Firefox:  Version 3.5.1
    Adobe: Version 9.1.3
    When navigating the web, click a URL that opens a PDF inside the browser and you get an error * "The Adobe Acrobat/Reader that is
    running can not be used to view PDF files in a Web Browser".  Please exit Adobe Acrobat/Reader and exit your Web Browser and try again".  I did read a post that doing a "repair" from the Adobe Reader application should fix this, they also reference a few registry keys to check becuase the post states it's lost the application path to Adobe version X.  I don't necessarily buy that "fix" and here are my details below.
    In FireFox if you navigate to Tools > Options > Applications > Adobe Acrobat Document
    You're given choices:
    Always ask:  DOES NOT WORK, produces afore mentioned error *
    Save File:  Works, saves the file to a directory on your PC
    Use Adobe Reader 9.1 (defau...:  Works, opens your PDF's outside of your web browser
    Use Adobe Acrobat (in Firefox):  DOES NOT WORK, produces afore mentioned error *
    Use other...:
    IE seems to just work as expected.
    If you open Adobe Reader > Edit > Preferences > Internet > Check "Display PDF in browser" - DOES NOT WORK, produces afore mentioned error *
    This would seem to be an Adobe error rather than a FireFox web browser problems since FireFox does seem to know the correct path although I suppose you can't rule out that this is a FireFox problem since 2 out of the 4 PDF open options DON'T WORK.
    Any thoughts on this issue would be greatly appreciated.
    Other information:
    Adobe 8.1.5 works perfectly with FF 3.5.1+ when opening PDF's in the web browser, we also had no problems with previous versions either.
    MSI push via Active Directory from Adobe 8.1.5 upgrade to Licensed Distribution I signed up for, Adobe 9.1.3 which was upgraded from 9.1.0, to 9.1.2, to 9.1.3 via an MSP patch.
    Operating system:  Windows XP SP 2, plenty of RAM, plenty of Drive
    IE version this works with the new version of Adobe 9.1.3 is version 7 (7.0.5730.13)
    Our FireFox MSI's come from Front Motions website and as far as I know we've never had problems with their MSI's, also tried the new release of FF 3.5.2 from their website.
    I think that about covers it.  Anyone else experiencing the same problems or have a patch?

    After troublshooting this for the entire day today the issue seems to be a MIME problem.
    If everything is woking perfectly, in Tools > Options > Applications...
    You should see 4 or more things related to Adobe like "Adobe Acrobat Forms Document", etc.  If you don't see at least 4 MIME entries either your Adobe installation is hosed or your FF installation is hosed.  I haven't figured out which is causing the issue.
    What I did was remaster my patches from my original Adobe 9.1.0 MSI with the two updates via the command line in the directories with the source files.  On the 9.1.0 original file I first remastered my MST transform with the Adobe MST utility.  I then applied my patches.
    msiexec /a AcroRead.msi /p AdbeRdrUpd912_all_incr.msp
    msiexec /a AcroRead.msi /p AdbeRdrUpd913_all_incr.msp
    I then uploaded that to my network share, unlinked my group policy, made a new group policy, added a batch file to delete adobe.com from program file and the desktop on system startup even though my MST was supposed to take care of that - it's not a perfect world is it?  :-)
    I then reapplied my GPO's for both FireFox 3.5.2 and Adobe 9.1.3, I checked to make sure the MIME extensions were there and they were.  You might have to go into your Adobe Preferences and select that open in browser setting depending on what happens or adjust your MIME settings in FireFox's options but it should work.
    That's what worked for me.  It's possible a few other things I did along the way tweaked it out, in my group policy on the first run I did select to upgrade previous group policies, for the remaster and repush I didn't select any previous GPO's to upgrade.
    It's hard to tell what one thing tweaked it out or what combination of things tweaked out the install.  I did also reinstall Adobe 8.1.5 and FF 3.0.10 before doing all this since our machines currently have that setup, I'm not sure if that affected it either, it's just hard to tell but I don't think it did simply because I had done that several times in troubleshooting this issue.
    If anyone else has more specifics that would be great!

Maybe you are looking for