GoldenGate synchronizes one-way DDL operations on OracleforOracle
GoldenGate synchronizes one-way DDL operations in Oracle for Oracle
In this article, we have synchronized table DML operations.
Perform the following tests:
Truncate of the execution table at the source end
SQL> truncate table tcustmer;
Table truncated.
View table data on the target end
SQL> select count (*) from tcustmer;
COUNT (*)
----------
2
Data is not synchronized
How can we synchronize DDL operations with Goldengate?
To support DDL synchronization, you must make some settings on the source database to track DDL operations. It includes the following content: Trigger, marker, and history table, a user role, and various other database objects.
First, you must configure the GLOBALS parameter to tell gg to use that schema to store DDL operations.
GGSCI (localhost. localdomain) 19> edit params./GLOBALS
-- GoldenGate GLOBALS parameter file
--
GGSCHEMA GGDDL
2. Use sqlplus to create a ggddl user and install ddl support
SQL> conn/as sysdba
Connected.
SQL> create user ggddl identified by ggddl;
User created.
SQL> grant connect, resource to ggddl;
Grant succeeded.
Disable the data recycle bin Function
SQL> ALTER SYSTEM SET RECYCLEBIN = OFF scope = spfile;
System altered.
SQL> startup force
Oracle instance started.
Total System Global Area 835104768 bytes
Fixed Size 2217952 bytes
Variable Size 574621728 bytes
Database Buffers 255852544 bytes
Redo Buffers 2412544 bytes
Database mounted.
Database opened.
Run marker_setup. SQL (ogg installation directory, go to sqlplus)
[Oracle @ localhost ogg] $ sqlplus/as sysdba
SQL * Plus: Release 11.2.0.1.0 Production on Fri Sep 11 19:58:40 2015
Copyright (c) 1982,200 9, Oracle. All rights reserved.
Connected:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> @ marker_setup. SQL
Marker setup script
You will be prompted for the name of a schema for the Oracle GoldenGate database objects.
NOTE: The schema must be created prior to running this script.
NOTE: Stop all DDL replication before starting this installation.
Enter Oracle GoldenGate schema name: GGDDL
Marker setup table script complete, running verification script...
Please enter the name of a schema for the GoldenGate database objects:
Setting schema name to GGDDL
MARKER TABLE
-------------------------------
OK
MARKER SEQUENCE
-------------------------------
OK
Script complete.
In the displayed dialog box, enter the GGSCHEMA name.
Run ddl_setup. SQL
SQL> @ ddl_setup. SQL
Run role_setup. SQL
SQL> @ role_setup. SQL
GGS Role setup script
This script will drop and recreate the role GGS_GGSUSER_ROLE
To use a different role name, quit this script and then edit the params. SQL script to change the gg_role parameter to the preferred name. (Do not run the script .)
You will be prompted for the name of a schema for the GoldenGate database objects.
NOTE: The schema must be created prior to running this script.
NOTE: Stop all DDL replication before starting this installation.
Enter GoldenGate schema name: ggddl
Wrote file role_setup_set.txt
PL/SQL procedure successfully completed.
Role setup script complete
Grant this role to each user assigned to the Extract, GGSCI, and Manager processes, by using the following SQL command:
GRANT GGS_GGSUSER_ROLE
Where Is the user assigned to the GoldenGate processes.
After creating a role, you do not need to assign this role to the ggddl user, but to the schema used by Extract, Replicat, and so on.
We configured a system user.
SQL> GRANT GGS_GGSUSER_ROLE TO system;
Grant succeeded.
To enable ddl, trigger enable
SQL> @ ddl_enable. SQL
Trigger altered.
Disable Manager, Extract, and Replicat
Source end
GGSCI (localhost. localdomain) 1> stop Extract eorakk
GGSCI (localhost. localdomain) 5> stop mgr!
Destination
GGSCI (localhost. localdomain) 1> stop replicat rorakk
Sending STOP request to replicat rorakk...
Request processed.
GGSCI (localhost. localdomain) 2> stop manager
Edit Extract Parameters
GGSCI (localhost. localdomain) 5> edit params eorakk
--
-- Change Capture parameter file to capture
-- TCUSTMER and TCUSTORD Changes
--
EXTRACT EORAKK
USERID system, PASSWORD oracle
RMTHOST 192.168.199.104, MGRPORT 7809
EXTTRAIL./dirdat/KK
DDL INCLUDE ALL
Table scott. TCUSTMER;
Table scott. TCUSTORD;
Add a ddl include all line based on the original
Edit Replicat Parameters