oracle 10 g stream table
一、要求
二、建立使用者及搭建環境
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-1060464/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle 10g table streamOracle 10g
- oracle 10g user streamOracle 10g
- oracle 10g stream weihuOracle 10g
- Oracle 10g Shrink Table 詳解Oracle 10g
- 實戰11g stream replication之table replication
- ORACLE10g Stream表級複製配置Oracle
- Oracle10g新特性之stream流配置Oracle
- Oracle 10g stream 一對多複製Oracle 10g
- Oracle 10g DML Table Monitoring ChangesOracle 10g
- oracle10g刪除Table的困惑Oracle
- oracle 10g__alter table shrink space compactOracle 10g
- oracle10g_alter table_測試3Oracle
- ORACLE10g Stream使用者級複製配置Oracle
- Oracle10g New Feature -- 3.Flashback TableOracle
- Oracle 10g table monitoring 如何判斷表有10%Oracle 10g
- Oracle 10g Shrink Table - Shrink Space 收縮空間Oracle 10g
- oracle 10g-->11g schema級別下游實時捕獲stream配置Oracle 10g
- Oracle9i Table monitoring 及10g table預設monitoring屬性Oracle
- How to adjust the high watermark in ORACLE 10g – ALTER TABLE SHRINKOracle 10g
- oracle10g_plsql_rercursor_type_table of_小引例_bulk collect intoOracleSQL
- oracle10g Online Table Redefinition testing and related docOracle
- Oracle10g中FLASHBACK TABLE語句快速恢復表Oracle
- Oracle 10g Stream 時時資料同步, 全程試驗紀錄Oracle 10g
- Oracle10g 回收站及徹底刪除table : drop table xx purge 以及flashbackOracle
- 10g Stream 單表同步問題
- Oracle10g中FLASHBACK TABLE語句恢復DML誤操作Oracle
- Oracle10g 回收站及徹底刪除table : drop table xx purge 以及drop flashOracle
- Oracle基礎 10 表 tableOracle
- Oracle10g stream : :dml.get_command_type and lcr.get_command_typeOracle
- Oracle10g 特性 -- 自動定時分析變化資料的TableOracle
- Oracle9i, 10g Table monitoring 設定 及 STATISTIC_LEVELOracle
- Oracle 11g alter table move與shrink spaceOracle
- Oracle10G 的gOracle
- Oracle Stream實戰(10)—問題診斷Oracle
- ORACLE STREAM ERROROracleError
- restart oracle streamRESTOracle
- Oracle simple streamOracle
- 【原創】Oracle9i和10g中plan_table表的差異Oracle