WELCOME, GUEST
Search in Topic Titles
Welcome to Knowledge Xpert for Oracle
Knowledge Xpert for Oracle Administration
Oracle Architecture
Database Administration
Database Tuning
Network Management
SQL Reference
Regular Expressions in Oracle
Quote Character Assignment
Built-in Packages
DBMS_ALERT
DBMS_ADDM
DBMS_APPLICATION_INFO
DBMS_APPLY_ADM
DBMS_AQ
DBMS_AQADM
DBMS_AQELM
DBMS_ASSERT
DBMS_AUTO_TASK_ADMIN
DBMS_CAPTURE_ADM
DBMS_COMPARISON
DBMS_CUBE
DBMS_CUBE_ADVISE
DBMS_DB_VERSION
DBMS_DDL
DBMS_DEBUG
DBMS_DEFER
DBMS_DEFER_QUERY
DBMS_DEFER_SYS
DBMS_DESCRIBE
DBMS_ERRLOG
DBMS_EXPORT
DBMS_FGA
DBMS_FLASHBACK
DBMS_IOT
DBMS_JOB
DBMS_LOB
DBMS_LOCK
DBMS_LOGMNR
DBMS_LOGMNR_CDC_PUBLISH
DBMS_LOGMNR_CDC_SUBSCRIBE
DBMS_LOGMNR_D
DBMS_LOGSTBY
DBMS_METADATA
DBMS_MVIEW
DBMS_MVIEW - Overview
Programs
DBMS_MVIEW.BEGIN_TABLE_REORGANIZATION
DBMS_MVIEW.REFRESH
DBMS_MVIEW.REFRESH_ALL_MVIEWS
DBMS_MVIEW.REFRESH_DEPENDENT
DBMS_MVIEW.REGISTER_MVIEW
DBMS_MVIEW.UNREGISTER_MVIEW
DBMS_MVIEW.ESTIMATE_MVIEW_SIZE
DBMS_MVIEW.END_TABLE_REORGANIZATION
DBMS_MVIEW.EXPLAIN_MVIEW
DBMS_MVIEW.EXPLAIN_REWRITE
DBMS_MVIEW.I_AM_A_REFRESH
DBMS_MVIEW.PMARKER
DBMS_MVIEW.PURGE_DIRECT_LOAD_LOG
DBMS_MVIEW.PURGE_LOG
DBMS_MVIEW.PURGE_MVIEW_FROM_LOG
DBMS_OBFUSCATION_TOOLKIT
DBMS_OFFLINE_OG
DBMS_OFFLINE_SNAPSHOT
DBMS_OLAP
DBMS_ORACLE_TRACE_AGENT
DBMS_ORACLE_TRACE_USER
DBMS_OUTLN
DBMS_OUTPUT
DBMS_PCLXUTIL
DBMS_PIPE
DBMS_PREPROCESSOR
DBMS_PROFILER
DBMS_RANDOM
DBMS_RECTIFIER_DIFF
DBMS_REDEFINITION
DBMS_REFRESH
DBMS_REPAIR
DBMS_REPCAT
DBMS_REPCAT_ADMIN
DBMS_REPCAT_AUTH
DBMS_REPCAT_INSTANTIATE
DBMS_REPCAT_RGT
DBMS_REPUTIL
DBMS_RESOURCE_MANAGER
DBMS_RESOURCE_MANAGER_PRIVS
DBMS_RESULT_CACHE
DBMS_RESUMABLE
DBMS_RLS
DBMS_ROWID
DBMS_RULE
DBMS_RULE_ADM
DBMS_SESSION
DBMS_SHARED_POOL
DBMS_SNAPSHOT
DBMS_SPACE
DBMS_SPACE_ADMIN
DBMS_SPM
DBMS_SQL
DBMS_STANDARD
DBMS_STATS
DBMS_STORAGE_MAP
DBMS_STREAMS
DBMS_STREAMS_ADM
DBMS_STREAMS_ADVISOR_ADM
DBMS_SYSTEM
DBMS_TRACE
DBMS_TRANSACTION
DBMS_TRANSFORM
DBMS_TTS
DBMS_UTILITY
DBMS_WORKLOAD_CAPTURE
DBMS_WORKLOAD_REPLAY
DBMS_WORKLOAD_REPOSITORY
DBMS_XPLN
UTL_FILE
UTL_HTTP
UTL_RAW
UTL_REF
SQL Functions
SQL *Plus
SQL Statements
Keyword Reserved Words
ANSI Reserved Words
SQL Reserved Words
SQL Coding Best Practices
Instant Scripts
Disclaimer
Knowledge Xpert for PL/SQL Development
Knowledge Xpert Feedback

DBMS_MVIEW.REFRESH

This procedure refreshes a list of materialized views.

Syntax

DBMS_MVIEW.REFRESH (
   { list                 IN     VARCHAR2,
   | tab                  IN     DBMS_UTILITY.UNCL_ARRAY,}
   method                 IN     VARCHAR2       := NULL,
   rollback_seg           IN     VARCHAR2       := NULL,
   push_deferred_rpc      IN     BOOLEAN        := true,
   refresh_after_errors   IN     BOOLEAN        := false,
   purge_option           IN     BINARY_INTEGER := 1,
   parallelism            IN     BINARY_INTEGER := 0,
   heap_size              IN     BINARY_INTEGER := 0,
   atomic_refresh         IN     BOOLEAN        := true,
   nested                 IN     BOOLEAN        := false);

Note: This procedure is overloaded. The list and tab parameters are mutually exclusive.

Parameter Description
list | tab

Comma-delimited list of materialized views that you want to refresh. (Synonyms are not supported.) These materialized views can be located in different schemas and have different master tables or master materialized views. However, all of the listed materialized views must be in your local database.

Alternatively, you may pass in a PL/SQL index-by table of type DBMS_UTILITY.UNCL_ARRAY, where each element is the name of a materialized view.

method

A string of refresh methods indicating how to refresh the listed materialized views. An f indicates fast refresh, ? indicates force refresh, C or c indicates complete refresh, and A or a indicates always refresh. A and C are equivalent. P or p refreshes by recomputing the rows in the materialized view affected by changed partitions in the detail tables.

If a materialized view does not have a corresponding refresh method (that is, if more materialized views are specified than refresh methods), then that materialized view is refreshed according to its default refresh method. For example, consider the following EXECUTE statement within SQL*Plus:

DBMS_MVIEW.REFRESH
   ('countries_mv,regions_mv,hr.employees_mv','cf');

This statement performs a complete refresh of the countries_mv materialized view, a fast refresh of the regions_mv materialized view, and a default refresh of the hr.employees materialized view.

rollback_seg Name of the materialized view site rollback segment to use while refreshing materialized views.
push_deferred_rpc Used by updatable materialized views only. Set this parameter to true if you want to push changes from the materialized view to its associated master tables or master materialized views before refreshing the materialized view. Otherwise, these changes may appear to be temporarily lost.
refresh_after_errors If this parameter is true, an updatable materialized view continues to refresh even if there are outstanding conflicts logged in the DEFERROR view for the materialized view's master table or master materialized view. If this parameter is true and atomic_refresh is false, this procedure continues to refresh other materialized views if it fails while refreshing a materialized view.
purge_option If you are using the parallel propagation mechanism (in other words, parallelism is set to 1 or greater), 0 means do not purge, 1 means lazy purge, and 2 means aggressive purge. In most cases, lazy purge is the optimal setting. Set purge to aggressive to trim the queue if multiple master replication groups are pushed to different target sites, and updates to one or more replication groups are infrequent and infrequently pushed. If all replication groups are infrequently updated and pushed, then set this parameter to 0 and occasionally execute PUSH with this parameter set to 2 to reduce the queue.
parallelism

0 specifies serial propagation.

n > 1 specifies parallel propagation with n parallel processes.

1 specifies parallel propagation using only one parallel process.

heap_size

Maximum number of transactions to be examined simultaneously for parallel propagation scheduling. Oracle automatically calculates the default setting for optimal performance.

Note: Do not set this parameter unless directed to do so by Oracle Support Services.

atomic_refresh

If this parameter is set to true, then the list of materialized views is refreshed in a single transaction. All of the refreshed materialized views are updated to a single point in time. If the refresh fails for any of the materialized views, none of the materialized views are updated.

If this parameter is set to false, then each of the materialized views is refreshed in a separate transaction.

nested If true, then perform nested refresh operations for the specified set of materialized views. Nested refresh operations refresh all the depending materialized views and the specified set of materialized views based on a dependency order to ensure the nested materialized views are truly fresh with respect to the underlying base tables.

Syntax diagrams and parameter descriptions adapted from Oracle, Inc. documentation.
Rating (Votes: 0)

Note: Only Registered Users may rate topics.