Tải bản đầy đủ - 0 (trang)
12-6. Using Change Data Capture with Oracle Source Data

12-6. Using Change Data Capture with Oracle Source Data

Tải bản đầy đủ - 0trang

Chapter 12 ■ Change Tracking and Change Data Capture



Figure 12-11.  The prepare SQL Server dialog box for the Oracle CDC Service Configuration by Attunity MMC snap-in

5.



Click Run and confirm with OK. The MSXDBCDC database is created on the selected

server.



6.



Click Action ➤ New Service and define a new Oracle CDC service. I suggest leaving

the service name proposed by the creation process, but you must remember to add

the master password and define the Associated SQL Server instance. The dialog box

should look like Figure 12-12.



718

www.it-ebooks.info



Chapter 12 ■ Change Tracking and Change Data Capture



Figure 12-12.  Creating a new Oracle CDC service

7.



Close the Change Data Capture Service Configuration for Oracle by Attunity MMC

snap-in.



8.



You now need to create a CDC instance. Click Start ➤ All Programs ➤ Change Data

Capture for Oracle by Attunity ➤ Oracle CDC designer configuration.



9.



The Connect To SQL Server dialog box appears. Enter or select a server name and

choose a mode of authentication plus any required parameters (see Figure 12-13).



719

www.it-ebooks.info



Chapter 12 ■ Change Tracking and Change Data Capture



Figure 12-13.  The Connect To SQL Server dialog box in the Oracle CDC

designer configuration MMC snap-in

10.



Click Connect. You will now be running the Oracle CDC designer configuration MMC

snap-in.



11.



Click the service in the left pane, right-click, and choose New Oracle CDC Instance.

Enter an Oracle CDC instance name, and then click Create Database. The database

will have the same name as the instance by default, but you can change the database

name. The dialog box should look like Figure 12-14.



Figure 12-14.  The Create CDC Database pane of the Create Oracle CDC Instance Wizard



720

www.it-ebooks.info



Chapter 12 ■ Change traCking and Change data Capture



12.



Click Next and define the Oracle connection parameters in the Oracle Source pane.

Fortunately, the dialog box is friendly and helpful (and can be seen in Figure 12-15).



Figure 12-15. The Oracle Source pane of the Create Oracle CDC Instance Wizard

13.



Click Next. The Tables pane of the wizard appears.



14.



Click Add. Enter or select a database schema, and then click Search to display the

available tables. Select any tables you wish to use as data sources. The dialog box

should look something like Figure 12-16.



721

www.it-ebooks.info



Chapter 12 ■ Change Tracking and Change Data Capture



Figure 12-16.  Selecting source tables in Oracle



15. Click Add, followed by OK to confirm each table. Once all the tables have been added,

click Close. You will return to the Tables pane of the wizard with the selected tables

listed. The dialog box should look like Figure 12-17.



722

www.it-ebooks.info



Chapter 12 ■ Change Tracking and Change Data Capture



Figure 12-17.  Selected tables for Oracle CDC



16. Click Next. The Oracle Logging dialog box will appear, rather like in Figure 12-18.



723

www.it-ebooks.info



Chapter 12 ■ Change Tracking and Change Data Capture



Figure 12-18.  The Oracle Logging pane

17.



Click Run Script. Confirm (or modify) the connection elements in the dialog box

(see Figure 12-19).



Figure 12-19.  Oracle credentials for running the CDC script



724

www.it-ebooks.info



Chapter 12 ■ Change Tracking and Change Data Capture



18.



Click Run. You should get a dialog box confirming that the supplemental logging

script was run successfully. Click OK to confirm this dialog box, and then click Next.



19.



Click Run to generate the destination tables enabled for CDC in the SQL Server

database. The dialog box should look like Figure 12-20 after this process has run.



Figure 12-20.  The Generate Oracle CDC Instance pane—after successfully generating “mirror” tables in

SQL Server

20.



Click Next, and then Finish in the final dialog box (see Figure 12-21).



725

www.it-ebooks.info



Chapter 12 ■ Change Tracking and Change Data Capture



Figure 12-21.  The final wizard dialog box confirming that Oracle CDC is set up

21.



You now need to synchronize the source and destination databases—as in previous

recipes dealing with Change Data Capture. Ensure that you have prevented any

changes to the Oracle source table(s), and then copy the data from them into the

“mirror” destination tables (as Attunity calls them) in SQL Server. You can see these

tables by expanding Tables in the destination SQL Server database that you created as

part of the CDC configuration (see Figure 12-22).



726

www.it-ebooks.info



Chapter 12 ■ Change Tracking and Change Data Capture



Figure 12-22.  Mirror tables in SQL Server

22.



You are now ready to instantiate Change Data Control. To do this, right-click the

instance name in the Change Data Capture MMC, and select Start. This is shown in

Figure 12-23.



Figure 12-23.  Starting CDC for Oracle



727

www.it-ebooks.info



Chapter 12 ■ Change Tracking and Change Data Capture



This will synchronize the data in the destination Table in SQL Server with the source table in Oracle. You can

then run step 22 every time that you wish to synchronize the data.



How It Works

In essence, the Attunity tools for Oracle CDC are a very clever imitation of the Microsoft approach for SQL Server.

As is the case for the pure Microsoft CDC technique, the source database log is read to detect changes, and these

changes are then written to the destination database, in a format identical to that used in MS CDC.

You can monitor the changes handled by the Change Data Capture process by clicking an instance in the

Change Data Capture designer. It will show you useful data concerning the number and state of transactions (see

Figure 12-24).



Figure 12-24.  Monitoring Oracle CDC

The table that stores the history of changes data is a system table named cdc.  _  _CT.

It looks like Figure 12-25.



Figure 12-25.  The Oracle CDC system table of changes



728

www.it-ebooks.info



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

12-6. Using Change Data Capture with Oracle Source Data

Tải bản đầy đủ ngay(0 tr)

×