第一段:环境描述:
版本:
goldgate:
测试用户:
在oracle的hr下面创建几张表,在mysql创建一个hr数据库,看数据能否同步过去.
第二段:Oracle to Mysql 需要注意的地方:
Supported data types for mysql:
Oracle GoldenGate supports InnoDB storage engine for a source MySQL databasegoldengate对mysql只支持innodb引擎所以,在创建mysql端的表的时候,要指定表为innodb引擎.create table mysql (name char(10)) engine=innodb;
第三段:Oracle端的基础配置
①安装oracle11g略过
[oracle@ora11g 11.2]$ ./ggsci Oracle GoldenGate Command Interpreter for Oracle Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_12082③1258_FBO Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 20:20:21 Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved. GGSCI (ora11g) 1> create subdirs Creating subdirectories under current directory /u01/ogg/11.2 Parameter files /u01/ogg/11.2/dirprm: already exists Report files /u01/ogg/11.2/dirrpt: created Checkpoint files /u01/ogg/11.2/dirchk: created Process status files /u01/ogg/11.2/dirpcs: created SQL script files /u01/ogg/11.2/dirsql: created Database definitions files /u01/ogg/11.2/dirdef: created Extract data files /u01/ogg/11.2/dirdat: created Temporary files /u01/ogg/11.2/dirtmp: created Stdout files /u01/ogg/11.2/dirout: created
alter database add supplemental log data;
alter system set recyclebin=off scope=both;
--创建相应表空间 create tablespace oggtbs datafile '/u01/app/oracle/oradata/onimei1/oggtbs01.dbf' size 500M autoextend on; --授权 create user ggs identified by ggs default tablespace oggtbs; GRANT create table to ggs; GRANT CONNECT TO ggs; GRANT ALTER ANY TABLE TO ggs; GRANT ALTER SESSION TO ggs; GRANT CREATE SESSION TO ggs; GRANT FLASHBACK ANY TABLE TO ggs; GRANT SELECT ANY DICTIONARY TO ggs; GRANT SELECT ANY TABLE TO ggs; GRANT RESOURCE TO ggs; GRANT DELETE ANY TABLE TO ggs; GRANT INSERT ANY TABLE TO ggs; GRANT UPDATE ANY TABLE TO ggs; GRANT RESTRICTED SESSION TO ggs;
在源库上执行: GGSCI (ora11g) 2> edit params ./globals 在统计模式下输入并保存:ggschema ggs 在SQLPLUS 下去运行: sql> @sequence.sql 根据提示输入:ggs sqlplus / as sysdba sql> alter system set recyclebin=off deferred scope=both; #必须,针对ddl复制 sql> @marker_setup.sql prompt: ggs sql> @ddl_setup.sql prompt: ggs sql> @role_setup.sql sql> grant GGS_GGSUSER_ROLE to ggs; SQL> @ddl_enable.sql 10g需要安装dbms_share_pool包: sql> @?/rdbms/admin/dbmspool.sql sql> @ddl_pin ggs;
第四段:Mysql端的基础配置
mysql> use mysql Database changed mysql> UPDATE user SET Password=PASSWORD('123456') where USER='root' and host='root' or host='localhost'; Query OK, 2 rows affected (0.00 sec) Rows matched: 2 Changed: 2 Warnings: 0 mysql> show grants for root@localhost; +---------------------------------------------------------------------+ | Grants for root@localhost | +---------------------------------------------------------------------+ | GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION | | GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION | +---------------------------------------------------------------------+ 2 rows in set (0.00 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec) mysql> mysql> exit
mysqld_safe --user=mysql --log-bin=/tmp/binlog.001 --log-bin-index=/tmp/binlog.index --max-binlog-size=10M --binlog-do-db=mysql
[mysql@nosql2 11.2]$ ./ggsci Oracle GoldenGate Command Interpreter for MySQL Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_12042③0230 Linux, x64, 64bit (optimized), MySQL Enterprise on Apr 23 2012 04:34:25 Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved. GGSCI (nosql2) 1> create subdirs Creating subdirectories under current directory /u01/ogg/11.2 Parameter files /u01/ogg/11.2/dirprm: already exists Report files /u01/ogg/11.2/dirrpt: created Checkpoint files /u01/ogg/11.2/dirchk: created Process status files /u01/ogg/11.2/dirpcs: created SQL script files /u01/ogg/11.2/dirsql: created Database definitions files /u01/ogg/11.2/dirdef: created Extract data files /u01/ogg/11.2/dirdat: created Temporary files /u01/ogg/11.2/dirtmp: created Stdout files /u01/ogg/11.2/dirout: created GGSCI (nosql2) 2>
以上就是土嘎嘎小编为大家整理的配置ogg异构oracle-mysql_1)基础环境配置相关主题介绍,如果您觉得小编更新的文章只要能对粉丝们有用,就是我们最大的鼓励和动力,不要忘记讲本站分享给您身边的朋友哦!!