Create a dblin solution on the target Oracle Database

Source: Internet
Author: User

Do you have a headache in obtaining Oracle snapshots and dblink operations? If this is the case, the following articles will give you corresponding solutions. The following articles mainly describe how to create the dblin solution on the Oracle target database, the following is a detailed description of the relevant content. Oracle snapshot and dblink usage (data synchronization between two servers) Glossary: Source-synchronized Database

Target Database

1. Create a dblink:

1. Create dblin on the target Oracle Database

 
 
  1. drop database link dblink_anson;  
  2. Create public  
  3. database link dblink_anson  
  4. Connect to lg identified by lg using 'SDLGDB';  

Source database user name, password, server name k

Ii. Create a snapshot:

1. Execute the following statement on both the source and target databases to create the table to be synchronized.

 
 
  1. drop table tb_anson;  
  2. create table tb_anson(c1 varchar2(12));  
  3. alter table tb_anson add constraint pk_anson primary key (C1);  

2. Test dblink on the target database

 
 
  1. select * from tb_anson@dblink_anson;  
  2. select * from tb_anson;  

3. Create a snapshot log for the table to be synchronized on the target Oracle Database

 
 
  1. Create snapshot log on tb_anson; 

4. Create a snapshot. the snapshot (source to be synchronized) Database Service must be started)

 
 
  1. Create snapshot sn_anson as select * from tb_anson@dblink_anson; 

5. Set the snapshot refresh time

 
 
  1. Alter snapshot anson refresh fast Start with 
    sysdate+1/24*60 next sysdate+10/24*60; 

Oracle automatically performs the first quick refresh in 1 minute, and then refresh every 10 minutes.

 
 
  1. Alter snapshot anson refresh complete Start with 
    sysdate+30/24*60*60 next sysdate+1; 

Oracle automatically performs the first full refresh after 30 banknote, and then completely refresh every 1 day.

6. manually refresh snapshots

 
 
  1. begin  
  2. dbms_refresh.refresh('"CS"."SN_ANSON"');  
  3. end;  

The above content is an introduction to the relevant content of the Oracle target database. I hope you will have some gains.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.