您好,登錄后才能下訂單哦!
目的:本博文給出11.2.0.4 oracle數(shù)據(jù)庫ogg搭建過程中,備庫的準(zhǔn)備過程包括2種方式:第一種是主庫rman全量備份后恢復(fù),第二種是expdp從主庫導(dǎo)出用戶然后在備庫導(dǎo)入。
對(duì)ogg數(shù)據(jù)同步進(jìn)行測(cè)試,主要偏重類似mysql的半同步數(shù)據(jù),即備庫從主庫同步部分?jǐn)?shù)據(jù)。
?
配置 主機(jī) |
源端 |
目標(biāo)端 |
主機(jī)名 |
ogg1 |
ogg2 |
IP地址 |
10.117.130.231 |
10.117.130.232 |
內(nèi)存 |
3832MB |
3832MB |
數(shù)據(jù)庫管理用戶 |
uid=500(oracle) gid=601(oinstall) 組=601(oinstall),603(dba) |
uid=500(oracle) gid=601(oinstall) 組=601(oinstall),603(dba) |
數(shù)據(jù)庫版本 |
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(模擬業(yè)務(wù)) |
[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、開啟源數(shù)據(jù)的同步日志
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'); |
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。