Solved

how do I configure a materialized view when I want to use the refresh command

Posted on 2009-05-07
1
532 Views
Last Modified: 2013-12-18
I have a materialized view:

CREATE MATERIALIZED VIEW
   BIB_HOLDINGS_MVIEW
AS
    SELECT SITE||'-' ||PDF_NAME as ACCESSION_NUMBER, ID, SITE, PDF_NAME, PDF_EXISTS, TITLE, SUBJECTKEYWORDS, IAC_REPORT_ID, CATEGORY, TYPE, LOCATION, AUTHOR, PUBLISHER, PUBLICATION_DATE, COPIES, CLASSIFICATION, ORG_PERFORMING, SECONDARY_DIST, ORG_MONITORING, ABSTRACT, ABSTRACT2, NUM_PAGES, COMMENTS, ENTERED_BY, COPYRIGHT_EXISTS, DISTRIBUTION_CODE, COPYRIGHT_INFO, SUPPLEMENTARY_NOTES, MODIFIED_DATE, HIERARCHY_1, HIERARCHY_2, HIERARCHY_3, HIERARCHY_4, HIERARCHY_5, HIERARCHY_6, CONTRACT_GRANT_ID, AD_ID, PERFORMING_REPORT_ID, MONITOR_REPORT_ID, PURCHASE_PRICE, PURCHASE_INFO, FILE_NAME, EXPORT_CONTROL, FOR_PAY, OTHER_CLASSIFICATION_MARKINGS, EXTRA_TEXT_FIELD1, EXTRA_TEXT_FIELD2, EXTRA_TEXT_FIELD3, EXTRA_TEXT_FIELD4, EXTRA_TEXT_FIELD5, EXTRA_DATE_FIELD1, EXTRA_DATE_FIELD2, EXTRA_NUMBER_FIELD1, EXTRA_NUMBER_FIELD2 from bib_holdings where site in ('AMMTIAC','CBIAC','CPIA', 'DACS','HSIAC','IATAC', 'MSIAC', 'RIAC','SENSIAC','SURVIAC','WSTIAC');

The client wants to control when a refresh is done on it. by using this command in a unix cron job execute DBMS_MVIEW.REFRESH('tems_adm.BIB_HOLDINGS_MVIEW','F');

How should I word the materialized view so that it will allow for this command to succeed?
CREATE MATERIALIZED VIEW
   BIB_HOLDINGS_MVIEW
AS
    SELECT SITE||'-' ||PDF_NAME as ACCESSION_NUMBER, ID, SITE, PDF_NAME, PDF_EXISTS, TITLE, SUBJECTKEYWORDS, IAC_REPORT_ID, CATEGORY, TYPE, LOCATION, AUTHOR, PUBLISHER, PUBLICATION_DATE, COPIES, CLASSIFICATION, ORG_PERFORMING, SECONDARY_DIST, ORG_MONITORING, ABSTRACT, ABSTRACT2, NUM_PAGES, COMMENTS, ENTERED_BY, COPYRIGHT_EXISTS, DISTRIBUTION_CODE, COPYRIGHT_INFO, SUPPLEMENTARY_NOTES, MODIFIED_DATE, HIERARCHY_1, HIERARCHY_2, HIERARCHY_3, HIERARCHY_4, HIERARCHY_5, HIERARCHY_6, CONTRACT_GRANT_ID, AD_ID, PERFORMING_REPORT_ID, MONITOR_REPORT_ID, PURCHASE_PRICE, PURCHASE_INFO, FILE_NAME, EXPORT_CONTROL, FOR_PAY, OTHER_CLASSIFICATION_MARKINGS, EXTRA_TEXT_FIELD1, EXTRA_TEXT_FIELD2, EXTRA_TEXT_FIELD3, EXTRA_TEXT_FIELD4, EXTRA_TEXT_FIELD5, EXTRA_DATE_FIELD1, EXTRA_DATE_FIELD2, EXTRA_NUMBER_FIELD1, EXTRA_NUMBER_FIELD2 from bib_holdings where site in ('AMMTIAC','CBIAC','CPIA', 'DACS','HSIAC','IATAC', 'MSIAC', 'RIAC','SENSIAC','SURVIAC','WSTIAC');

Open in new window

0
Comment
Question by:sikyala
1 Comment
 
LVL 20

Accepted Solution

by:
gatorvip earned 500 total points
ID: 24329916
create materialized view
...
REFRESH ON DEMAND
...
as
...


see here:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_6002.htm#i2106785
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
data lookup in Oracle - need suggestions 55 121
Oracle dataguard 5 47
Oracle Insert not working 10 32
Oracle cursor lifecycle inside procedure. 2 13
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question