欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 运维知识 > 数据库 >内容正文

数据库

异构平台同步(Mysql到Oracle)

发布时间:2025/3/17 数据库 40 豆豆
生活随笔 收集整理的这篇文章主要介绍了 异构平台同步(Mysql到Oracle) 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

Oracle GoldenGate学习之--异构平台同步(MySQL到Oracle)

如图所示:源端采用Mysql库,目标端采用Oracle库

一、OGG安装配置(源端)

1、OGG下载

https://edelivery.oracle.com/EPD/Download/get_form?egroup_aru_number=14841438

https://edelivery.oracle.com/EPD/Download/get_form?egroup_aru_number=14841440

[oracle@ogg ogg_ms]$ uname -a

Linux ogg 2.6.32-71.el6.i686 #1 SMP Wed Sep 1 01:26:34 EDT 2010 i686 i686 i386 GNU/Linux

1 2 3 4 [oracle@ogg ~]$ cd /u01/ogg_ms/ [oracle@ogg ogg_ms]$ ls ggs_Linux_x86_MySQL_32bit.tar [oracle@ogg ogg_ms]$ tar xvf ggs_Linux_x86_MySQL_32bit.tar

 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 [oracle@ogg ogg_ms]$ ./ggsci Oracle GoldenGate Command Interpreter for MySQL Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230 Linux, x86, 32bit (optimized), MySQL Enterprise on Apr 23 2012 04:29:30 Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved. GGSCI (ogg) 1> create subdirs Creating subdirectories under current directory /u01/ogg_ms Parameter files                /u01/ogg_ms/dirprm: already exists Report files                   /u01/ogg_ms/dirrpt: created Checkpoint files               /u01/ogg_ms/dirchk: created Process status files           /u01/ogg_ms/dirpcs: created SQL script files               /u01/ogg_ms/dirsql: created Database definitions files     /u01/ogg_ms/dirdef: created Extract data files             /u01/ogg_ms/dirdat: created Temporary files                /u01/ogg_ms/dirtmp: created Stdout files                   /u01/ogg_ms/dirout: created

二、数据库配置

源端:mysql库配置

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 数据库配置文件: [root@ogg ~]# cat /etc/my.cnf # Replication Master Server (default) # binary logging is required for replication log-bin=mysql-bin # binary logging format - mixed recommended #binlog_format=mixed   binlog_format=row 启动数据库服务 [root@ogg ~]# service mysql start Starting MySQL   连接数据库                                           [  OK  ] [root@ogg ~]# mysql -h localhost -u mysql -p Enter password: Welcome to the MySQL monitor.  Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.6.4-m7-log Source distribution Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL v2 license Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases; +--------------------+ | Database           | +--------------------+ | information_schema | | mysql              | | performance_schema | | test               | +--------------------+ 4 rows in set (0.00 sec) mysql> use test; Database changed mysql> show tables; Empty set (0.00 sec) 创建测试表(存储引擎采用innodb) mysql> create table test2 (id int,name char(10)) engine=innodb; Query OK, 0 rows affected (0.02 sec) mysql> show tables; +----------------+ | Tables_in_test | +----------------+ | test2          | +----------------+ 1 row in set (0.00 sec) mysql> select * from test2; Empty set (0.00 sec)



本文转自 张冲andy 博客园博客,原文链接: http://www.cnblogs.com/andy6/p/6159060.html  ,如需转载请自行联系原作者


新人创作打卡挑战赛发博客就能抽奖!定制产品红包拿不停!

总结

以上是生活随笔为你收集整理的异构平台同步(Mysql到Oracle)的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。