search
HomeDatabaseMysql Tutorial在SQL Server 2012中实现CDC for Oracle

在上篇在SSIS 2012中使用CDC(数据变更捕获) 中, 介绍了如何在SSIS 2012中使用CDC,本文在此基础上介绍,如何通过Attunity提供的 Change Data Capture Designer for Oracle 实现对Oracle数据表的变更捕获。同样需要做一些准备工作: 1、配置Oracle数据库为

在上篇在SSIS 2012中使用CDC(数据变更捕获)中,介绍了如何在SSIS 2012中使用CDC,本文在此基础上介绍,如何通过Attunity提供的Change Data Capture Designer for Oracle实现对Oracle数据表的变更捕获。同样需要做一些准备工作:

1、配置Oracle数据库为归档模式,并获取浏览日志的指定权限;


<pre class="brush:php;toolbar:false">/* -- ============================================= -- 修改Oracle属性 ---Generate By downmoon(邀月),3w@live.cn -- ============================================= */ ALTER DATABASE ADD SUPPLEMENTAL LOG DATA; ALTER DATABASE ARCHIVELOG;

2、安装CDC Service Configuration and Designer 两个控制台。

在SQL Server的安装源\Tools\AttunityCDCOracle\x64\1033下有两个安装文件,32位对应的路径为X86,1033为英语,2052为简体中文。D:\Tools\AttunityCDCOracle\x64\1033\AttunityOracleCdcDesigner.msi
D:\Tools\AttunityCDCOracle\x64\1033\AttunityOracleCdcService.msi
D:\Tools\AttunityCDCOracle\x86\1033\AttunityOracleCdcDesigner.msi
D:\Tools\AttunityCDCOracle\x86\1033\AttunityOracleCdcService.msi

安装的具体方法,请参考:

http://social.technet.microsoft.com/wiki/contents/articles/7647.installing-microsoft-sql-server-2012-change-data-capture-for-oracle-by-attunity.aspx

双击MSI即可安装,默认安装路径,64位在这里:C:\Program Files\Change Data Capture for Oracle by Attunity

如果没有安装源,可以在官网下载:http://www.microsoft.com/en-us/download/details.aspx?id=35580

在SQL Server 2012中实现CDC for Oracle

注意:如果您的SQL Server 2012是64位,必须选择64位安装源,而如果你用的Oracle客户端是32位,那么麻烦在后面,呵呵。

 

正面相对就比较简单了,两步即可:

第一步:配置 CDC for Oracle 服务

在开始-Attunity Change Data Capture for Oracle>CDC Service Configuration,打开服务配置控制台:

prepare 一个本地的SQL Server实例,用于记录远程Oracle表的变化,如果你没有先Prepare数据库,系统会相当人性化的给出提示,完成后也是如此。

在SQL Server 2012中实现CDC for Oracle

在SQL Server 2012中实现CDC for Oracle

在SQL Server 2012中实现CDC for Oracle

 

配置服务比较简单,最终如下图,注意:最后一行的Master Key用于加密存储的Oracle凭证。

 

在SQL Server 2012中实现CDC for Oracle

至此,第一步服务配置完成,简单,是不?

第二步:设计 CDC for Oracle

在开始-Attunity Change Data Capture for Oracle>CDC Designer Configuration,打开设计配置控制台:

创建一个新实例,首先创建一个CDC Database名称为Oracle_CDC,这个位于SQL Server端,运行它即可。

下来,连接Oracle Source

在SQL Server 2012中实现CDC for Oracle

出现上述情况,是因为我别的应用程序需要安装了一个Oracle 32位客户端,于是,悲剧出现了。

补救措施:安装一个绿色的Oracle 64位客户端:http://www.oracle.com/technetwork/topics/winx64soft-089540.html

下载,直接解压即可,本文中的Path路径有两个:

E:\Ora11\product\11.2.0\dbhome_1\bin;(Path路径中原32位客户端安装版路径)
E:\Ora11\Client12;E:\Ora11\product\11.2.0\dbhome_1\bin;(Path路径中现64位客户端绿色版路径,修改后)

然后重新在上述界面“Test connection”,成功!

在SQL Server 2012中实现CDC for Oracle

你可以提前在Oracle中新建一个表,用于测试:

<pre class="brush:php;toolbar:false">/* -- ============================================= 
-- 修改Oracle属性
---Generate By downmoon(邀月),3w@live.cn 
-- ============================================= */
-- Create tableCreate table CDCTest01( TCode VARCHAR2(20) primary Key, TName VARCHAR2(500));Insert into CDCTest01select '1','阳顶天' from dualunion allselect '2','张三丰' from dual;

创建后,你可以在后面一步,选中要捕获的表:

在SQL Server 2012中实现CDC for Oracle

执行关于表的一些必要操作:

在SQL Server 2012中实现CDC for Oracle

如果你没有做本文前的准备工作,将会收到如下错误:

在SQL Server 2012中实现CDC for Oracle

补救措施后,如下:

在SQL Server 2012中实现CDC for Oracle

下一步,设计完成。

你可以试着启动一下这个windows服务,十之八九第一次会收到这个错误:

在SQL Server 2012中实现CDC for Oracle

其实,这是因为本机配置的64位客户端在注册表中存错了位置,修改为64位绿色客户端位置即可,原值为32位安装版的路径。

[HKEY_LOCAL_MACHINE\SOFTWARE\Oracle]
"Oracle_Home"="E:\\Ora11\\Client12"

修改后无需重启,重新Start服务,OK

在SQL Server 2012中实现CDC for Oracle

我们添加两个语句测试一下:

/* -- ============================================= 
-- 创建测试数据
---Generate By downmoon(邀月),3w@live.cn 
-- ============================================= */

Insert into CDCTest01 select '3','金毛狮王' from dual;
update CDCTest01 set TName='觉远' where TCode='1';

在SQL Server 2012中实现CDC for Oracle

SQL Server端自动生成的表:

在SQL Server 2012中实现CDC for Oracle

感谢您的阅读,希望对你有所帮助!


本文参考:

http://www.attunity.com/products/attunity-cdc-ssis/oracle-cdc-for-ssis
http://www.microsoft.com/en-us/download/confirmation.aspx?id=35580
http://msdn.microsoft.com/zh-cn/library/dn175414%28v=sql.120%29.aspx
http://www.oracle.com/technetwork/topics/winx64soft-089540.html
http://technet.microsoft.com/en-us/library/ee470675%28v=sql.100%29.aspx
http://blogs.msdn.com/b/mattm/archive/2012/03/26/cdc-for-oracle-in-sql-server-2012.aspx
http://www.attunity.com/forums/microsoft-ssis-oracle-connector/error-failed-load-oci-dll-1308.html



助人等于自助!   3w@live.cn


Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
MySQL's Role: Databases in Web ApplicationsMySQL's Role: Databases in Web ApplicationsApr 17, 2025 am 12:23 AM

The main role of MySQL in web applications is to store and manage data. 1.MySQL efficiently processes user information, product catalogs, transaction records and other data. 2. Through SQL query, developers can extract information from the database to generate dynamic content. 3.MySQL works based on the client-server model to ensure acceptable query speed.

MySQL: Building Your First DatabaseMySQL: Building Your First DatabaseApr 17, 2025 am 12:22 AM

The steps to build a MySQL database include: 1. Create a database and table, 2. Insert data, and 3. Conduct queries. First, use the CREATEDATABASE and CREATETABLE statements to create the database and table, then use the INSERTINTO statement to insert the data, and finally use the SELECT statement to query the data.

MySQL: A Beginner-Friendly Approach to Data StorageMySQL: A Beginner-Friendly Approach to Data StorageApr 17, 2025 am 12:21 AM

MySQL is suitable for beginners because it is easy to use and powerful. 1.MySQL is a relational database, and uses SQL for CRUD operations. 2. It is simple to install and requires the root user password to be configured. 3. Use INSERT, UPDATE, DELETE, and SELECT to perform data operations. 4. ORDERBY, WHERE and JOIN can be used for complex queries. 5. Debugging requires checking the syntax and use EXPLAIN to analyze the query. 6. Optimization suggestions include using indexes, choosing the right data type and good programming habits.

Is MySQL Beginner-Friendly? Assessing the Learning CurveIs MySQL Beginner-Friendly? Assessing the Learning CurveApr 17, 2025 am 12:19 AM

MySQL is suitable for beginners because: 1) easy to install and configure, 2) rich learning resources, 3) intuitive SQL syntax, 4) powerful tool support. Nevertheless, beginners need to overcome challenges such as database design, query optimization, security management, and data backup.

Is SQL a Programming Language? Clarifying the TerminologyIs SQL a Programming Language? Clarifying the TerminologyApr 17, 2025 am 12:17 AM

Yes,SQLisaprogramminglanguagespecializedfordatamanagement.1)It'sdeclarative,focusingonwhattoachieveratherthanhow.2)SQLisessentialforquerying,inserting,updating,anddeletingdatainrelationaldatabases.3)Whileuser-friendly,itrequiresoptimizationtoavoidper

Explain the ACID properties (Atomicity, Consistency, Isolation, Durability).Explain the ACID properties (Atomicity, Consistency, Isolation, Durability).Apr 16, 2025 am 12:20 AM

ACID attributes include atomicity, consistency, isolation and durability, and are the cornerstone of database design. 1. Atomicity ensures that the transaction is either completely successful or completely failed. 2. Consistency ensures that the database remains consistent before and after a transaction. 3. Isolation ensures that transactions do not interfere with each other. 4. Persistence ensures that data is permanently saved after transaction submission.

MySQL: Database Management System vs. Programming LanguageMySQL: Database Management System vs. Programming LanguageApr 16, 2025 am 12:19 AM

MySQL is not only a database management system (DBMS) but also closely related to programming languages. 1) As a DBMS, MySQL is used to store, organize and retrieve data, and optimizing indexes can improve query performance. 2) Combining SQL with programming languages, embedded in Python, using ORM tools such as SQLAlchemy can simplify operations. 3) Performance optimization includes indexing, querying, caching, library and table division and transaction management.

MySQL: Managing Data with SQL CommandsMySQL: Managing Data with SQL CommandsApr 16, 2025 am 12:19 AM

MySQL uses SQL commands to manage data. 1. Basic commands include SELECT, INSERT, UPDATE and DELETE. 2. Advanced usage involves JOIN, subquery and aggregate functions. 3. Common errors include syntax, logic and performance issues. 4. Optimization tips include using indexes, avoiding SELECT* and using LIMIT.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function