Looking for something? Try here..

Sunday, August 23, 2015

OGG simple parameter files

In this post, we will see about the simple parameter files required for the Oracle GoldenGate replication operation.
For details on installation, prerequisites, set up and demo see this link

Parameter files are an important part of the OGG setup as these files provide the details required for the extract/replication operation. We can separate the tasks as streams. For eg., if we have 100 tables to be replicated then it is not required to include every table in a single parameter file and we can segregate set of tables under different streams. Since we are dealing with only one table for demo purpose here, we have 1 stream with 1 table which would contain 3 files in source and 2 files in target system.

I have used I, E, P and R terminologies to indicate whether it is Initial extract, Extract, Pump or Replicat parameter file.

1. Source Param files

Initial extract param file - DEMO1I.prm
EXTRACT DEMO1I
SOURCEISTABLE
setenv NLS_CHARACTERSET = ""WE8MSWIN1252""
setenv NLS_LANG = ""AMERICAN_AMERICA.WE8MSWIN1252""
USERID ggs_dba, PASSWORD ggs_dba
RMTHOST 172.20.161.193, MGRPORT 12000
RMTFILE /backup/gg_kt/ogg/11.2/dirdat/ia, maxfiles 25, MEGABYTES 1000, PURGE
TABLE SDAS.OGG_TEST;
Extract param file - DEMO1E.prm
EXTRACT DEMO1E
setenv NLS_CHARACTERSET = "WE8MSWIN1252"
setenv NLS_LANG = "AMERICAN_AMERICA.WE8MSWIN1252"
USERID ggs_dba, PASSWORD ggs_dba
THREADOPTIONS PROCESSTHREADS EXCEPT 2
EXTTRAIL /backup/PRNETSDB/ogg/11.1/dirdat/ea
DISCARDFILE /backup/PRNETSDB/ogg/11.1/dirrpt/DEMO1E.dsc, APPEND
REPORTCOUNT EVERY 100 RECORDS, RATE
GETTRUNCATES
TABLE SDAS.OGG_TEST;
Data pump param file - DEMO1P.prm
EXTRACT DEMO1P
setenv NLS_CHARACTERSET = "WE8MSWIN1252"
setenv NLS_LANG = "AMERICAN_AMERICA.WE8MSWIN1252"
PASSTHRU
RMTHOST 172.20.161.193, MGRPORT 12000
RMTTRAIL /backup/gg_kt/ogg/11.2/dirdat/pa
GETTRUNCATES
TABLE SDAS.OGG_TEST;
The above .prm files should be created under $GGH/dirprm of the source server using vi command

Note: When the source database is an ASM instance, then Oracle GoldenGate change data capture requires ASM authentication for accessing the transaction logs. The extract parameter TRANLOGOPTIONS handles authentication to the ASM instance.

TRANLOGOPTIONS ASMUSER SYS@CONN_STRG, ASMPASSWORD [ENCRYPTKEY { | DEFAULT}]
Eg: TRANLOGOPTIONS ASMUSER sysasm@ASMDB, ASMPASSWORD password

Oracle GoldenGate with database version 11.2.0.4 and above, we can use integrated capture method which is better than the Classic capture method explained in this demo. To learn more about integrated capture and apply methods, see this oracle documentation link

2. Target Param files

Replicat file - DEMO1R.prm
REPLICAT DEMO1R
setenv NLS_CHARACTERSET = "WE8MSWIN1252"
setenv NLS_LANG = "AMERICAN_AMERICA.WE8MSWIN1252"
USERID ggs_dba, PASSWORD ggs_dba
DISCARDFILE /backup/gg_kt/ogg/11.2/dirrpt/DEMO1R.dsc, APPEND
REPORTCOUNT EVERY 100 RECORDS, RATE
ASSUMETARGETDEFS
HANDLECOLLISIONS
MAP SDAS.OGG_TEST, TARGET SDAS.TGT_OGG_TEST;
Initial Replicat file - TDEMO1I.prm
REPLICAT TDEMO1I
setenv NLS_CHARACTERSET = "WE8MSWIN1252"
setenv NLS_LANG = "AMERICAN_AMERICA.WE8MSWIN1252"
USERID ggs_dba, PASSWORD ggs_dba
DISCARDFILE /backup/gg_kt/ogg/11.2/dirrpt/TDEMO1I.dsc, APPEND
REPORTCOUNT EVERY 100 RECORDS, RATE
ASSUMETARGETDEFS
MAP SDAS.OGG_TEST, TARGET SDAS.TGT_OGG_TEST;
The above .prm files should be created under $GGH/dirprm of the target server using vi command or any other text editors.

Happy replication!!

No comments:

Post a Comment