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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20190530]DISABLE TABLE LOCK(10g).txt
- oracle 10g flashback databaseOracle 10gDatabase
- restart oracle streamRESTOracle
- ORACLE STREAM ERROROracleError
- Oracle:TABLE MONITORINGOracle
- Oracle table selectOracle
- Scheduler in Oracle Database 10g(轉)OracleDatabase
- Oracle 10g 下載地址Oracle 10g
- oracle 10G特性之awrOracle 10g
- oracle stream pool sizeOracle
- oracle cache table(轉)Oracle
- Oracle Pipelined Table(轉)Oracle
- ISO 映象安裝oracle 10gOracle 10g
- Oracle 10g RAC故障處理Oracle 10g
- Oracle 10g 增刪節點Oracle 10g
- flink stream轉table POJO物件遇到的坑POJO物件
- Oracle Stream概述與配置Oracle
- Oracle Pipelined Table Functions(轉)OracleFunction
- Oracle 10g expdp attach引數體驗Oracle 10g
- oracle 10g函式大全–日期型函式Oracle 10g函式
- 關於Oracle 10g ASM磁碟大小的限制Oracle 10gASM
- ORACLE9I升級到10G(zt)Oracle
- Oracle 10g大檔案表空間(轉)Oracle 10g
- windows2008R2安裝oracle 10gWindowsOracle 10g
- Oracle 10g RAC 資料儲存更換Oracle 10g
- Oracle Table建立引數說明Oracle
- Analyze table對Oracle效能的提升Oracle
- Oracle cluster table(1)_概念介紹Oracle
- ORACLE _small_table_threshold與eventOracle
- oracle 10g建立資料庫鏈的簡化Oracle 10g資料庫
- AIX 5.3 Install Oracle 10g RAC 錯誤集錦AIOracle 10g
- oracle truncate table recover(oracle 如何拯救誤操作truncate的表)Oracle
- use azure data studio to create external table for oracleOracle
- 【TABLE】Oracle表資訊收集指令碼Oracle指令碼
- 深入解析 oracle drop table內部原理Oracle
- Oracle 10g(10.1.0.2)中的OPTIMIZER_INDEX_COST_ADJ(轉)Oracle 10gIndex
- Oracle 資料庫 10g中的分割槽功能(轉)Oracle資料庫
- Oracle 19c Concepts(02):Tables and Table ClustersOracle
- 14_深入解析Oracle table cluster結構Oracle