Upgrade Goldengate 11.1.1.1.2 to 11.2.1.0.1, goldengate
Configuration environment:
Source:OGG:11.2.1.0.1Name:zbdba1Target:OGG:11.1.1.1.2Name:zbdba2
Upgrade Target to the same version as the source.
Backup Target ogg installation directory:
[Root @ zbdba2/] # cp-R ogg // database/
Check whether the Source extraction process is 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.
If no data is extracted or transmitted, stop the process.
Check whether the Target replication is 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
Stop all processes:
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:
Delete the content in the previous ogg installation directory and decompress the new version of 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.
In the target database:
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.
Configure 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:
Remove the Version Control Parameter 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.*;
Due to version issues, the previous trail file will be unavailable, forcing the extraction process to write a new trail file:
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
The ogg target end has been upgraded since then.