目的:本博文给出11.2.0.4 oracle数据库ogg搭建过程中,备库的准备过程包括2种方式:第一种是主库rman全量备份后恢复,第二种是expdp从主库导出用户然后在备库导入。
对ogg数据同步进行测试,主要偏重类似mysql的半同步数据,即备库从主库同步部分数据。
?
配置 主机 |
源端 |
目标端 |
主机名 |
ogg1 |
ogg2 |
IP地址 |
10.117.130.231 |
10.117.130.232 |
内存 |
3832MB |
3832MB |
数据库管理用户 |
uid=500(oracle) gid=601(oinstall) 组=601(oinstall),603(dba) |
uid=500(oracle) gid=601(oinstall) 组=601(oinstall),603(dba) |
数据库版本 |
11.2.0.4 |
11.2.0.4 |
ORACLE_HOME |
/u01/oracle/app/oracle/product/11.2.0.4/db |
/u01/oracle/app/oracle/product/11.2.0.4/db |
NIL_LANG |
AMERICAN_AMERICA.ZHS16GBK |
AMERICAN_AMERICA.ZHS16GBK |
OGG_HOME |
/u01/oracle/app/ogg |
/u01/oracle/app/ogg |
OGG版本 |
12.3.0.1.0 |
12.3.0.1.0 |
OGG管理用户/密码 |
GOLDENGATE/GOLDENGATE |
GOLDENGATE/GOLDENGATE |
OGG同步的用户 |
HR(示例库),ZHUL(模拟业务) |
[oracle@ogg1 response]$ pwd /u01/oracle/app/fbo_ggs_Linux_x64_shiphome/Disk1/response [oracle@ogg1 response]$ ls oggcore.rsp oggcore.rsp.bak [oracle@ogg1 response]$ cat oggcore.rsp #################################################################### ## Copyright(c) Oracle Corporation 2014. All rights reserved. ## ## ## ## Specify values for the variables listed below to customize ## ## your installation. ## ## ## ## Each variable is associated with a comment. The comment ## ## can help to populate the variables with the appropriate ## ## values. ## ## ## ## IMPORTANT NOTE: This file should be secured to have read ## ## permission only by the oracle user or an administrator who ## ## own this installation to protect any sensitive input values. ## ## ## #################################################################### #------------------------------------------------------------------------------- # Do not change the following system generated value. #------------------------------------------------------------------------------- oracle.install.responseFileVersion=/oracle/install/rspfmt_ogginstall_response_schema_v12_1_2 ################################################################################ ## ## ## Oracle GoldenGate installation option and details ## ## ## ################################################################################ #------------------------------------------------------------------------------- # Specify the installation option. # Specify ORA12c for installing Oracle GoldenGate for Oracle Database 12c and # ORA11g for installing Oracle GoldenGate for Oracle Database 11g #------------------------------------------------------------------------------- INSTALL_OPTION=ORA11g #------------------------------------------------------------------------------- # Specify a location to install Oracle GoldenGate #------------------------------------------------------------------------------- SOFTWARE_LOCATION=/u01/oracle/app/ogg #------------------------------------------------------------------------------- # Specify true to start the manager after installation. #------------------------------------------------------------------------------- START_MANAGER=true #------------------------------------------------------------------------------- # Specify a free port within the valid range for the manager process. # Required only if START_MANAGER is true. #------------------------------------------------------------------------------- MANAGER_PORT=1700 #------------------------------------------------------------------------------- # Specify the location of the Oracle Database. # Required only if START_MANAGER is true. #------------------------------------------------------------------------------- DATABASE_LOCATION=/u01/oracle/app/oracle/product/11.2.0.4/db ################################################################################ ## ## ## Specify details to Create inventory for Oracle installs ## ## Required only for the first Oracle product install on a system. ## ## ## ################################################################################ #------------------------------------------------------------------------------- # Specify the location which holds the install inventory files. # This is an optional parameter if installing on # Windows based Operating System. #------------------------------------------------------------------------------- INVENTORY_LOCATION=/u01/oracle/app/oraInventory #------------------------------------------------------------------------------- # Unix group to be set for the inventory directory. # This parameter is not applicable if installing on # Windows based Operating System. #------------------------------------------------------------------------------- UNIX_GROUP_NAME=oinstall [oracle@ogg1 response]$ |
7、开启源数据的同步日志
EXTRACT ext_hr setenv (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK ) userid GOLDENGATE,password GOLDENGATE rmthost 10.117.130.232,mgrport 1700 rmttrail /u01/oracle/app/ogg/dirdat/et TRANLOGOPTIONS EXCLUDEUSER GOLDENGATE ddl include all table hr.t,SQLPREDICATE "where salary>9000"; |
EXTRACT ext_zhul setenv (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK ) userid GOLDENGATE,password GOLDENGATE rmthost 10.117.130.232,mgrport 1700 rmttrail /u01/oracle/app/ogg/dirdat/ez TRANLOGOPTIONS EXCLUDEUSER GOLDENGATE --ddl include all table zhul.emp,SQLPREDICATE "where hiredate>'1982-01-02'"; |
[oracle@ogg1 response]$ pwd /u01/oracle/app/fbo_ggs_Linux_x64_shiphome/Disk1/response [oracle@ogg1 response]$ ls oggcore.rsp oggcore.rsp.bak [oracle@ogg1 response]$ cat oggcore.rsp #################################################################### ## Copyright(c) Oracle Corporation 2014. All rights reserved. ## ## ## ## Specify values for the variables listed below to customize ## ## your installation. ## ## ## ## Each variable is associated with a comment. The comment ## ## can help to populate the variables with the appropriate ## ## values. ## ## ## ## IMPORTANT NOTE: This file should be secured to have read ## ## permission only by the oracle user or an administrator who ## ## own this installation to protect any sensitive input values. ## ## ## #################################################################### #------------------------------------------------------------------------------- # Do not change the following system generated value. #------------------------------------------------------------------------------- oracle.install.responseFileVersion=/oracle/install/rspfmt_ogginstall_response_schema_v12_1_2 ################################################################################ ## Oracle GoldenGate installation option and details ## ################################################################################ #------------------------------------------------------------------------------- # Specify the installation option. # Specify ORA12c for installing Oracle GoldenGate for Oracle Database 12c and # ORA11g for installing Oracle GoldenGate for Oracle Database 11g #------------------------------------------------------------------------------- INSTALL_OPTION=ORA11g #------------------------------------------------------------------------------- # Specify a location to install Oracle GoldenGate #------------------------------------------------------------------------------- SOFTWARE_LOCATION=/u01/oracle/app/ogg #------------------------------------------------------------------------------- # Specify true to start the manager after installation. #------------------------------------------------------------------------------- START_MANAGER=true #------------------------------------------------------------------------------- # Specify a free port within the valid range for the manager process. # Required only if START_MANAGER is true. #------------------------------------------------------------------------------- MANAGER_PORT=1700 #------------------------------------------------------------------------------- # Specify the location of the Oracle Database. # Required only if START_MANAGER is true. #------------------------------------------------------------------------------- DATABASE_LOCATION=/u01/oracle/app/oracle/product/11.2.0.4/db ################################################################################ ## Specify details to Create inventory for Oracle installs ## ## Required only for the first Oracle product install on a system. ## ################################################################################ #------------------------------------------------------------------------------- # Specify the location which holds the install inventory files. # This is an optional parameter if installing on # Windows based Operating System. #------------------------------------------------------------------------------- INVENTORY_LOCATION=/u01/oracle/app/oraInventory #------------------------------------------------------------------------------- # Unix group to be set for the inventory directory. # This parameter is not applicable if installing on # Windows based Operating System. #------------------------------------------------------------------------------- UNIX_GROUP_NAME=oinstall [oracle@ogg1 response]$ |
start mgr
--Replicat group -- replicat rep_hr SETENV (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK) --source and target definitions ASSUMETARGETDEFS HANDLECOLLISIONS --target database login -- userid GOLDENGATE, password GOLDENGATE --file for dicarded transaction -- discardfile /u01/oracle/app/ogg/rep_hr_discard.txt, append, megabytes 10 --ddl support DDL DDL INCLUDE ALL DDLERROR DEFAULT IGNORE RETRYOP --Specify table mapping --- MAP hr.t, TARGET hr.t, WHERE (salary > 9000); |
--Replicat group -- replicat rep_zhul SETENV (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK) --source and target definitions ASSUMETARGETDEFS HANDLECOLLISIONS --target database login -- userid GOLDENGATE, password GOLDENGATE --file for dicarded transaction -- discardfile /u01/oracle/app/ogg/rep_zhul_discard.txt, append, megabytes 10 --ddl support DDL --DDL INCLUDE ALL --DDLERROR DEFAULT IGNORE RETRYOP --Specify table mapping --- MAP zhul.emp, TARGET zhul.emp, WHERE (hiredate>'1982-01-02'); |
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。