MATERIALIZED VIEW 的Refresh

    在维护项目时,要求对物化视图(MATERIALIZED VIEW)进行Refresh使用的时间进行测试,在网上找到了下面的例子:
     BEGIN
        DBMS_MVIEW.REFRESH (
            list => 'mview_name',  --换成自己的Mview名
            Method =>'C',
            refresh_after_errors => True);
        END;

    对上面的意思不理解,通过在PLSQL中查询出如下内容:

--   LIST
  --     A comma-separated list or PL/SQL table of the snapshots
  --     to be refreshed.
  --   METHOD
  --     A string that contains a letter for each
  --     of the snapshots in the array according to the following codes:
  --     '?' -- use fast refresh when possible
  --     'F' -- use fast refresh or raise an error if not possible
  --     'C' -- perform a complete refresh, copying the entire snapshot from
  --            the master
  --     The default method for refreshing a snapshot is the method stored for
  --     that snapshot in the data dictionary.
  --   ROLLBACK_SEG
  --     The name of the rollback segment to use while
  --     refreshing snapshots.
  --   PUSH_DEFERRED_RPC
  --     If TRUE then push all changes made to an updatable snapshot to its
  --     associated master before refreshing the snapshot.  Otherwise, these
  --     changes may appear to be temporarily lost.
  --   REFRESH_AFTER_ERRORS
  --     If TRUE, then allow the refresh to proceed
  --     even if there are outstanding conflicts logged in the DefError
  --     table for the snapshot's master.
  --   PURGE_OPTION
  --     How to purge the transaction queue if PUSH_DEFERRED_RPC is true.
  --     0 = don't
  --     1 = cheap but imprecise (optimize for time)
  --     2 = expensive but precise (optimize for space)
  --   PARALLELISM
  --     Max degree of parallelism for pushing deferred RPCs. This value
  --     is considered only if PUSH_DEFERRED_RPC is true.
  --     0 = (old algorithm) serial propagation
  --     1 = (new algorithm) parallel propagation with only 1 slave
  --     n = (new algorithm) parallel propagation with n slaves
  --   HEAP_SIZE
  --     The max number of txns to be examined simultaneously for
  --     parallel scheduling computation. This parameter is used only if
  --     the value of the PARALLELISM parameter is greater than 0.
  --   ATOMIC_REFRESH
  --     If TRUE, then perform the refresh operations for the specified
  --     set of snapshots in a single transaction. This guarantees that either
  --     all of the snapshots are successfully refresh or none of the snapshots
  --     are refreshed.
  PROCEDURE refresh(list                 IN VARCHAR2,
                    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);

  PROCEDURE refresh(tab                  IN OUT 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);

  --  -----------------------------------------------------------------------
  --  Execute all refresh jobs due to be executed
  --  Requires ALTER ANY SNAPSHOT privilege
  PROCEDURE refresh_all;
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值