Step 1:start the Ggsci on Source and Target
Source |
Target |
Oracle GoldenGate Command interpreter for Sybase Version 12.1.2.0.0 17185003 oggcore_12.1.2.0.0_platforms_130924.1316 Linux, x86, 64bit (optimized), Sybase 16 |
Oracle GoldenGate Command Interpreter for Oracle Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO Linux, x86, 64bit Oracle 11g |
tip:should I Use the same version of Oracle GoldenGate on the Source and Target?
Yes, it is recommended to use the same version on both the source and target. However, If the Oracle GoldenGate versions on the source and target database is different, it's a good practice to use T He RELEASE option of the Extfile/rmtfile and Exttrail/rmttrail parameter, especially if you have a lower version of Oracle GoldenGate on the target.
Example:extfile./dirdat/em, FORMAT RELEASE 11.2
1. Use a Defgen paramfile with NOEXTATTR option, or
2. Generate definition file with the same Ogg version as the Ogg target site version.
$./defgen paramfile./DIRPRM/DEFGEN.PRM reportfile./dirrpt/defgen.31jul2013.rptnoextattr
We then need to modify and check the Oracle GoldenGate Manager parameter file to prepare the replication. The following table shows the Oracle GoldenGate Manager setup on the source and target system:
Source |
Target |
Export DSQUERY=ASE1 ggsci> edit param Mgr Port 15021 Purgeoldextracts./dirdat/em*, Usecheckpoints, minkeephours 2 ggsci> Start Mgr ggsci> Info Mgr |
ggsci> edit param Mgr
Port 15021 Dynamicportlist 15011-15020 Dynamicportreassigndelay 5 ggsci> Start Mgr ggsci> Info Mgr |
Step 2:set up the Source and Target Database
Create a city table
Source (Sybase ASE) |
Target (Oracle Database 11.2.0.1) |
Isql-uogguser-pogguser-sase1 >use pubs2 >go CREATE table City (id int, name varchar) Go Insert to City values (1, ' New York ') Insert to City values (2, ' Bosto n ') insert INTO city values (3, ' Dallas ') insert INTO city values (4, ' Beijing ') Go > select COUNT (1) From city > go |
connect swat/swat CREATE TABLE city (id int, name var CHAR2 (10); INSERT INTO city values (1, ' New York '); INSERT INTO city values (2, ' Boston '); INSERT INTO city values (3, ' Dallas '); INSERT INTO city values (4, ' Beijing '); > select COUNT (1) from City; |
Step 3:set up the secondary truncation point in Sybase Transaction Log
When using Oracle GoldenGate for Sybase, you need to setup the secondary truncation point. This is because Oracle GoldenGate uses, the secondary truncation point to identify data, remains to be processed.
To set up the secondary truncation point, you need to login Sybase database with a user who hassa_role privilege and run T He "DBCC SETTRUNC (' LTM ', valid)" command. The detailed steps is shown as follows:
Source
Shell> Isql-uogguser-pogguser-sase1
1> Use PUBS2
2> Go
1> DBCC SETTRUNC (' LTM ', ' valid ')
2> Go
Ltm_truncpage ltm_trunc_state db_rep_stat gen_id dbid dbname lti_version-------------------------------------------- ----------------------------------- 524307 1 1 0 5 sydatabase 0
Step 4:prepare the Source database and Target database
Connect to the source DB and add Trandata. In addition, confirm this Oracle GoldenGate user can access on the target database shown as follows:
source |
target |
Ggsci >dblogin so Urcedb [email protected] userid ogguser password ogguser ggsci > List table dbo.city Ggsci > Info trand ATA dbo.city Transaction logging disabled for table Dbo.city Ggsci > Add trandata dbo.city Transaction Logg ing enabled for table suser.regions. |
Ggsci > dblogin userid swat, password SWAT successfully logged into data Base. Ggsci > List table swat.city |
Why I get the ' Error:cannot use database syd_database. Error, no additional information available. "Error?
Answer: The problem is the parsing issue in Oracle GoldenGate 11.2.1 version If the database has special CHARACTE Rs such as "_" in the database and schema name. The current solution are to remove the special characters.
Because we is working on heterogeneous database replication and you had to create the database metadata definition file on The source system and copy the generated definition file to the target.
Source |
Target |
EMASTER.PRM: Extract emaster Exttrail./dirdat/em, FORMAT RELEASE 11.2 Sourcedb [email protected] userid ogguser password ogguser statoptions resetreportstats 00:01 Reportcount every seconds, rate Table dbo.city; |
RMASTER.PRM: Replicat rmaster UserID Swat, password swat sourcedefs./dirout/city.def Discardfile./DIRRPT/RMASTER.DSC, purge Map Dbo.city, target swat.city; |
Adding the Extract: Ggsci> Add extract Emaster, Tranlog, begin now ggsci> Add Exttrail/dirdat/em, extract emaster, megabytes 50 |
Adding the Replicat: Ggsci >edit param./globals Ggschema goldengate Checkpointtable Goldengate.checkpoint Ggsci>add checkpointtable goldengate.checkpointtable Ggsci>add replicat Rmaster, Exttrail./dirdat/pm |
PMASTER.PRM: Extract Pmaster Rmthost 192.168.137.11, Mgrport 15021, compress, timeout 30 Rmttrail./dirdat/pm PassThru Table dbo.city; |
|
Adding the Pump: Ggsci > Add extract Pmaster, Exttrailsource./dirdat/em EXTRACT added. Ggsci > Add Rmttrail/dirdat/pm, extract pmaster, megabytes 50 Rmttrail added. |
|
Insert a New Record in Sybase 1> Insert into regions values (5, ' Antarctica ') 2> Go (1 row affected) |
Sql> select * from regions; region_id Region_name ---- ---------------------- 1 Europe 2 Americas 3 Asia 4 Middle East and Africa 5 Antarctica |
Delete a Record in Sybase 1> Delete from regions where region_id=5 2> Go (1 row affected) |
Sql> select * from regions; region_id Region_name ---- ---------------------- 1 Europe 2 Americas 3 Asia 4 Middle East and Africa |
Now, we are completed the basic setups of a one-way replication from Sybase ASE database to Oracle database.feel free to Let me know if you had any questions or comments on the tips I provided above.
Installing Oracle GoldenGate for Sybase:step 1:download Oracle GoldenGate for Sybasestep 2:unzip the Oracle GoldenGate Z IP File.
Unzip the downloaded file with the following commands:
Unzip V32422-01.zip
Tar xvf Ggs_linux_x86_sybase15_5_32bit.tar
Check the shared library path:
Env |grep Ld_library_path
Ld_library_path=/home/sybase/ase-15_0/lib:/home/sybase/dataaccess/odbc/lib:
/home/sybase/ocs-15_0/lib:/home/sybase/ocs-15_0/lib3p:/home/sybase/ase-15_0/lib:
/home/sybase/dataaccess/odbc/lib:/home/sybase/ocs-15_0/lib:
/HOME/SYBASE/OCS-15_0/LIB3P:
ADD the OGG installation path to the path and shared library path (LD_LIBRARY_PATH) environment variables:
Export Path=/home/ogg_for_sybase: $PATH
Export ld_library_path=/home/ogg_for_sybase: $LD _library_path
Note:
ld_library_path=/opt/sybase/ase-16_0/lib:/opt/sybase/ocs-16_0/lib:/opt/sybase/ocs-16_0/lib3p:/opt/sybase/ Ocs-16_0/lib3p64:/opt/sybase/dataaccess/odbc/lib:/opt/sybase/dataaccess64/odbc/lib:
Step 3:create Oracle GoldenGate
Run the ggsci command in the folder where Oracle GoldenGate files is unzipped:
./ggsci
Ggsci> Create Subdirs
...
Ggsci>exit
Step 4:create Database User in Sybase for Replication.
In the Sybase database, create a database user for Oracle GoldenGate, and grant the sa_role and thereplicatio N_role to that user:
Isql–usa–p–sase1
1> sp_addlogin Ogguser,ogguser
2> Go
Password correctly set.
Account unlocked.
New Login created.
(Return status = 0)
1> sp_adduser Ogguser
2> Go
New user added.
(Return status = 0)
1> sp_role ' Grant ', Replication_role, Ogguser
2> Go
Authorization updated.
(Return status = 0) 1> sp_role ' Grant ', Sa_role, Ogguser
2> Go
Authorization updated.
(Return status = 0)
Step 5:start Ggsci
Export DSQUERY=ASE1
>./ggsci
ggsci> edit param Mgr Port 15002ggsci> start Mgr Ggsci> info Mgrmanager is running (IP Port syslab.us.oracle.com. 15002)
Tip: Whydoes I get the "unrecognized parameter (sourcedb)" error?
Make sure your set the DSQUERY environment variable, you can also include the source DB server in the dblogin command shown as follows:
dblogin sourcedb [email protected] userid ogguser password Ogguser
Ggs:sybase to Oracle