您好,登錄后才能下訂單哦!
目的:本博文給出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進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。