add exttrail 和add rmttail總結

還不算暈發表於2013-10-28
總結:
1.使用PUMP--資料泵時:
exttrail建立的trail檔案是本地的,是給extract程式使用,將捕獲的日誌資料寫入到trail檔案中。
DataPump程式需要在引數檔案中指定本地建立的exttrail檔案,然後從這個檔案中讀取日誌資料。
然後還要在目標端建立一個rmtrail檔案,這個檔案是DataPump程式通過網路寫入到目標資料庫。
目標資料庫Replicat程式就去讀rmttail指定過來的trail檔案,然後應用到資料庫中。


2.不使用PUMP--資料泵時:

add exttrail 和add rmttail的效果是一樣的,建立的trail都是在遠端的目標端的。

#########################################

實驗:不使用PUMP時add exttrail 和add rmttail的效果是一樣的

1.源庫的配置:  --檢查發現 add exttrail /u01/ogg/dirdat/test/et, extract ext6  所指定的檔案並沒有在本地建立。

GGSCI (bys001.oel.com) 7> add extract ext6,tranlog, begin now
EXTRACT added.

GGSCI (bys001.oel.com) 8> exit
[oracle@bys001 ogg]$ ls dirdat/   
at000000  at000001  bt000000  rep2_discard.txt
[oracle@bys001 ogg]$ date
Sat Aug 31 19:17:53 CST 2013
[oracle@bys001 ogg]$ ./ggsci                        
GGSCI (bys001.oel.com) 1> add exttrail /u01/ogg/dirdat/test/et, extract ext6
EXTTRAIL added.

GGSCI (bys001.oel.com) 2> edit params ext6
extract ext6
userid ogg, password ogg
rmthost 192.168.1.213, mgrport 7809
rmttrail /u01/ogg/dirdat/test/et

table test6.test6;
~                                                                                                           
GGSCI (bys001.oel.com) 5> start ext6
Sending START request to MANAGER ...
EXTRACT EXT6 starting
GGSCI (bys001.oel.com) 6> info all
Program     Status      Group       Lag at Chkpt  Time Since Chkpt
MANAGER     RUNNING                                          
EXTRACT     ABENDED     EXT1        00:00:00      45:22:13   
EXTRACT     ABENDED     EXT3        00:00:00      45:20:12   
EXTRACT     RUNNING     EXT6        00:00:00      00:01:57   
EXTRACT     ABENDED     EXTMYSQL    00:00:00      07:18:42   
EXTRACT     ABENDED     EXTORA      00:00:00      07:18:41   
EXTRACT     ABENDED     PUMP3       00:00:00      45:22:15   
REPLICAT    ABENDED     REP2        00:00:00      45:20:15   

GGSCI (bys001.oel.com) 8> exit
[oracle@bys001 ogg]$ date                        
Sat Aug 31 19:19:41 CST 2013
[oracle@bys001 ogg]$ ls dirdat/      ---源庫中未建立相應文件。                  
at000000  at000001  bt000000  rep2_discard.txt

2.目標庫配置:

逐次輸入以下命令:
dblogin userid ogg,password ogg
add checkpointtable ogg.checkpoint          --這裡如果是初次增加可以執行。已經使用過此語句增加表再執行會報錯。
add replicat rep6,exttrail /u01/ogg/dirdat/test/et, checkpointtable ogg.checkpoint
edit params rep6
在彈出編輯視窗輸入以下:
replicat rep6
handlecollisions
assumetargetdefs
userid ogg,password ogg
discardfile /u01/ogg/dirdat/rep6_discard.txt,append, megabytes 10
map test6.test6, target test6.test6;
啟動此程式。

雙方程式都啟動後,在目標庫可以看到源庫中add exttrail /u01/ogg/dirdat/test/et, extract ext6指定的檔案還是建立在了目標庫上。--程式啟動後建立
[oracle@bys2 ogg]$ ls -al  dirdat/test/
total 16
drwxr-xr-x 2 oracle oinstall 4096 Aug 31 19:19 .
drwxrwxr-x 3 oracle oinstall 4096 Aug 31 19:09 ..
-rw-rw-rw- 1 oracle oinstall 1276 Aug 31 19:19 et000000
-rw-rw-rw- 1 oracle oinstall 1520 Aug 31 19:20 et000001

##########################

3.測試資料同步是可以的

[oracle@bys001 ogg]$ sqlplus test6/test6            
TEST6@bys1>set time on
19:20:44 TEST6@bys1>insert into test6 values(123);
1 row created.
19:20:49 TEST6@bys1>commit;
Commit complete.
19:20:53 TEST6@bys1>
#######################
目標庫查詢
[oracle@bys2 ogg]$ sqlplus test6/test6     
TEST6@bys2>select * from test6;

        AA
----------
       123
       811
       888

4.源庫OGG日誌:

從使用add exttrail /u01/ogg/dirdat/test/et, extract ext6語句開始

2013-08-31 19:17:13  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (oracle): delete extract ext6.
2013-08-31 19:17:28  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (oracle): add extract ext6 tranlog, begin now.
2013-08-31 19:18:00  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (oracle): add exttrail /u01/ogg/dirdat/test/et  extract ext6.
2013-08-31 19:18:09  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (oracle): edit params ext6.
2013-08-31 19:19:19  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (oracle): start ex.
2013-08-31 19:19:23  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (oracle): start ext6.
###############################
2013-08-31 19:19:23  INFO    OGG-00963  Oracle GoldenGate Manager for Oracle, mgr.prm: Command received from GGSCI on host bys001.oel.com (START EXTRACT EXT6 ).
2013-08-31 19:19:23  INFO    OGG-00975  Oracle GoldenGate Manager for Oracle, mgr.prm:  EXTRACT EXT6 starting.
2013-08-31 19:19:23  INFO    OGG-00992  Oracle GoldenGate Capture for Oracle, ext6.prm:  EXTRACT EXT6 starting.
2013-08-31 19:19:23  INFO    OGG-03035  Oracle GoldenGate Capture for Oracle, ext6.prm:  Operating system character set identified as UTF-8. Locale: en_US, LC_ALL:.
2013-08-31 19:19:24  INFO    OGG-03500  Oracle GoldenGate Capture for Oracle, ext6.prm:  WARNING: NLS_LANG environment variable does not match database character set, or not set. Using database character set value of AL32UTF8.
2013-08-31 19:19:24  INFO    OGG-01635  Oracle GoldenGate Capture for Oracle, ext6.prm:  BOUNDED RECOVERY: reset to initial or altered checkpoint.
2013-08-31 19:19:24  INFO    OGG-01815  Oracle GoldenGate Capture for Oracle, ext6.prm:  Virtual Memory Facilities for: BR
    anon alloc: mmap(MAP_ANON)  anon free: munmap
    file alloc: mmap(MAP_SHARED)  file free: munmap
    target directories:
    /u01/ogg/BR/EXT6.
2013-08-31 19:19:24  INFO    OGG-01815  Oracle GoldenGate Capture for Oracle, ext6.prm:  Virtual Memory Facilities for: COM
    anon alloc: mmap(MAP_ANON)  anon free: munmap
    file alloc: mmap(MAP_SHARED)  file free: munmap
    target directories:
    /u01/ogg/dirtmp.
2013-08-31 19:19:25  INFO    OGG-01515  Oracle GoldenGate Capture for Oracle, ext6.prm:  Positioning to begin time Aug 31, 2013 7:17:28 PM.
2013-08-31 19:19:25  INFO    OGG-01516  Oracle GoldenGate Capture for Oracle, ext6.prm:  Positioned to Sequence 38, RBA 4098048, SCN 0.0, Aug 31, 2013 7:17:28 PM.
2013-08-31 19:19:25  INFO    OGG-00993  Oracle GoldenGate Capture for Oracle, ext6.prm:  EXTRACT EXT6 started.
2013-08-31 19:19:30  INFO    OGG-01226  Oracle GoldenGate Capture for Oracle, ext6.prm:  Socket buffer size set to 27985 (flush size 27985).
2013-08-31 19:19:30  INFO    OGG-01056  Oracle GoldenGate Capture for Oracle, ext6.prm:  Recovery initialization completed for target file /u01/ogg/dirdat/test/et000000, at RBA 1276, CSN 1532424.
2013-08-31 19:19:30  INFO    OGG-01478  Oracle GoldenGate Capture for Oracle, ext6.prm:  Output file /u01/ogg/dirdat/test/et is using format RELEASE 11.2.
2013-08-31 19:19:30  WARNING OGG-01438  Oracle GoldenGate Capture for Oracle, ext6.prm:  Checkpoint marked as from graceful shutdown, but records found after checkpoint in trail /u01/ogg/dirdat/test/et.  Expected EOF Seqno 0, RBA 0.  Found Seqno 0, RBA 1276.
2013-08-31 19:19:30  INFO    OGG-01026  Oracle GoldenGate Capture for Oracle, ext6.prm:  Rolling over remote file /u01/ogg/dirdat/test/et000001.
2013-08-31 19:19:30  INFO    OGG-01517  Oracle GoldenGate Capture for Oracle, ext6.prm:  Position of first record processed Sequence 38, RBA 4098064, SCN 0.1532477, Aug 31, 2013 7:17:39 PM.
2013-08-31 19:20:54  INFO    OGG-01054  Oracle GoldenGate Capture for Oracle, ext6.prm:  Recovery completed for target file /u01/ogg/dirdat/test/et000001, at RBA 1396, CSN 1532424.
2013-08-31 19:20:54  INFO    OGG-01057  Oracle GoldenGate Capture for Oracle, ext6.prm:  Recovery completed for all targets.

5.目標庫OGG日誌:

2013-08-31 19:16:20  INFO    OGG-01670  Oracle GoldenGate Collector for Oracle:  Closing /u01/ogg/dirdat/test/et000000.
2013-08-31 19:16:20  INFO    OGG-01675  Oracle GoldenGate Collector for Oracle:  Terminating because extract is stopped.
#############################
2013-08-31 19:19:10  INFO    OGG-00963  Oracle GoldenGate Manager for Oracle, mgr.prm:  Command received from EXTRACT on host bys001.oel.com (START SERVER CPU -1 PRI -1  TIMEOUT 300 PARAMS ).
2013-08-31 19:19:10  INFO    OGG-01677  Oracle GoldenGate Collector for Oracle:  Waiting for connection (started dynamically).
2013-08-31 19:19:10  INFO    OGG-00963  Oracle GoldenGate Manager for Oracle, mgr.prm:  Command received from SERVER on host localhost.localdomain (REPORT 16782 7819).
2013-08-31 19:19:10  INFO    OGG-00974  Oracle GoldenGate Manager for Oracle, mgr.prm:  Manager started collector process (Port 7819).
2013-08-31 19:19:10  INFO    OGG-01228  Oracle GoldenGate Collector for Oracle:  Timeout in 300 seconds.
2013-08-31 19:19:15  INFO    OGG-01229  Oracle GoldenGate Collector for Oracle:  Connected to bys001.oel.com:20294.
2013-08-31 19:19:15  INFO    OGG-01669  Oracle GoldenGate Collector for Oracle:  Opening /u01/ogg/dirdat/test/et000000 (byte -1, current EOF 1276).
2013-08-31 19:19:15  INFO    OGG-01670  Oracle GoldenGate Collector for Oracle:  Closing /u01/ogg/dirdat/test/et000000.
2013-08-31 19:19:15  INFO    OGG-01669  Oracle GoldenGate Collector for Oracle:  Opening /u01/ogg/dirdat/test/et000000 (byte 1276, current EOF 1276).
2013-08-31 19:19:15  INFO    OGG-01735  Oracle GoldenGate Collector for Oracle:  Synchronizing /u01/ogg/dirdat/test/et000000 to disk.
2013-08-31 19:19:15  INFO    OGG-01735  Oracle GoldenGate Collector for Oracle:  Synchronizing /u01/ogg/dirdat/test/et000000 to disk.
2013-08-31 19:19:15  INFO    OGG-01670  Oracle GoldenGate Collector for Oracle:  Closing /u01/ogg/dirdat/test/et000000.
2013-08-31 19:19:15  INFO    OGG-01669  Oracle GoldenGate Collector for Oracle:  Opening /u01/ogg/dirdat/test/et000001 (byte -1, current EOF 0).
2013-08-31 19:19:15  INFO    OGG-01020  Oracle GoldenGate Delivery for Oracle, rep6.prm:  Processed extract process RESTART_ABEND record at seq 1, rba 1337 (aborted 0 records).

相關文章