oracle 10g table stream
一、要求
二、建立使用者及搭建環境
1、首先是source
conn / as sysdba
create tablespace stream_tbs datafile 'tream01.dbf' size 200m;
create user stradmin identified by stradmin default tablespace stream_tbs;
grant dba to stradmin;
2、target建立專用表空間及使用者。
create tablespace stream_tbs datafile 'stream01.dbf' size 200m;
create user stradmin identified by stradmin default tablespace stream_tbs;
grant dba to stradmin;
3、切換回source資料庫,以streams的操作使用者stradmin連線
conn stradmin/stradmin
建立連線到target的資料庫鏈:
create database link db2 connect to stradmin identified by stradmin using 'db2';
exec dbms_streams_adm.set_up_queue();
4、再次切換到target資料庫,以streams的操作使用者stradmin連線
conn stradmin/stradmin
create database link db1 connect to stradmin identified by stradmin using 'db1';
exec dbms_streams_adm.set_up_queue();
三、配置複製過程
1、首先到source資料庫
--建立捕獲規則
begin
dbms_streams_adm.add_table_rules(
table_name => 'scott.emp',
streams_type => 'capture',
streams_name => 'capture_stream',
queue_name => 'stradmin.streams_queue',
include_dml => true,
include_ddl => true,
inclusion_rule => true);
end;
/
--建立傳播規則
begin
dbms_streams_adm.add_table_propagation_rules(
table_name => 'scott.emp',
streams_name => 'sour_to_targ',
source_queue_name => 'stradmin.streams_queue',
destination_queue_name => ,
include_dml => true,
include_ddl => true,
source_database => 'db1',
inclusion_rule => true,
queue_to_queue => true);
end;
/
select capture_name,status from dba_capture;
capture_name status
------------------------------ --------
capture_stream disabled
2、切換到target資料庫
--建立應用規則
begin
dbms_streams_adm.add_table_rules(
table_name => 'scott.emp',
streams_type => 'apply',
streams_name => 'apply_stream',
queue_name => 'stradmin.streams_queue',
include_dml => true,
include_ddl => true,
source_database => 'db1',
inclusion_rule => true);
end;
/
。
--初始化資料,首先從源庫匯出,再執行匯入
impdp system/sys network_link=db1 schemas=hr
--設定起始應用的scn值
declare
iscn number;
begin
iscn := dbms_flashback.get_system_change_number();
(
source_object_name => 'hr1.test',
source_database_name => 'db1',
instantiation_scn => iscn);
end;
/
--啟動應用程式
exec dbms_apply_adm.start_apply('apply_stream');
select apply_name,status from dba_apply;
3、切換到source資料庫,啟動捕獲程式
exec dbms_capture_adm.start_capture('capture_stream');
select capture_name,status from dba_capture;
capture_name status
------------------------------ --------
capture_stream enabled
四、測試
http://blog.itpub.net/post/29894/470010 (引用上述)==============================================================
[@more@]來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9879835/viewspace-1060460/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle 10 g stream tableOracle
- oracle 10g user streamOracle 10g
- oracle 10g stream weihuOracle 10g
- Oracle 10g Shrink Table 詳解Oracle 10g
- Oracle 10g stream 一對多複製Oracle 10g
- Oracle 10g DML Table Monitoring ChangesOracle 10g
- Oracle 10g Shrink Table - Shrink Space 收縮空間Oracle 10g
- Oracle9i Table monitoring 及10g table預設monitoring屬性Oracle
- Oracle 10g table monitoring 如何判斷表有10%Oracle 10g
- How to adjust the high watermark in ORACLE 10g – ALTER TABLE SHRINKOracle 10g
- Oracle 10g Stream 時時資料同步, 全程試驗紀錄Oracle 10g
- ORACLE STREAM ERROROracleError
- restart oracle streamRESTOracle
- Oracle simple streamOracle
- 10g Stream 單表同步問題
- 實戰11g stream replication之table replication
- flink stream轉table POJO物件遇到的坑POJO物件
- Oracle stream案例分享Oracle
- oracle stream pool sizeOracle
- [Oracle] Partition table exchange Heap tableOracle
- Oracle9i, 10g Table monitoring 設定 及 STATISTIC_LEVELOracle
- oracle temporary tableOracle
- oracle shrink tableOracle
- Oracle Table LocksOracle
- Alter table for ORACLEOracle
- Oracle Table FunctionOracleFunction
- Oracle Stream概述與配置Oracle
- Oracle Stream Replication 技術Oracle
- oracle stream學習(一)Oracle
- Oracle Stream 深入探討Oracle
- Oracle Stream(2)--Streams功能Oracle
- Oracle Stream(1)--Streams概述Oracle
- 【原創】Oracle9i和10g中plan_table表的差異Oracle
- Oracle 普通table 轉換為partition tableOracle
- oracle cache table(轉)Oracle
- Oracle table selectOracle
- Oracle:TABLE MONITORINGOracle
- oracle之nalyze tableOracle