GGS: Sybase to Oracle
Step 1: Start the GGSCI on Source and Target
| Source | Target |
|
Oracle GoldenGate Command Interpreter for Sybase |
Oracle GoldenGate Command Interpreter for Oracle |
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 are different, it is a good practice to use the 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 port 15021 GGSCI> start mgr |
GGSCI> edit param mgr
port 15021 GGSCI> start mgr |
Step 2: Set up the Source and Target Database
创建city表
| Source (Sybase ASE 16) | Target (Oracle Database 11.2.0.1) |
|
isql -Uogguser -Pogguser -SASE1 create table city (id int, name varchar(10) insert into city values (1,'New York') > select count(1) from city |
connect swat/swat create table city (id int, name varchar2(10); insert into city values (1,'New York'); > 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 that 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 the “dbcc settrunc(‘ltm’,valid)” command. The detailed steps are 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 that Oracle GoldenGate user can access on the target database shown as follows:
| Source | Target |
|
GGSCI >dblogin sourcedb pubs2@ASE1 userid ogguser password ogguser GGSCI > info trandata dbo.city Transaction logging disabled for table dbo.city GGSCI > add trandata dbo.city Transaction logging enabled for table suser.regions. |
GGSCI > dblogin userid swat, password swat 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 characters such as “_” in the database and schema name. The current solution is to remove the special characters.
Because we are working on heterogeneous database replication, you have 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 sourcedb pubs2@ASE1 userid ogguser password ogguser statoptions resetreportstats report at 00:01 reportcount every 60 seconds, rate table dbo.city; |
rmaster.prm:
replicat rmaster 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 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; ---- ---------------------- 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; ---- ---------------------- 1 Europe 2 Americas 3 Asia 4 Middle East and Africa |
Now, we have completed the basic setups of a one-way replication from Sybase ASE database to Oracle Database.Feel free to let me know if you have any questions or comments on the tips I provided above.
Installing Oracle GoldenGate for Sybase:
Step 1: Download Oracle GoldenGate for Sybase
Step 2: Unzip the Oracle GoldenGate zip 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 (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 are 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 thereplication_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 15002
GGSCI> start mgr
GGSCI> info mgr
Manager is running (IP port syslab.us.oracle.com.15002)
Tip:Why do I get the "unrecognized parameter (SOURCEDB)" error?
Make sure you set the DSQUERY environment variable, you can also include the source DB server in the dblogin command shown as follows:
dblogin sourcedb sydatabase@ASE1 userid ogguser password ogguser
port 15002
GGSCI> start mgr
GGSCI> info mgr
Manager is running (IP port syslab.us.oracle.com.15002)
Make sure you set the DSQUERY environment variable, you can also include the source DB server in the dblogin command shown as follows:
GGS: Sybase to Oracle的更多相关文章
- sql: sybase与oracle中insert into select和select into的用法
1. sybase与oracle中insert into select和select into的用法 http://wjlvivid.iteye.com/blog/1921679 Sybase 一.首 ...
- sql: sybase 和 oracle 比较
1. sybase 和 oracle 比较 http://blog.itpub.net/14067/viewspace-1030014/ Oracle采用多线索多进程体系结构 Sybase采用单进程多 ...
- Sybase to Oracle Golden Gate
Sybase 安装Golden Gate: 下载,然后create subdirs.并且在两端配置好mgr,设置好端口7809 创建golden gate用户ogguser,并且给它授权sa和repl ...
- sybase数据库和oracle数据库中字段中含有换行符的解决办法
最近在做数据库从sybase到oracle的迁移工作,sybase数据库表bcp导出后,通过sqlldr导入到oracle数据库,然后oracle数据库通过spool按照sybase数据库bcp的格式 ...
- 76 道 Oracle Goldengate 面试问题
基础 12c新特性 性能 Troubleshoot 其它 1. Oracle Goldengate 支持部署到哪些拓扑? GoldenGate supports the following topol ...
- Oracle的学习一:安装与卸载、sql *plus常用命令、Oracle用户管理
1.为什么学习oracle? 性能优越: 小型数据库 中型数据库 大型数据库 acess.foxbase mysql.sql server.informix sybase.oracle.db2 复杂量 ...
- oracle日记
win7旗舰版安装oracle11g 64位用sql plus可以登录 但用pl/sql dev报错ORA-12560 小型数据库:access.foxbase 中型数据库:mysql.sqlserv ...
- [置顶] Oracle 11g ASM:如何在 ASMCMD 命令行工具中创建 Oracle ACFS 文件系统
实验环境:Oracle 11g R2 RAC (11.2.0.3.5) Oracle Enterprise Linux 5.6 x86 1.创建 ASM 磁盘组 在两节点 ...
- Zero Downtime Upgrade of Oracle 10g to Oracle 11g Using GoldenGate — 3
DDL Setup Steps SQL> grant execute on utl_file to ggs; Grant succeeded. Create GLOBALS file [orac ...
随机推荐
- 一路踩过的坑 php
1.数据表唯一索引 (两列字段,组合索引) 遇到的情形:项目搭建新测试环境(其实就是所谓的灰度 与线上一致的一个环境):从线上拉回来代码搭建的,数据也是来自于线上数据,但是由于线上数据有部分为机密数 ...
- CSAPP2e:Shell lab 解答
期中之后的第一个lab 就是实现一个简单的Shell 程序,程序的大部分已经写好,只需要实现 eval 函数和处理信号的sigchld_handle, sigint_handle, sigtstp_h ...
- Linux勉強
block 與 inode 的總量: 未使用與已使用的 inode / block 數量: block 與 inode 的大小 (block 為 1, 2, 4K,inode 為 128 by ...
- ruby学习--block
#当前块 class Block def a_method return yield if block_given? 'no block' end end obj=Block.new puts &qu ...
- 【转】用java实例学习MVC模式
.1 MVC模式 MVC是三个单词的缩写,这三个单词分别为:模型(Model).视图(View)和控制(Controller).MVC模式的目的就是实现Web系统的职能分工.下面以J2EE开发进行介绍 ...
- 符号渲染篇——Symbol
Symbol 是对 Graphic 对象进行符号样式设置的接口,所有符号样式类都实现了 Symbol 接口. 1.PictureMarkerSymbolPictureMarkerSymbol 是对于点 ...
- 解决PHP中file_get_contents抓取网页中文乱码问题
根据网上有朋友介绍说原因可能是服务器开了GZIP压缩. 下面是用firebug查看我的博客的头信息,Gzip是开了的. 请求头信息原始头信息 代码如下 复制代码 Accept text/html,ap ...
- vSphere存储
write by xiaoyang 配置iSCSI外部存储 1. 选择配置——硬件——存储 2. 在存储适配器里选择添加软件iSCSI适配器 3. 确认添加 4. ...
- 【转】 memwatch使用说明书
memwatch使用说明书 1.memwatch是什么? memwatch是C语言的内存检测器.除了检测内存的功能外,它同样可以做其它的一些事情,而我们主要还是在于讲述它的基本功能.如果你真的想 ...
- Mac下利用eclipse打包cocos2dx安卓apk
上一篇博客中我们已经配置好了JDK和ANT,接下来我们就可以使用eclipse将我们开发好的cocos2dx项目进行打包了. 首先,我们需要准备好下面的内容 配置环境变量,打开"终端&quo ...