Oracle GoldenGate系統之----相關引數說明
一、配置檔案存放位置
[oracle@dg ~]$ cd /u01/app/ogg/dirprm/
[oracle@dg dirprm]$ ls
dgrac.prm extb.prm extdg.prm jagent.prm mgr.prm rep1.prm
二、 管理程式mgr配置檔案
[oracle@dg dirprm]$ more mgr.prm
PORT 7801 -- 監聽埠PORT
DYNAMICPORTLIST 7802-7820 -- 開啟其他程式使用埠(數量決定最大程式數)
AUTOSTART ER * -- 開啟管理程式後,自動啟動所有的EXTRACT及REPLICAT程式
AUTORESTART ER *,RETRIES 3,WAITMINUTES 2,RESETMINUTES 60 -- 自動重啟異常中止的程式,重試3次,每次等2分鐘,一小時後重試
STARTUPVALIDATIONDELAY 5 -- 啟動時延遲5秒校驗
PURGEOLDEXTRACTS ./dirdat/*,USECHECKPOINTS,MINKEEPDAYS 7 -- 自動清理EXTRACT目錄檔案,保留7天
三、 抽取程式,程式名不超過8個字元
[oracle@dg dirprm]$ more extdg.prm
#定義extract
extract extdg
#程式環境設定
setenv(NLS_LANG="AMERICAN_AMERICA.ZHS16GBK")
setenv(ORACLE_SID="wailon")
#使用者登入資訊,userid username@dbname,password userpwd
userid scott,password tiger
#排除以下使用者的相關資訊
--tranlogoptions excludeuser scott
#生成EXTRACT TRAIL檔案位置,2個字元開頭,其他自動生成
exttrail /u01/app/ogg/dirdat/dg
#動態分析表結構
dynamicresolution
#捕捉TRUNCATE操作
gettruncates
#定義需要同步的表,可使用萬用字元*
table scott.*;
四、 PUMP傳送程式,extract程式的一種,把生成的EXTRACT TRAIL檔案傳送到遠端伺服器
[oracle@dg dirprm]$ more dgrac.prm
extract dgrac
setenv(NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
userid tiger
#遠端伺服器配置資訊
rmthost 192.168.56.131,mgrport 7801
#遠端伺服器生成的TRAIL檔案
rmttrail /u01/app/ogg/dirdat/dg
#直通模式或普通模式,兩邊表名及列名一樣用直通,否則用普通配置自定義對映
--NOPASSTHRU
PASSTHRU
gettruncates
table scott.*;
五、 應用程式replicat,程式名不超過8個字元
[oracle@dg dirprm]$ more rep1.prm
#定義replicat組名
replicat rep1
setenv(NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
userid , password tiger
#兩邊資料庫型別及結構一致時用ASSUMETARGETDEFS;否則使用SOURCEDEFS資料結構定義檔案,實現不同資料庫間同步
--assumetargetdefs
sourcedefs /u01/app/ogg/dirdef/emp.def
#應用資料出錯,預設丟棄
reperror default,discard
#丟棄的資料儲存檔案
discardfile /u01/app/ogg/dirout/rep1.dsc,append,megabytes 100
gettruncates
batchsql
#源物件和目標物件對映關係,列名不一樣時用colmap,列名用雙引號引用,列名與“=”之間有空格
map scott.b, target scott.b, &
colmap(usedefaults, "OWNER" = "USERNAME");
#表對映關係,注意target前有一個空格
map scott.emp, target scott.emp;
map scott.dept, target scott.dept;
六、 初始化載入
1、源端
[oracle@dg dirprm]$ more extb.prm
extract extb
setenv(NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
userid , password tiger
rmthost 192.168.56.131, mgrport 7801
rmttask replicat, group repb
table scott.b;
2、目標端
[oracle@dgrac dirprm]$ more repb.prm
replicat repb
assumetargetdefs
userid , password tiger
reperror default,discard
discardfile /u01/app/ogg/dirtmp/repb.dsc,append,megabytes 100
#INSERTAPPEND 直接路徑載入,提高載入速度
--INSERTAPPEND
#當目標端存在相同資料時,忽略重複資料錯誤
HANDLECOLLISIONS
map scott.b, target scott.b;
[oracle@dgrac dirprm]$ -- 資料定義檔案引數檔案
[oracle@dgrac dirprm]$ more defgen.prm
defsfile /u01/app/ogg/dirdef/emp.def
userid tiger
table scott.emp;
table scott.dept;
table scott.b;
[oracle@dgrac dirprm]$ cd ..
[oracle@dgrac ogg]$ -- 根據引數檔案生成資料定義檔案
[oracle@dgrac ogg]$ ./defgen paramfile dirprm/defgen.prm
[oracle@dg ogg]$ cd dirdef/
[oracle@dg dirdef]$ -- 資料定義檔案目錄
[oracle@dg dirdef]$ ls
emp.def
[oracle@dg dirdef]$ -- 資料定義檔案格式
[oracle@dg dirdef]$ more emp.def
*+- Defgen version 2.0, Encoding US-ASCII
*
* Definitions created/modified 2013-09-25 23:16
*
* Field descriptions for each column entry:
*
* 1 Name
* 2 Data Type
* 3 External Length
* 4 Fetch Offset
* 5 Scale
* 6 Level
* 7 Null
* 8 Bump if Odd
* 9 Internal Length
* 10 Binary Length
* 11 Table Length
* 12 Most Significant DT
* 13 Least Significant DT
* 14 High Precision
* 15 Low Precision
* 16 Elementary Item
* 17 Occurs
* 18 Key Column
* 19 Sub Data Type
*
Database type: ORACLE
Character set ID: windows-936
National character set ID: UTF-16
Locale: neutral
Case sensitivity: 14 14 14 14 14 14 14 14 14 14 14 14 11 14 14 14
*
Definition for table SCOTT.EMP
Record length: 112
Syskey: 0
Columns: 8
EMPNO 134 8 0 0 0 1 0 8 8 8 0 0 0 0 1 0 1 3
ENAME 64 10 12 0 0 1 0 10 10 0 0 0 0 0 1 0 0 0
JOB 64 9 28 0 0 1 0 9 9 0 0 0 0 0 1 0 0 0
MGR 134 8 42 0 0 1 0 8 8 8 0 0 0 0 1 0 0 3
HIREDATE 192 19 54 0 0 1 0 19 19 19 0 5 0 0 1 0 0 0
SAL 134 9 76 2 0 1 0 8 8 8 0 0 0 0 1 0 0 3
COMM 134 9 88 2 0 1 0 8 8 8 0 0 0 0 1 0 0 3
DEPTNO 134 8 100 0 0 1 0 8 8 8 0 0 0 0 1 0 0 3
End of definition
*
Definition for table SCOTT.DEPT
Record length: 50
Syskey: 0
Columns: 3
DEPTNO 134 8 0 0 0 1 0 8 8 8 0 0 0 0 1 0 1 3
DNAME 64 14 12 0 0 1 0 14 14 0 0 0 0 0 1 0 0 0
LOC 64 13 32 0 0 1 0 13 13 0 0 0 0 0 1 0 0 0
End of definition
*
Definition for table SCOTT.B
Record length: 532
Syskey: 0
Columns: 15
USERNAME 64 30 0 0 0 1 0 30 30 0 0 0 0 0 1 0 0 0
OBJECT_NAME 64 128 36 0 0 1 0 128 128 0 0 0 0 0 1 0 0 0
SUBOBJECT_NAME 64 30 170 0 0 1 0 30 30 0 0 0 0 0 1 0 0 0
OBJECT_ID 64 50 206 0 0 1 0 50 50 50 0 0 0 0 1 0 1 2
DATA_OBJECT_ID 64 50 262 0 0 1 0 50 50 50 0 0 0 0 1 0 0 2
OBJECT_TYPE 64 19 318 0 0 1 0 19 19 0 0 0 0 0 1 0 0 0
CREATED 192 19 342 0 0 1 0 19 19 19 0 5 0 0 1 0 0 0
LAST_DDL_TIME 192 19 364 0 0 1 0 19 19 19 0 5 0 0 1 0 0 0
TIMESTAMP 64 19 386 0 0 1 0 19 19 0 0 0 0 0 1 0 0 0
STATUS 64 7 410 0 0 1 0 7 7 0 0 0 0 0 1 0 0 0
TEMPORARY 64 1 422 0 0 1 0 1 1 0 0 0 0 0 1 0 0 0
GENERATED 64 1 428 0 0 1 0 1 1 0 0 0 0 0 1 0 0 0
SECONDARY 64 1 434 0 0 1 0 1 1 0 0 0 0 0 1 0 0 0
NAMESPACE 64 50 440 0 0 1 0 50 50 50 0 0 0 0 1 0 0 2
EDITION_NAME 64 30 496 0 0 1 0 30 30 0 0 0 0 0 1 0 0 0
End of definition
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30345407/viewspace-1814270/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- mysql innodb相關引數說明MySql
- mysql relay log相關引數說明MySql
- GoldenGate HANDLECOLLISIONS引數使用說明Go
- Goldengate引數簡要說明Go
- statspack 安裝以及相關引數說明
- Kafka 配置引數彙總及相關說明Kafka
- oracle引數說明(zt)Oracle
- GoldenGate 配置文件,裡面有引數說明Go
- Oracle8i,9i Standby引數設定及相關說明Oracle
- Oracle sessions,processes 和 transactions 引數 關係 說明OracleSession
- linux系統基於oracle的核心引數配置說明LinuxOracle
- Oracle Table建立引數說明Oracle
- Oracle Table 建立引數 說明Oracle
- Oracle Sequence Cache 引數說明Oracle
- linux 跟oracle相關的系統核心引數?LinuxOracle
- 幾個和MySQL InnoDB相關的引數設定說明MySql
- 網頁上的Mediaplayer播放器相關引數說明網頁播放器
- Oracle8i,9i, 10g Standby配置及相關引數, 操作說明Oracle
- Oracle 啟動例程 STARTUP引數說明Oracle
- Oracle TIMED_STATISTICS 引數 說明Oracle
- Oracle 表空間 建立引數 說明Oracle
- TOP引數說明
- mysqldump引數說明MySql
- mysqldump 引數說明MySql
- MySQL引數說明MySql
- 【AMM】關於ASM中AMM引數說明ASM
- oracle安裝記憶體引數說明Oracle記憶體
- oracle 身份認證相關引數Oracle
- Oracle Data Gurad Physical Standby 相關說明Oracle
- Elasticsearch 引數配置說明Elasticsearch
- kafka 引數配置說明Kafka
- redis 3.0 引數說明Redis
- golden gate 引數說明Go
- pct_free_pct_used,ini_trans之相關引數系統(一)
- MySQL 5.7 自增欄位相關引數說明MySql
- 檔案系統 第八次迭代 VFS相關說明
- ORACLE安裝引數sysctl.conf說明Oracle
- oracle10g初始化引數說明Oracle