Oracle Materialized View Manual Refresh

By M&S Consulting (Ashok) on Nov 9th, 2005
Filed Under Technical Tips // Tags:

Following is the call that can be made to refresh your materialized view in Oracle manually:

1
execute DBMS_SNAPSHOT.REFRESH('[MV_NAME]','[refresh_option]');

Refresh Options:

  • ? - Uses default
  • F or f - Fast
  • C or c - Complete
  • A - Always complete
Bookmark and Share

Related Information:

  1. Oracle Materialized View DDL
    Are you a TOAD fanatic when it comes to “anything-Oracle”? If so, you probably realized that TOAD will not show...
  2. Oracle BPA -> BPEL Manual Configuration Items
    Oracle BPA does a great job importing into BPEL, but here are a few items that need to be manually...
  3. Oracle IdM - SAML SSO with Google Apps
    We recently integrated Oracle IdM with the SAML SSO Service from Google Apps. Now customers can continue to authenticate against...
  4. Google Apps Reporting API - Not quite this easy with Exchange
    I have been somewhat enamored by Google Apps and its potential. Many enterprises have been happy with Exchange for mail,...
  5. Google Custom Search Engine (CSE)
    The site search game is changing with Google CSE....
  6. Is your city doing enough? Taking Branding, Marketing, Promotion, Contest Strategy To New Levels
    We all heard about Topeka’s unprecedented name change to Google. But ironically, to me, Google’s logo change to Topeka today...

One Response to “Oracle Materialized View Manual Refresh”

  1. Sanjay J. Khachane
    Dec 09, 2009
    Reply

    Dear all,
    This is Code For Refresh Materialized in .NET
    Public Sub RefreshMView()
    Dim tran As OracleTransaction
    Dim Con As String = “Data Source=” & ServerName & “;User ID=” & UserName & “;Password=” & Pwd & “;Unicode=True”
    Dim Conn As New OracleConnection(Con)
    Try
    Conn.Open()
    tran = Conn.BeginTransaction
    Dim cmd As New OracleCommand()
    cmd.Connection = Conn
    cmd.Transaction = tran
    cmd.CommandType = CommandType.StoredProcedure
    cmd.CommandText = “refresh_P_V_PO_QTY”
    cmd.ExecuteNonQuery()
    tran.Commit()
    Conn.Close()
    cmd = Nothing
    Catch ex As Exception
    tran.Rollback()
    Finally
    Conn.Close()
    End Try
    End Sub

    //Procedure in ORACLE For Refresh Materialized View in VB.NET
    CREATE PROCEDURE refresh_P_V_PO_QTY
    IS
    v_error_code NUMBER;
    v_error_message VARCHAR2 (400);
    v_date DATE;
    BEGIN
    /*Materialized 1*/
    dbms_mview.refresh(’V_SCH_QTY’,'C’);
    COMMIT;
    /*Materialized 2*/
    dbms_mview.refresh(’V_DISP_QTY’,'C’);
    COMMIT;
    /*Materialized 3*/
    dbms_mview.refresh(’V_PO_QTY’,'C’);
    COMMIT;
    /*Materialized 4*/
    dbms_mview.refresh(’V_PO_DETAIL’,'C’);
    COMMIT;
    EXCEPTION
    WHEN OTHERS
    THEN
    v_error_code := SQLCODE;
    v_error_message := SUBSTR (SQLERRM, 1, 100);
    DBMS_OUTPUT.put_line ( ‘mv_opbyiss_temp_or:-’
    || ‘ Date:’
    || v_date
    || ‘ ‘
    || v_error_code
    || ‘ ‘
    || v_error_message
    );
    END;



Leave a Reply


Archives

Recent Comments

  • Tony Hale said: What a great resource these videos are! These are all very helpful. Anything you can do to popularize...
  • Mohammed said: Hello, Thanks for the tutorial, but I’ve noticed that the link isn’t setup right,...
  • shekar said: thanks mate, you saved my day… the link is still working….
  • romit said: thnx a lot.. i had been searching for this link from last 4 days. and was just about to quit my search...
  • Ram said: By the way, FB 4 includes both SDK 4 and 3. Therefore if you are looking for FB 3, download FB 4 and point...

Calendar

September 2010
M T W T F S S
« Jul    
 12345
6789101112
13141516171819
20212223242526
27282930  

Featured Testimonial

"M&S has taken 'partnership' to a new level. They are not only a deeply skilled service provider, the M&S team is actually a mission critical component to our operations, taking on new initiatives as well as maintaining custom, open source, and COTS solutions."

CEO, MedPivot

Free SQL Service