How to alter the materialized view defintion with -- For update clause

My db version is 9.2.0.3
My orginal materialized view difination does not have "for update " clause.
how can i alter the mview defination to inclused and exclude the "for update" clause.
I dont want to drop and recreate the mview with for update clause. But I what to change the existing definition.
Please suggest.
Thanks
Naveen.

I already have the view definition in place. I want to change the exising defination, by adding the "for update " clause. Is it possible with any " alter mview ... " syntax.
Below is my existing syntax. I don't what to drop and recreate. Just want to alter the existing definition , with for update clause.
create materialized view test
pctfree 0
tablespace DATA storage (pctincrease 0)
build immediate refresh start with sysdate next (trunc(sysdate+1) +1/24)
with primary key
disable query rewrite
as select * from test@isource;
Please suggest!
Thanks
Naveen
Edited by: user12096071 on Apr 8, 2010 2:56 PM

Similar Messages

  • Cursor with for update clause problem

    Hi all,
    We are having this problem with Oracle 8.1.7 where in we have a cursor with for update clause. The PL/SQL script used to work fine with Oracle 8.0.5 but is causing problems with Oracle 8.1.7. What the script is ending up doing in 8.1.7 is that it updates only one record instead of updating close to 60000 which it used to do in Oracle 8.0.5
    The script just hangs after updating one record. We have replicated the same problem.
    Has anyone seen this error before and attained resolution?
    Thanks

    Hello ,
    I have found the same / very close to the same problem. I tried the code below in Oracle 10.2.0.1 and got the following error after the first loop.
    ORA-01002: fetch out of sequence
    ORA-06512: at "DEMO_TEST_RESEARCH_PKG", line 18
    ORA-06512: at line 7
    After trying to debug it , i thought i would try it in Oracle 9.0.2.0.7.0 , and to my suprise it worked fine.
    Am i missing something ? Thanks in advance , ...
    I have included the code i was running ...
    PROCEDURE WhereCurrentOf(Param1 IN NUMBER) IS
    v_title_eng ISSUES.TITLE_ENG%TYPE;
    v_issue_id ISSUES.ISSUE_ID%TYPE;
    CURSOR issues_cur
    IS
    SELECT issue_id,title_eng
    FROM issues
    WHERE title_eng IS NULL
    FOR UPDATE OF title_eng;
    BEGIN
    FOR i IN issues_cur
    LOOP
    FETCH issues_cur INTO v_issue_id,v_title_eng;
    EXIT WHEN issues_cur%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE(v_issue_id||' This was the english title before : '||v_title_eng);
    v_title_eng := 'This is my title';
    UPDATE issues
    SET title_eng = v_title_eng
    WHERE CURRENT OF issues_cur;
    DBMS_OUTPUT.PUT_LINE(v_issue_id||' This is the english title after : '||v_title_eng);
    END LOOP;
    END WhereCurrentOf;

  • How to unlock a row if i use FOR UPDATE clause

    In procedure if we use FOR UPDATE clause, it will lock particular row and allow only one client to update whereas other client can only fetch data in the same row at that time.
    My question is when will it unlock the row, what should we do to unlock the row while writing procedure. Take this example here im using FOR UPDATE clause for client_count, when ll it unlock that particular row in this procedure.
    create or replace PROCEDURE newprocedur(inMerid IN VARCHAR2,outCount OUT NUMBER) AS
    CURSOR c1 IS
    select CLIENT_COUNT from OP_TMER_CONF_PARENT where MER_ID = inMerid FOR UPDATE OF CLIENT_COUNT;
    BEGIN
    Open c1;
    loop
    fetch c1 into outCount;
    exit when c1%NOTFOUND;
    outCount:=outCount+1;
    update OP_TMER_CONF_PARENT set CLIENT_COUNT = outCount where current of c1;
    end loop;
    close c1;
    END;

    Hi,
    Basically you are incrementing client_count by 1 , Why you have to fetch row one by one and update? you could just finish that in a single update
    UPDATE OP_TMER_CONF_PARENT
    SET CLIENT_COUNT = CLIENT_COUNT+1
    WHERE MER_ID     = inMerid This will increment client_count of all rows by one for the given mer_id;
    After updating you have to make the changes permanent so that other users will see the changes you have made.
    To lock the row before update you can use same select statement in you cursor
    SELECT CLIENT_COUNT
    FROM OP_TMER_CONF_PARENT
    WHERE MER_ID = inMerid FOR UPDATE OF CLIENT_COUNT;You can further modify the procedure to let other users know if the row is being updated.
    Regards
    Yoonas

  • How to reserve the material ( Make to Stock) for selective customers?

    Dear Friends,
    I want to reserve the material which is a Make to Stock for selective customers i.e if the customer base is 100 I want to reserve the certain quantity for 3 customers.
    It is a Make to Stock.
    Thanks in advance.
    Regards,
    Shrikant

    Dear Friend
    First you have to create sales orders for these three customers
    There are three ways of doing this
    1. T code MB1B use movement type 412 E and input your sales order no
    Stocks will be reserved for this order
    Your item category should be marked E in special stock indicator
    This is the perfect way of doiung it
    Suppose if the order gets cancelled stocks can be moved back to unrestricted using  T code MB1B use movement type 411 E
    2.Create sales order and then delivery and save dont do picking and PGI
    Stocks will be reserved for this delivery
    3.In t code OVZ9 if you have ticked include sales requirements then for whatever sales orders created stocks will be reserved for them
    But this is soft way of handling as thro backorder processing the stocks can be allocated to other orders
    Regards
    Raja

  • Getting ORA-22920 Error With 'FOR UPDATE' clause

    Hello all,
    I scanned through all the messages regarding this error and the suggestion posted was to have 'FOR UPDATE' in the SELECT query. I do have that, but I am still getting ORA-22920 (row containing the LOB value is not locked) error.
    I am using JDBC thin driver with 8.0.5. I know the thin driver installation works because I can read data that I inserted using 'INSERT INTO ...' from svrmgr30.
    Can anyone show me some light on this?
    Thanks
    Suresh

    Hi,
    This helped me:
    Before the insert statement:
    connection.setAutoCommit(false);
    ..what you like to do
    at the end..
    connection.commit()
    HTH
    Martin

  • How to find the material received in warehouse for work order through table

    Dear All ,
    I am creating alerting system We have  requrirement that if the notification or work order is pending for 10 days then alert to be sent to planner and 20 days to his senior and 30n days to his senior
    We have created FM for this  every day program will run and check open work orders and notification pending for some days
    Now my question in the FM I want to add fields for material receipt
    Idea is say for refuebsihment order pending material is received in warehouse now when this is received alert to be send in the work order planner that material is arrived
    From which tables I can track this and how to know for the alerting system that material is arrived in warehouse so alert to be send
    please reply
    Regards
    pratap
    Edited by: Pratap bhikai  Ingole on Jun 5, 2010 9:20 AM

    Hi ,
    With reference to your second point , if your looking for some alret then whenever you have goods receipt or goods issue of stock material you can have a mail triggerred through workflow .. in our project what we did was , we had a user status ALMR - All Material received and this is SET by a  Z programme which checks whether all stock materials or non stock materials against the order have been received and sets the user status and this programme is run as a batch job with 30min frequency ....
    regrds
    pushpa

  • Working with FOR UPDATE

    Hi,
    i have 2 session(A, B) and trying to execute sql statement with For update clause
    Session A
    select * from emp where empid in (10) for update nowait;
    Session B
    select * from emp where empid in (10, 20) for update nowait;
    my question is after executing select statement in sessin B will oracle locks
    empid =20 or it will ignore the lock as part of it (empid=10) is already locked by
    session A.
    Can anyone plz help me in this..
    Rds,
    Naga

    Why not try it out?:
    Session A:
    SQL> select empno,ename from emp where empno in (7788) for update nowait;
         EMPNO ENAME
          7788 SCOTTSession B:
    SQL> select * from emp where empno in (7788,7900) for update nowait;
    select * from emp where empno in (7788,7900) for update nowait
    ERROR at line 1:
    ORA-00054: resource busy and acquire with NOWAIT specifiedSesson A again:
    SQL> select empno,ename from emp where empno in (7900) for update nowait;
         EMPNO ENAME
          7900 JAMES

  • How to get a materialized view get to refresh itself after the job is "broken"

    we created a materialized view sometime ago with the following statement:
    create materialized view SXV_PUB_EMPLOYEE_CERT_ALL_M
    refresh complete on demand
    start with to_date('30-08-2009 04:00:00', 'dd-mm-yyyy hh24:mi:ss') next trunc(sysdate) + (28/24)
    as
    select  sxv_emp_cert_all.*
    from    sxv_employee_certification_all sxv_emp_cert_all;
    this week we found out it had not been refresh for about a month
    In dba_jobs the column broken was 'Y', next_date time something like 01-01-4000 and failures 16
    when I ran it manually by executing
    BEGIN DBMS_MVIEW.REFRESH('SXV_PUB_EMPLOYEE_CERT_ALL_M', 'C'); END;
    I found that one of the columns was too small (probably a columns of one of the underlying tables had been extended since the creation of the materialized view)
    After fixing this I ussied yesterday (on 29-8-2013) the statement :
    alter materialized view SXV_PUB_EMPLOYEE_CERT_ALL_M
    refresh complete on demand
    start with to_date('30-08-2009 04:00:00', 'dd-mm-yyyy hh24:mi:ss') next trunc(sysdate) + (28/24)
    after this the table dba_jobs showed me 30-08-2013 04:00:00 as next date
    I was expecting it to run this night at 04:00, but it didn't
    the last_date column value was still from about a month ago, the column broken still shows 'Y'
    and the next date 30-08-2013 04:00:00 (while it should been set to 31-08-2013 01:00:00
    Rrunning
    BEGIN DBMS_MVIEW.REFRESH('SXV_PUB_EMPLOYEE_CERT_ALL_M', 'C'); END;
    gave no errors this time
    and in User_Mview_Analysis the last_refresh_date column showed the date/time I had executed it
    Any idea how to get the job "unbroken" again so that the view refreshes itself every night?
    the database is Oracle Database 10g Release 10.2.0.4.0
    regards,
    Remco

    thanx for all your helpful and correct answers . but eventually I found it myself
    exec dbms_job.broken(<jobnumber>, false);

  • How can I fast refresh the  materialized view !!

    I created a MV base on some tables in order to improve the querey speed.
    but the mv I have created falied to refresh fast.
    because there are two same table in the from clause:
    jcdm jc1,jcdm jc2
    create materialized view temp_mv
    nologging
    pctfree 0
    storage (initial 2048k next 2048k pctincrease 0)
    parallel
    build immediate
    refresh force
    on demand
    as
    select
    TAB_GSHX.rowid hx_rid,
    TAB_GSHD.rowid hd_rid ,
    JC1.rowid jc1_rid ,
    JC2.rowid jc2_rid ,
    YSHD_ID     HXID,          
    JC1.JCDM     QFD,     
    JC2.JCDM     JLD     
    FROM
    TAB_GSHX,
    TAB_GSHD,
    jCDM JC1,
    JCDM JC2
    WHERE
    YSHD_ID=YSHX_ID
    AND YSHD_QFD=JC1.JBJC_ID
    AND YSHD_JLD=JC2.JBJC_ID
    AND TO_CHAR(YSHX_time,'YYYYMMDD')='20030101'
    the column msgtxt of the table MV_CAPABILITIES_TABLE is :
    "the multiple instances of the same table or view" and " one or more joins present in mv".
    How can I succeed in fast refresh the above temp_mv!!!
    thanks.

    lianjun,
    When you are using Oracle9i there is a procedure which can help you setup the materialized view. If some option isn't working it gives you hint why it doesn't work.
    The procedure is dbms_mview.explain_mview.
    Take a look at the documentation how to use it. (In the Oracle9i DWH guide the package is explained.)
    Hope this helps
    With kind regards,
    Bas Roelands

  • How to extend the costing view for a material

    How to extend the costing view for a material

    Use MM01 Trxn code and Select Material and Select Costing Views and Maintain, Save it.
    Else Use MM50 and Select Material and Mainenance Status as G Costing and Execute, Maintain & Save.

  • Materialized View creation with REFRESH FAST

    Hello ,
    Please see below case,
    TABLE A1(partitioned range+list)
    COLUMN C1  -- Primary key
    COLUMN C2  -- NUMBER
    TABLE D1
    COLUMN C1 -- PRIMARY KEY
    created MV log as below
    CREATE MATERIALIzED VIEW LOG ON A1 WITH ROWID,PRIMARY KEY INCLUDING NEW VALUES;
    CREATE MATERIALIzED VIEW LOG ON D1 WITH ROWID,PRIMARY KEY INCLUDING NEW VALUES;
    Trying to create MV like below:
    CREATE MATERILIZED VIEW mv1test
                                    REFRESH FAST ON COMMIT
    AS
    Select
    FROM A1,
                            D1
                    WHERE A1.C1 = D1.CI
    AND A1.C2 IS NOT NULL;
    It gives below error message:
    ORA-12052: cannot fast refresh materialized view schema.mv1test
    12052. 00000 -  "cannot fast refresh materialized view %s.%s"
    *Cause:    Either ROWIDs of certain tables were missing in the definition or
               the inner table of an outer join did not have UNIQUE constraints on
               join columns.
    *Action:   Specify the FORCE or COMPLETE option. If this error is got
               during creation, the materialized view definition may have be
               changed. Refer to the documentation on materialized views.
    However ,as discussed in earlier thread i checked all general restrictions of the 'Refresh fast' approach for join.
    Restrictions on Fast Refresh on Materialized Views with Joins Only
    Defining queries for materialized views with joins only and no aggregates have the following restrictions on fast refresh:
    1) They cannot have GROUPBY clauses or aggregates.
    2) Rowids of all the tables in the FROM list must appear in the SELECT list of the query.
    3)Materialized view logs must exist with rowids for all the base tables in the FROM list of the query.
    4)You cannot create a fast refreshable materialized view from multiple tables with simple joins that include an object type column in the SELECTstatement.
    As per above restrictions ,
    1) Group by clause is not present
    2)i do not understand 2nd point , i have added a1.rowid  and d1.rowid in  select statement of MV, but got same error.
    3) observed same as 2nd point.
    4)we have CLOB column in select list. Tried removing this column but got same error.
    Please do let me know any workaround on this.
    Thanks in advanced ..
    PM

    Basic Materialized Views show how to analyse MVs using dbms_mview. I'm not sure about creating MVs on partitioned tables, that partition maintenance might cause problems

  • Error on compile the Materialized view refresh

    Hello all,
    I am getting issue while compile the Materialized view refresh.
    ALTER MATERIALIZED VIEW FII_GL_AGRT_SUM_MV COMPILE;--( did successfully)
    exec DBMS_MVIEW.REFRESH('APPS.FII_GL_AGRT_SUM_MV','C');
    Error:
    ORA-12008: error in materialized view refresh path
    ORA-01013: user requested cancel of current operation
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2545
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2751
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2720
    ORA-06512: at line 1
    Please tell me what could be the issue
    Thanks and Regards,
    Muthu

    Hello all,
    I am using R12.1.3.
    While execute the below command, its not completing..
    exec DBMS_MVIEW.REFRESH('APPS.FII_GL_AGRT_SUM_MV','C');
    I found the reason why its not completing. Because its Refresh In Progress.
    SQL> select u.name owner,o.name mview_name, s.obj#,lastrefreshdate
    *2 from sys.obj$ o, sys.sum$ s, sys.user$ u*
    *3 where u.user# = o.owner# and o.obj# = s.obj# and o.type# = 42 AND bitand(s.mflags, 8) = 8;*
    OWNER                          MVIEW_NAME                           OBJ# LASTREFRE
    APPS                           FII_GL_AGRT_SUM_MV                 438268 06-MAR-13
    SQL> select decode(bitand(s.mflags,8), 8,'Refresh In Progress','Not being refreshed')
    *2 from sys.obj$ o, sys.user$ u, sys.sum$ s*
    *3 where o.obj# = s.obj# and o.owner# = u.user# and o.type# = 42*
    *4 and o.name='FII_GL_AGRT_SUM_MV';*
    DECODE(BITAND(S.MFL
    Refresh In Progress
    How to stop Refreshing or is there any other solution for this issue?
    Please clarify me...
    Thanks and Regards,
    Muthu

  • Materialized View hangs with SELECT MAX

    Hi there,
    I'm using Oracle 10.2.0.4 on a 64bit AIX system and I am having issues with creating a materialized view.
    We have a large (1Tb) database and the large table the materialized view looks at is 200m rows.
    I've created 5 other materialized views each with a select max clause and all looking at the same table.
    When I created my problem MV I forget the select max and it created in 22mins.
    I corrected my error by putting in the select max clause (so as to retrieve the top record) and the create MV ran for 16hrs+, I killed it.
    If I just run the select statement at a sqlplus prompt it runs through in 22mins, if I create another object e.g. a table from the query it creates in 22mins.
    So the question would be, why can I not create a MV using SELECT MAX on 10.2.0.4?
    If I've missed any details don't hesitate to ask.
    Thanks in advance.

    Hi Justin,
    Thank you for your reply.
    It has been upgraded to 9.2.0.8.0 from 9.1.... I'm not aware about the procedure used.
    I could see a job scheduled for the materialized view , but that fails and it's broken after 16 attempts.
    How to log the error generated by the Refresh Job?
    Recreating the View - After the upgrade I have created the Materialized view again. Object T1 exists in the user schema User1.
    I'm not explicitly getting any error but the refresh doesn't happens , so I couldn't find any records in the materialized view.
    Thanks
    GM

  • How to change the default view of published iCal's URL

    I am publishing an iCal for a nonprofit group and link to the calendar from the group's website. The default URL given (in the send publish email option) leads to the week view of the current week. I would prefer the link to take site visitors to the month view of the calendar. If I go to the month view and copy the URL for it, and use that for the link, I have to change the URL each month, because the URL that comes from the month view will only show the month it was at the time I copied the URL -- it will not change with the new month. Does anyone have any idea of how I can change the URL so that it leads to the month view of whatever the current month is?
    I should note that I know how to change the default view in the my browser, but I would rather not have to explain how to do this to all the people viewing the calendar -- just wanting the correct month view to show up when they click the link, without having to change it each month.
    I would be so grateful if anyone has some insight on this!
    Thanks.

    Carlo,
    The fact that this question has been left unanswered for over 2 months seems a little negligent on the part of Apple Support.
    This Forum is unfortunately not Apple Support. According to Apple:
    What is Apple Discussions and how can it help me? 
"Apple Discussions is a user-to-user support forum where experts and other Apple product users get together to discuss Apple products. You'll find a wealth of information about your favorite Apple hardware and software products that will help you get the most out of your purchase. You can participate in discussions about various products and topics, find solutions to help you resolve issues, ask questions, get tips and advice, and more.
    If you have a technical question about an Apple product, be sure to check out Apple's support resources first by consulting the application Help menu on your computer and visiting our Support site to view articles and more on our product support pages."
    In direct response to your questions, I would say that (as observed by the OP) anyone who subscribes to a published calendar can make a change to their desired view using the "Preferences" icon which is displayed underneath the mini-month calendars.
    There is no way that I know of to directly or conveniently change the time-range. There may be workarounds, but I could not find a suitable solution for you.
    I would recommend that you provide iCal Feedback, if you are interested in informing Apple of your desires.
    ;~)

  • "I would like to know how to set the default view for the columns. Somewhere I read it could be done in by music icon under Library.  Can't find it.  Thanks

    "I would like to know how to set the default view for the columns that are shown in iTunes. Every time I open it, I have to either go to the options, or right-click to get the pop-up options, and delete "rating" and add "composer." I'd really like to just do it once and be done with it."  Somewhere I read you could do this by clicking on the Music icon under LIBRARY then arramge the columns.  Trouble is, I can't find a Musi Folder or icon in my user library.
    Any help would be appreiated.  OSX 10.9.2  iTunes version 11.1.5  Thanks!!! CW!

    From the iTunes menu bar try View>Show View Options.  Make sure what you want to see is checked and what you don't is unchecked.  You can do this (may need to do this) for any playlists, your main Library, etc.
    Good luck
    srb

Maybe you are looking for

  • Adobe reader cannot extract embedded font after pdf sent via outlook

    We have some pdf files that open fine in Adobe Reader 9.1.3.  Once we send them via e-mail (we use Outlook 2003), they will not open properly with the error message: "Cannot extract the embedded font 'TWDWSP+TradeGothic-Light.  Some characters may no

  • Query for next record in a multiple records display

    Hi. I have a text item whose data block displays 10 records after post query. I want to put a query on the keyboard up and down button so that when i press the up or down arrow of the keyboard, the cursor moves to the next record and executes the pos

  • I cant install lexmark 7100 series printer to my computer

    I have an older printer, a Lexmark X7170 that I have tried to install but my computer wont let me install it. do I need a newer printer??? This question was solved. View Solution.

  • ** Desktop Not Recognizing Cursor **

    *Cursor Problems:* - When cursor is moved in hidden Dock, Dock does not appear - Can't open files, applications - Can't use menu bar The only thing that is working properly is the cursor moving about, other then that, it's useless. I've tried restart

  • Trying to install CS5.5 with no CD

    I downloaded two files (7z and exe) because I lost my cd for CS5. When I open the .exe nothing happens. It says extracting files but no new window opens prompting to install CS5 or anything. What do I do  now? I have the product key and serial number