惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Help Net Security
Help Net Security
G
Google Developers Blog
雷峰网
雷峰网
WordPress大学
WordPress大学
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Engineering at Meta
Engineering at Meta
Security Latest
Security Latest
T
Threat Research - Cisco Blogs
AWS News Blog
AWS News Blog
F
Full Disclosure
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Exploit Database - CXSecurity.com
J
Java Code Geeks
U
Unit 42
C
Cyber Attacks, Cyber Crime and Cyber Security
V
V2EX
C
Cisco Blogs
博客园 - 司徒正美
Project Zero
Project Zero
L
LINUX DO - 热门话题
阮一峰的网络日志
阮一峰的网络日志
Blog — PlanetScale
Blog — PlanetScale
Scott Helme
Scott Helme
A
About on SuperTechFans
Hugging Face - Blog
Hugging Face - Blog
S
Securelist
小众软件
小众软件
aimingoo的专栏
aimingoo的专栏
S
Schneier on Security
G
GRAHAM CLULEY
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyberwarzone
Cyberwarzone
MongoDB | Blog
MongoDB | Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 叶小钗
T
Threatpost
Recorded Future
Recorded Future
C
CXSECURITY Database RSS Feed - CXSecurity.com
宝玉的分享
宝玉的分享
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
The Register - Security
The Register - Security
S
Security Archives - TechRepublic
博客园 - Franky
N
News | PayPal Newsroom
Simon Willison's Weblog
Simon Willison's Weblog
S
SegmentFault 最新的问题
W
WeLiveSecurity
A
Arctic Wolf
B
Blog

博客园 - 一江水

什么时候使用绑定变量性能反而更差 模拟登录新浪微博(Python) Oracle ASM 详解 Oracle OS Block Header 物化视图日志没有清除 Oracle如何根据物化视图日志快速刷新物化视图 物化视图注册信息的清除 Oracle RAC 碰到 gc buffer busy Oracle RAC 常用维护工具和命令 RAC Debug开关修改工具 Java连接Sybase ASE数据库的一个简单例子 中文图解Python脚本 解决sybase中文以及大小写问题(服务器端)(utf8 乱码) 如何使Sybase ASE中对象名不区分大小写? Oracle代理用户(Proxy User) Android系统手机端抓包方法 RAC中如何更改对外网卡和内部互联网卡的IP及VIP ORA-12545: 因目标主机或对象不存在, 连接失败 Oracle数据块损坏恢复总结[转]
使用 Oracle 数据库 10g内部的 ETL 基础架构
一江水 · 2012-09-03 · via 博客园 - 一江水

使用 Oracle 数据库 10g内部的 ETL 基础架构

http://www.oracle.com/technology/global/cn/obe/10gr2_db_single/bidw/etl2/etl2_otn.htm

--在关于Change Data Capture(一)中介绍了CDC的一些基本概念和类型。这篇文章主要是通过一个实际的例子来演示实现同步模式的CDC的基本步骤。
-- Create table
create table SALES
(
  ID        NUMBER,
  PRODUCTID NUMBER,
  PRICE     NUMBER,
  QUANTITY  NUMBER
)
--url:http://www.ningoo.net/html/tag/cdc
--2.1.首先在source database创建一个用户作为发布者
create user cdcpub identified by cdcpub;
--2.2.授予相应的权限

grant execute_catalog_role to cdcpub;
grant select_catalog_role to cdcpub;
grant create table to cdcpub;
grant create session to cdcpub;
grant dba to cdcpub;
grant execute on dbms_cdc_publish to cdcpub; --出错
--3.1
alter system set java_pool_size=48M;

--4.1
grant all on system.sales to cdcpub;  --出错
--4.2
begin
dbms_cdc_publish.create_change_set(
change_set_name =>'test_cdc',
description =>'change set for ning.sales',
change_source_name =>'SYNC_SOURCE');
end;
--4.3
begin
dbms_cdc_publish.create_change_table(
owner =>'cdcpub',
change_table_name=>'sales_ct',
change_set_name=>'test_cdc',
source_schema=>'system',
source_table=>'sales',
column_type_list=>'id int,productid int,price number(10,2),quantity int',
capture_values=>'both',
rs_id=>'y',
row_id=>'n',
user_id=>'n',
timestamp=>'n',
object_id=>'n',
source_colmap=>'y',
target_colmap=>'y',
options_string=>'tablespace users',
ddl_markers=>'n');--Oracle11 新添加参数
end;
--5.1
create user cdcsub identified by cdcsub;
grant create session to cdcsub;
grant create table to cdcsub;
grant select on cdcpub.sales_ct to cdcsub;
--5.3.创建订阅
begin
dbms_cdc_subscribe.create_subscription(
change_set_name=>'test_cdc',
description=>'change data for sales',
subscription_name=>'sales_sub');
end;
--5.4.订阅具体的source table和column
begin
dbms_cdc_subscribe.subscribe(
subscription_name=>'sales_sub',
source_schema=>'system',
source_table=>'SALES',
column_list=>'id,productid,price,quantity',
subscriber_view=>'TCDC_VIEW_SALES');
--subscriber_view=>'sales_view');
end;
--5.5.激活订阅 不管订阅包含一个source table还是多个,只需要执行一次激活即可。
begin
dbms_cdc_subscribe.activate_subscription(
subscription_name=>'SALES_SUB');
end;
--5.6.扩展订阅窗口  在源表数据变化后,变化的数据在订阅端需要执行extend_window后才能看见
begin
dbms_cdc_subscribe.extend_window(
subscription_name=>'SALES_SUB');
en