一个成功的增量SNAPSHOT例子

来源:互联网 发布:windows snmp配置文件 编辑:程序博客网 时间:2024/04/29 12:18
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

Case:
       上海有一个,北京有另一个数据库,都是oracle9i标准版.
   在上海的数据库里,需要复制北京的一个表.每天定时复制一次.由于数据量
   较大,不能采用全备份恢复的方法.
       故采用增量SNAPSHOT
  Procedure:

  Step1:
       在上海市服务器端,建立网络服务名Beijing

  $HOST$=
     (DESCRIPTION=
        (ADDRESS_LIST=
          (ADDRESS=(PROTOCOL=TCP)(HOST=$Beijing_Server$)(Port=1521))
     )
     (CONNECT_DATA=(SERVER_NAME=$BJORA$))
     )
   此步骤可以用oracle的网络配制,也可以直接修改TNSNAMES.ORA在上海市服务器
端.
   (提问?在UNIX下,哪种方式比较普遍,直接修改TNSNAMES.ORA?)

  Step2:
     上海市服务器,建立连接北京的DBLINK
     CreatePUBLICDatabaseLINK
     $DBLINK$
     Connectto$UserName$IDENTIFIEDBy$PASSWORD$USING'$HOST$'

  Step3.
     在北京的服务器上建立SNAPSHOTLOG
     CreateSNAPSHOTLOGON$TAB$WITHPRIMARYKEY;
   
  Step4
     在上海的服务器上建立SNAPSHOT
     CreateSNAPSHOT$TAB$BUILDIMMEDIATEREFRESH
     FASTNEXTsysdate+$x$/24AS
     SELECT*FROM$TAB$@$DBLIST$

  Step5
     如果手工刷新
     EXECDBMS_SNAPSHOT.REFRESH('$TAB$');

  以上经过验证,Master数据的增删改都能快速通过.

  如果不用oracle企业版的高级复制,也能实行基本的简单复制,满足一般业务要求
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
原创粉丝点击