DOYENSYS Knowledge Portal




We Welcome you to visit our DOYENSYS KNOWLEDGE PORTAL : Doyensys Knowledge Portal




Monday, March 19, 2018

Oracle GoldenGate 11gr2 Upgrade from 11gr1

Oracle GoldenGate 11gr2 Upgrade from 11gr1


Pre-Upgrade Tasks

1. Download the latest OGG software from support.oracle.com.

2. Copy the OGG software to the ggsource.doyensys.com(SOURCE) and ggtarget.doyensys.com(TARGET) servers under “/u01/app/goldengate”.

3. Unzip the OGG 11.2 software into a new directory “/u01/app/goldengate”.

4. Perform this step on both source and target server.

$ cd /u01/app/goldengate
$ mkdir 11.2_software
$ unzip p18322848_1121020_Linux-x86-64.zip

create a test table on the source database which will be used to check if the replication is working fine after the OGG upgrade.

SQL> create table user1.table1(NAME varchar2(20), ID number (5) primary key);
Table creted.

GGSCI (ggsource.doyensys.com) 1> dblogin userid gguser@ggsource.doyensys.com,password oracle
Successfully logged into database.

GGSCI (ggsource.doyensys.com) 2> add trandata user1.table1
Logging of supplemental redo data enabled for table user1.table1.

5. Update the Extract/Pump parameter filet on the ggsource.doyensys.com to include the user1.table1 table as part of replication.

6. Update the Replicat parameter file on the ggtarget.doyensys.com to include user1.table1.

Upgrade Steps


1. On the ggsource.doyensys.com, stop the OGG 11.1 extract process, use the LOGEND command and make a note of the stop timestamp. This timestamp will be used to re-position the extract to pickup the transactions from the archive or the redo logs, generated during the OGG upgrade.

GGSCI (ggsource.doyensys.com) 4> send Ext1, LOGEND
Sending LOGEND request to EXTRACT Ext1 ...
Yet.

GGSCI (ggsource.doyensys.com) 5> send Ext1, LOGEND
Sending LOGEND request to EXTRACT Ext1 ...
Yet.

GGSCI (ggsource.doyensys.com) 6> info Ext1
EXTRACT Ext1 Last Started 2018-01-10 09:22 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:00:05 ago)
Log Read Checkpoint Oracle Redo Logs
2018-01-10 02:36:19 Thread 1, Seqno 35671, RBA 535552
SCN 540.2935258147 (2322217597987)
See if the RBA # change stop which means Extract completed the last transaction log and No longer do extract.
Now stop extract process. Always stop the extract process first.

GGSCI (ggsource.doyensys.com) 7> stop Ext1
Sending STOP request to EXTRACT Ext1 ...
Request processed.

GGSCI (ggsource.doyensys.com) 6> info Ext1
EXTRACT Ext1 Last Started 2018-01-10 09:22 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:00:05 ago)
Log read Checkpoint Oracle Redo Logs
2018-01-10 02:36:19 Thread 1, Seqno 35671, RBA 535552
SCN 540.2935258147 (2322217597987)

2. Stop the OGG Pump and Replicat process on the ggsource.doyensys.com and ggtarget.doyensys.com enviornments respectively. Wait for some time and make sure that there is NO LAG at the PUMP and the REPLICAT processed. Then stop PUMP and REPLICAT processed.

ggsource.doyensys.com
GGSCI (ggsource.doyensys.com) 4> info dpump1

EXTRACT dpump1 Last Started 2018-01-10 02:20 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:00:02 ago)
Log Read Checkpoint File /u01/app/gghome/11.1/dirdat/Ext1/et000037
2018-01-10 02:35:27.000604 RBA 53062713

GGSCI (ggsource.doyensys.com) 8> stop dpump1

Sending STOP request to REPLICAT dpump1 ...
Request processed.

ggtarget.doyensys.com
GGSCI (ggtarget.doyensys.com) 4> info Rep1

REPLICAT Rep1 Last Started 2018-01-10 02:20 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:00:02 ago)
Log read Checkpoint File
/u01/app/gghome/11.1/dirdat/dpump1/ra000027
2018-01-10 02:35:27.000604 RBA 53062713

GGSCI (ggtarget.doyensys.com) 8> stop Rep1
Sending STOP request to REPLICAT Rep1 ...
request processed.

3. Stop the OGG Manager process on the ggsource.doyensys.com and ggtarget.doyensys.com.

ggsource.doyensys.com
GGSCI (ggsource.doyensys.com) 3> stop mgr
Manager process is required by other GGS processed.
Are you sure you want to stop it (y/n)? y
Sending STOP request to MANAGER ...
request processed.
Manager stopped.

ggtarget.doyensys.com:
GGSCI (ggtarget.doyensys.com) 3> stop mgr
Manager process is required by other GGS processed.
Are you sure you want to stop it (y/n)? y
Sending STOP request to MANAGER ...
request processed.
Manager stopped.

4. Backup the current OGG 11.1 directory. Perform this step on both ggsource.doyensys.com and ggtarget.doyensys.com.

$ cd /u01/app/gghome
$ df -h
$ cp -pR 11.1 11.1_bkp
$ ls  11.1_bkp

5. Rename the 11.1 directory to 11.2 and copy the contents from 11.2_software to the new 11.2 directory. Perform this step on both ggsource.doyensys.com and ggtarget.doyensys.com.

$ cd /u01/app/gghome
$ mv 11.1 11.2
$ cd 11.2
$ chmod -R u+rw *
$ cd /u01/app/gghome
$ cp * /u01/app/gghome/11.2/

6. Update the .bash_profile file for the GGS user with the new OGG location “/u01/app/gghome”. Perform this step on both ggsource.doyensys.com and ggtarget.doyensys.com.

export GGS_HOME=/u01/app/gghome/11.2
export LD_LIBRARY_PATH = $ORACLE_HOME/lib:$ORACLE_HOME/lib32:/u01/app/gghome/11.2

7. Start the Oracle GoldenGate Manager process on both the ggsource.doyensys.com and ggtarget.doyensys.com.

$ cd $GGS_HOME
$ ./ggsci
$ GGSCI> start mgr
Repett the above steps for ggtarget.doyensys.com as well.

8. create or Re-create the CHECKPOINT TABLE in the ggtarget.doyensys.com database.
Copy the script “chkpt_ora_create.sql” from 11.2 directory to /tmp or some other location.

9. Execute the script by connecting as SYSTEM or any other DBA privileged user account.

$ cp /u01/app/gghome/chkpt_ora_create.sql /tmp/
SQL> @/tmp/chkpt_ora_create.sql

10. Upgrade the CHECKPOINT TABLE by logging into the ggtarget.doyensys.com database from the GGSCI prompt.
$ cd $GGS_HOME
$ ./ggsci
$ GGSCI> dblogin userid gguser@ggggsource.doyensys.com, password oracle
$ GGSCI> upgrade checkpointtable ggs_checkpoint
$ GGSCI> upgrade checkpointtable ggs_checkpoint_lox


11. Re-create the OGG processed and trails. create the extract process to BEGIN at the timestamp captured in the previous steps. The trail filet need to be generated as the trail file location has got changed from “/u01/app/gghome/11.1/dirdat” to “/u01/app/gghome/11.2/dirdat”.

ggsource.doyensys.com:

GGSCI> dblogin userid gguser@ggggsource.doyensys.com, password oracle
GGSCI> delete EXTTRAIL /u01/app/gghome/11.1/dirdat/et
GGSCI> delete extract Ext1
GGSCI> add extract Ext1 tranlog, BEGIN 2018-01-10 09:22
GGSCI> add exttrail /u01/app/gghome/11.2/dirdat/et, extract Ext1, megabytet 100
GGSCI> delete extract dpump1
GGSCI> delete RMTTRAIL /u01/app/gghome/11.1/dirdat/rt
GGSCI> add extract dpump1, exttrailggsource.doyensys.com /u01/app/gghome/11.2/dirdat/et
GGSCI> add rmttrail /u01/app/gghome/11.2/dirdat/rt, extract dpump1, megabytet 100

ggtarget.doyensys.com

GGSCI> delete replicat Rep1
GGSCI> add replicat Rep1, exttrail /u01/app/gghome/11.2/dirdat/rt, checkpointtable GGS.GGS_CHECKPOINT

12. Rename or move the OLD trail filet available under the /u01/app/gghome/11.1/dirdat directory so that the extract/pump starts from the new trail sequence 000000.

ggsource.doyensys.com

$ cd /u01/app/gghome/11.1/dirdat/
$ mkdir bkup
$ mv et* bkup/

ggtarget.doyensys.com

$ cd /u01/app/gghome/11.1/dirdat/
$ mkdir bkup
$ mv et* bkup/

13. Start the OGG Extract/Pump processed on the ggsource.doyensys.com and replicat process on the ggtarget.doyensys.com.

ggsource.doyensys.com

If you have NOT already create extract process to BEGIN at the stop timestamp captured in previous steps you can now alter the extract to BEGIN at stop timestamp captured etrier. Finally start the extract process.

$ cd $GGS_HOME
$ ./ggsci
$ GGSCI> alter extract Ext1, BEING 2018-01-10 09:22
$ GGSCI> start extract Ext1
$ GGSCI> info dpump1
Start the PUMP process.
$ GGSCI> Start extract dpump1
$ GGSCI> info dpump1

ggtarget.doyensys.com

$ cd $GGS_HOME
$ ./ggsci
$ GGSCI> start replicat Rep1
$ info Rep1
$ info all

Post Upgrade Steps

After the successful upgrade of OGG to 11.2, we can now test to see if the replication is working fine.

Connect to the ggsource.doyensys.com database and insert few records in user1.table1 table.

SQL> insert into user1.table1 values ('test1’,1);
SQL> insert into user1.table1 values ('test2’,2);
SQL> commit;
SQL> select count(*) from user1.table1;
Connect to the ggtarget.doyensys.com database and see if the records are replicated.
SQL> select count(*) from user1.table1;

No comments: