Create Mview step by step

简介:

After completing this document, you should be able to create new mview.

1、  To facilitate the explanation , as a sample of creating mview at tetrix21_tkudpx05.

 

Operation Information:

Instance      Tetrix21_tkudpx05

Schema        PRDADMC

   Mview name    PARAM_FLUX_SENDER

First , running the PL/SQL software, connecting to tetrix21_tkudpx06 by dba account.

2When Connected the instance, we run the statement ‘select * from dba_db_links’ to get the current db_link name.

3We logon by PRDADMC.First, you need know, what’s schema and mview will be created. 

4Executing ‘select * from PARAM_FLUX_SENDER;’ , to check whether or not the Mview exist.

5Executing select * from PARAM_FLUX_SENDER@ TETRIX21_TKUDBX31.DKTETRIX.NET;’ , to check the master Mview availability.(Red font need be replaced to step 2 db_link name)

6If all above are OK, The following statement to create the mview.

.(Red font need be replaced to step 2 db_link name)


  
  
  1. CREATE MATERIALIZED VIEW PRDADMC.PARAM_FLUX_SENDER TABLESPACE PRDADMC_SNAP_DATA 
  2.  
  3. BUILD IMMEDIATE USING INDEX TABLESPACE PRDADMC_SNAP_INDEX  REFRESH FORCE ON DEMAND AS 
  4.  
  5. SELECT * FROM "PRDADMC"."PARAM_FLUX_SENDER"@TETRIX21_TKUDBX31.DKTETRIX.NET

 7Executing select * from user_refresh;

8We need replace the RNAME value of script (statement in red),using step 7 select result.


  
  
  1. begin 
  2.  
  3.   DBMS_REFRESH.ADD(name => 'PRDADMC. R_PRDADMC_TKUDBX31_1',list => 'PRDADMC.PARAM_FLUX_SENDER',lax => TRUE); 
  4.  
  5. end; 
  6.  

9Creating the materialized view log. Attention, all the red font, you need to change.


  
  
  1. CREATE MATERIALIZED VIEW LOG ON PRDADMC.PARAM_FLUX_SENDER TABLESPACE PRDADMC_SNAP_DATA


10Please use this SQL to know how many slaves in this instance.


  
  
  1. select mowner, r.snapsite, count(*) 
  2.  
  3. from   sys.slog$ s, sys.reg_snap$ r 
  4.  
  5. where  s.snapid=r.snapshot_id(+) 
  6.  
  7. group by mowner, r.snapsite 
  8.  
  9. order by 1 

 

11When we know the slaves, we need to operate all the step at every instance.

 

12We need grant right to VISU_xxxx account, and create synonym.

 


  
  
  1. grant select on PRDADMC.REF_SPECIFIC_CUSTOMER  to visu_prdadmc;  
  2.  
  3. create synonym visu_prdadmc.REF_SPECIFIC_CUSTOMER  for PRDADMC.REF_SPECIFIC_CUSTOMER; 
  4.  
  5. alter session set current_schemavisu_prdadmc
  6.  
  7. select * from dba_synonyms where table_name='REF_SPECIFIC_CUSTOMER' 









本文转自 hsbxxl 51CTO博客,原文链接:http://blog.51cto.com/hsbxxl/763140,如需转载请自行联系原作者

目录
相关文章
|
7月前
|
机器学习/深度学习 JavaScript 算法
GAN Step By Step -- Step7 WGAN
GAN Step By Step -- Step7 WGAN
GAN Step By Step -- Step7 WGAN
|
机器学习/深度学习 编解码 计算机视觉
GAN Step By Step -- Step5 ACGAN
GAN Step By Step -- Step5 ACGAN
GAN Step By Step -- Step5 ACGAN
|
机器学习/深度学习
GAN Step By Step -- Step6 LSGAN
GAN Step By Step -- Step6 LSGAN
GAN Step By Step -- Step6 LSGAN
|
机器学习/深度学习 数据挖掘 PyTorch
GAN Step By Step -- Step3 DCGAN
GAN Step By Step -- Step3 DCGAN
GAN Step By Step -- Step3 DCGAN
You have to specify ‘-keep‘ options for the shrinking step
You have to specify ‘-keep‘ options for the shrinking step
80 0
|
存储 SQL 数据库
Step By Step 一步一步写网站[1] —— 填加数据
填加数据是一个项目必不可少的部分,也是一个基础操作,使用也是最频繁的。那么您是怎么实现添加数据的呢?添加数据可以分为几种情况。1、单表添加,不需要事务。最简单最常见2、多表(主从表)添加,不需要事务。3、多表(主从表)添加,需要事务。
985 0
|
SQL 存储 数据库
Step By Step 一步一步写网站[1] —— 填加数据(二)
(这个是我认真思考并精心写的,能不能算作高质量我就不敢说了)建议先看一下第一篇:http://www.cnblogs.com/jyk/archive/2007/03/23/685075.html 上一篇写了我常用的方法,这里想说一下我猜想的OOD的方法,之所以用猜想,是因为我没有用过OOD的方法,我也不知道我这么写对不对,所以用了“猜想”二字。
1110 0
|
开发工具
R-Organize Data(step 2)
R is a data analysis and visualization platform.
939 0
|
资源调度
R-Description Data(step 3)
R is a data analysis and visualization platform.
1101 0