數據庫
要求
一
alter database add supplemental log data(primary key
job_queue_processes=
aq_tm_processes=
global_names=true
create tablespace streams_tbs datafile
create user strmadmin identified by strmadmin default tablespace streams_tbs quota unlimited on streams_tbs;
grant dba
sc_source
create database link connect to strmadmin identified by strmadmin using
sc_dest:
create database link connect to strmadmin identified by strmadmin using
二
sc_source
配置捕獲進程隊列
begin
dbms_streams_adm
queue_table =>
queue_name =>
queue_user =>
end;
/
sc_dest
配置應用進程隊列
begin
dbms_streams_adm
queue_table =>
queue_name =>
queue_user =>
end;
/
sc_source
配置捕獲進程
begin
dbms_streams_adm
schema_name =>
streams_type =>
streams_name =>
queue_name =>
include_dml => true
include_ddl => true
inclusion_rule => true);
end;
/
配置傳播進程
begin
dbms_streams_adm
schema_name =>
streams_name =>
source_queue_name =>
destination_queue_name =>
include_dml => true
include_ddl => true
source_database =>
end;
/
sc_dest
配置應用進程
begin
dbms_streams_adm
schema_name =>
streams_type =>
streams_name =>
queue_name =>
include_dml => true
include_ddl => true
source_database =>
end;
/
三
sc_source
先得到源庫的scn號
select dbms_flashback
然後把product用戶的數據導出
expdp product/product directory=dumpdir dumpfile=product
將導出的數據文件傳到目標數據庫sc_dest上
impdp product/product directory=dumpdir dumpfile=product
四
sc_dest
為了使發生錯誤時
begin
dbms_apply_adm
apply_name =>
parameter =>
value =>
end;
/
在目標庫上開始應用進程
begin
dbms_apply_adm
apply_name =>
end;
/
sc_source
在源庫上開始捕獲進程
begin
dbms_capture_adm
capture_name =>
end;
/
五
exec dbms_capture_adm
exec dbms_capture_adm
exec dbms_propagation_adm
exec dbms_propagation_adm
sc_dest
exec dbms_apply_adm
exec dbms_apply_adm
做完了以上工作
exec dbms_streams_adm
From:http://tw.wingwit.com/Article/program/Oracle/201311/17445.html