Upgrade Goldengate 11.1.1.1.2 to 11.2.1.0.1,goldengate

來源:互聯網
上載者:User

Upgrade Goldengate 11.1.1.1.2 to 11.2.1.0.1,goldengate
配置環境:

Source:OGG:11.2.1.0.1Name:zbdba1Target:OGG:11.1.1.1.2Name:zbdba2

現在將Target升級到與源端一樣的版本


備份Target ogg安裝目錄:
[root@zbdba2 /]# cp -R ogg/ /database/


查看Source端抽取進程是否active:

GGSCI (zbdba1) 6> send extract ext1 logendSending LOGEND request to EXTRACT EXT1 ...YES.GGSCI (zbdba1) 7> send extract ext2 logendSending LOGEND request to EXTRACT EXT2 ...YES.
發現沒有抽取和傳輸資料,可以停止進程
查看Target端複製進行是否active:

GGSCI (zbdba2) 2> send replicat rep1 statusSending STATUS request to REPLICAT REP1 ...  Current status: At EOF  Sequence #: 3  RBA: 2434  0 records in current transaction
停止所有進程:

Source:GGSCI (zbdba1) 13> info allProgram     Status      Group       Lag at Chkpt  Time Since ChkptMANAGER     STOPPED                                          EXTRACT     STOPPED     EXT1        00:00:00      00:01:35   EXTRACT     STOPPED     EXT2        00:00:00      00:01:32 Target:GGSCI (zbdba2) 6> info allProgram     Status      Group       Lag           Time Since ChkptMANAGER     STOPPED                                          REPLICAT    STOPPED     REP1        00:00:00      00:01:26  

Target:
刪除以前ogg安裝目錄中的內容,將新版本的ogg解壓在裡面

[ogg@zbdba2 ogg]$ ./ggsciOracle GoldenGate Command Interpreter for OracleVersion 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBOLinux, x64, 64bit (optimized), Oracle 11g on Apr 23 2012 08:32:14Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.GGSCI (zbdba2) 1> info allProgram     Status      Group       Lag at Chkpt  Time Since ChkptMANAGER     STOPPED                                          GGSCI (zbdba2) 2> dblogin userid ogg,password ogg;Successfully logged into database.GGSCI (zbdba2) 3> upgrade checkpointtable ogg.checkpointSuccessfully upgraded checkpoint table ogg.checkpoint.
在target資料庫中:

Installing the DDL objects:1、Run the @marker_setup.sql script. This script installs support for the Oracle GoldenGatemarker system, which is required for DDL support. You will be prompted for the nameof the Oracle GoldenGate schema.drop trigger ggs_ddl_trigger_before;grant create table,create view,create sequence to ogg;2、Run the @ddl_setup.sql script   Script that installs the Oracle GoldenGate DDL extraction andreplication objects. (Oracle installations)3、Run the @role_setup.sql script. This script drops and creates the role needed for DDLsynchronization. It grants DML permissions on the Oracle GoldenGate DDL objects4、Grant the role to all Oracle GoldenGate Extract users. You may need to make multiplegrants if the processes have different user names.Run the @ddl_enable.sql script to enable the DDL trigger.5、To improve the performance of the DDL trigger, make the ddl_pin script part of the databasestartup. It must be invoked with the Oracle GoldenGate DDL user name, as in:@?/rdbms/admin/dbmspool.sqlSQL> @ddl_pin oggTo improve the performance of the DDL trigger This script pins the PL/SQL package that is used by the trigger into memory. If executingthis script from SQL*Plus, connect as SYSDBA from the Oracle GoldenGate home directory.This script relies on the Oracle dmbs_shared_pool system package, so install that packagebefore using ddl_pin.

配置Target:

view param mgrport 7839DYNAMICPORTLIST 7840-7914USERID ogg,PASSWORD oggAUTORESTART REPLICAT *,RETRIES 5,WAITMINUTES 3PURGEOLDEXTRACTS ./DIRDAT/*,MINKEEPDAYS 3PURGEDDLHISTORY MINKEEPDAYS 7,MAXKEEPDAYS 10,FREQUENCYMINUTES 30PURGEMARKERHISTORY MINKEEPDAYS 7,MAXKEEPDAYS 10LAGREPORTHOURS 1LAGINFOMINUTES 30LAGCRITICALMINUTES 45GGSCI (zbdba2) 1>  create subdirsGGSCI (zbdba2) 1>  view param ./GLOBALSGGSCHEMA oggCHECKPOINTTABLE ogg.checkpointGGSCI (zbdba2) 2>  add replicat rep1,exttrail /ogg/dirdat/sa, checkpointtable ogg.checkpointGGSCI (zbdba2) 19> edit param rep1REPLICAT rep1ASSUMETARGETDEFSUSERID ogg, PASSWORD oggdiscardfile ./dirdat/rep1_discard.txt,append,megabytes 5DDL INCLUDE MAPPEDDDLOPTIONS REPORT--BATCHSQLDBOPTIONS DEFERREFCONSTDBOPTIONS LOBWRITESIZE 102400HANDLECOLLISIONSDDLERROR DEFAULT DISCARD RETRYOP MAXRETRIES 5 RETRYDELAY 20--grouptransops 1--maxtransops 1APPLYNOOPUPDATESMAP zbdba.*, TARGET zbdba.*;

Source:
將版本控制參數 format release去掉

GGSCI (zbdba1) 44> view param ext1EXTRACT EXT1setenv ( NLS_LANG = AMERICAN_AMERICA.ZHS16GBK )USERID ogg,PASSWORD oggDDL &INCLUDE MAPPED OBJTYPE 'TABLE' &INCLUDE MAPPED OBJTYPE 'IDNEX' &INCLUDE MAPPED OBJTYPE 'SEQUENCE' &INCLUDE MAPPED OBJTYPE 'VIEW' &INCLUDE MAPPED OBJTYPE 'PROCEDURE' &INCLUDE MAPPED OBJTYPE 'FUNCTION' &INCLUDE MAPPED OBJTYPE 'PACKAGE' &INCLUDE MAPPED OBJTYPE 'MATERIALIZED VIEW' &EXCLUDE OPTYPE COMMENTDDLOPTIONS ADDTRANDATA NOCROSSRENAME REPORTREPORTCOUNT EVERY 1 MINUTES,RATEDISCARDFILE ./dirrpt/EXTSA.DSC,APPEND,MEGABYTES 1024THREADOPTIONS MAXCOMMITPROPAGATIONDELAY 60000 IOLATENCY 60000DBOPTIONS ALLOWUNUSEDCOLUMNWARNLONGTRANS 2H,CHECKINTERVAL 3M--exttrail ./dirdat/sa,format release 11.1exttrail ./dirdat/saFETCHOPTIONS NOUSESNAPSHOT,FETCHPKUPDATECOLS,MISSINGROW REPORTtable zbdba.*;GGSCI (zbdba1) 45> view param ext2EXTRACT EXT2passthruRMTHOST 192.168.56.61,MGRPORT 7839,COMPRESS--RMTTRAIL ./dirdat/sa,format release 11.1RMTTRAIL ./dirdat/satable zbdba.*;
因為版本問題,以前trail檔案將不可用,迫使抽取進程寫一個新的trail檔案:

GGSCI (zbdba1) 47> alter extract ext1 etrolloverGGSCI (zbdba1) 25> alter extract ext2 etrollover2015-03-06 01:26:06  INFO    OGG-01520  Rollover performed.  For each affected output trail of Version 10 or higher format, after starting the source extract, issue ALTER EXTSEQNO for that trail's reader (either pump EXTRACT or REPLICAT) to move the reader's scan to the new trail file;  it will not happen automatically.EXTRACT altered.start mgrstart ext1GGSCI (zbdba1) 39> alter extract  ext2, EXTSEQNO 1,  EXTRBA 0EXTRACT altered.GGSCI (zbdba1) 40> start ext2Sending START request to MANAGER ...EXTRACT EXT2 startingGGSCI (zbdba1) 41> info ext2EXTRACT    EXT2      Last Started 2015-03-06 01:46   Status RUNNINGCheckpoint Lag       00:00:00 (updated 00:00:10 ago)Log Read Checkpoint  File /ogg/dirdat/sa000001                     First Record  RBA 0Target:GGSCI (zbdba2) 4> alter REPLICAT rep1, EXTSEQNO 1,  EXTRBA 0REPLICAT altered.GGSCI (zbdba2) 5> start rep1Sending START request to MANAGER ...REPLICAT REP1 startingGGSCI (zbdba2) 6> info allProgram     Status      Group       Lag at Chkpt  Time Since ChkptMANAGER     RUNNING                                          REPLICAT    RUNNING     REP1        00:00:00      00:00:08   GGSCI (zbdba2) 7> info rep1REPLICAT   REP1      Last Started 2015-03-06 01:43   Status RUNNINGCheckpoint Lag       00:00:00 (updated 00:00:00 ago)Log Read Checkpoint  File /ogg/dirdat/sa000001                     First Record  RBA 0start mgrstart rep1


自此ogg目標端升級成功




相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.