Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
oracle_12_goldengate_conf_prepare_source [2019/10/18 20:04] – external edit 127.0.0.1 | oracle_12_goldengate_conf_prepare_source [2020/11/09 19:50] (current) – andonovj | ||
---|---|---|---|
Line 1: | Line 1: | ||
======Configuration of the source====== | ======Configuration of the source====== | ||
+ | To configure the source database we have to do two things: | ||
+ | * Ensure the database is set correctly. | ||
+ | * Ensure the GoldenGate is set correctly. | ||
- | =====Clean the environment===== | + | Both need to be configured if you want the Golden Gate to work properly. |
- | First assure that you don't have any running jobs: | + | |
+ | =====Configure Database===== | ||
+ | We have to ensure that we have enabled: | ||
- | <sxh> | + | * Supplemental logging |
- | / | + | * Golden Gate Replication |
- | GGSCI (sourceSRV.izb.local as ggate@DBNAME) 1> info all | + | * Force Logging |
+ | * Necessary rights for the user | ||
- | Program | ||
- | MANAGER | + | So let's get started. You can set supplemental logging in Oracle database in three levels: |
- | </sxh> | + | < |
+ | SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA; | ||
+ | SQL> ALTER DATABASE FORCE LOGGING; | ||
+ | </Code> | ||
- | If any jobs are present, STOP them, DELETE them and Clean them. | + | < |
+ | GGSCI> ADD SCHEMATRANDATA schema [ALLCOLS|NOSCHEDULINGCOLS] | ||
+ | </ | ||
+ | < | ||
+ | GGSCI> ADD TRANDATA [container.]schema.table[ALLCOLS|NOSCHEDULINGCOLS] | ||
+ | </ | ||
+ | The commands from the GGSCI are heterogenous, | ||
- | <sxh> | + | <Code: |
- | GGSCI (sourceSRV.izb.local) 1> info all | + | [oracle@edvmr1p0 les03]$ sqlplus / as sysdba |
+ | SQL> SELECT supplemental_log_data_min, | ||
+ | SUPPLEME FORCE_LOGGING | ||
+ | -------- --------------------------------------- | ||
+ | NO NO | ||
- | Program | + | SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA; |
- | MANAGER | + | Database altered. |
- | EXTRACT | + | SQL> ALTER DATABASE FORCE LOGGING; |
- | EXTRACT | + | |
+ | Database altered. | ||
- | GGSCI (sourceSRV.izb.local) 2> stop EBKDMP1 | + | SQL> ALTER SYSTEM SWITCH LOGFILE; |
- | Sending STOP request to EXTRACT EBKDMP1 ... | + | System altered. |
- | Request processed. | + | |
+ | SQL> SELECT supplemental_log_data_min, | ||
+ | SUPPLEME FORCE_LOGGING | ||
+ | -------- --------------------------------------- | ||
+ | YES YES | ||
- | GGSCI (sourceSRV.izb.local) 3> info EBKEXT1 | + | </Code> |
- | EXTRACT | + | <Code:bash|Enable Replication> |
- | Checkpoint Lag | + | SQL> show parameter enable_goldengate |
- | Process ID | + | |
- | Log Read Checkpoint | + | |
- | | + | |
- | SCN 0.474510079 (474510079) | + | |
+ | NAME | ||
+ | ------------------------------------ ----------- ------------------------------ | ||
+ | enable_goldengate_replication | ||
+ | SQL> | ||
+ | SQL> | ||
+ | alter system set enable_goldengate_replication=true scope=both; | ||
+ | System altered. | ||
+ | SQL> show parameter enable_goldengate | ||
- | GGSCI (sourceSRV.izb.local) 4> stop EBKEXT1 | + | NAME |
+ | ------------------------------------ ----------- ------------------------------ | ||
+ | enable_goldengate_replication | ||
+ | </Code> | ||
- | Sending STOP request | + | Finally, grant the necessary rights |
- | Request processed. | + | < |
+ | SQL> exec dbms_goldengate_auth.grant_admin_privilege(' | ||
+ | | ||
+ | PL/SQL procedure successfully completed. | ||
+ | SQL> | ||
+ | </ | ||
- | + | =====Configure Golden Gate===== | |
- | GGSCI (sourceSRV.izb.local) 5> cleanup EBKDMP1 | + | |
- | Cleanup completed | + | |
- | + | ||
- | + | ||
- | GGSCI (sourceSRV.izb.local) 6> dblogin userid ggate password " | + | |
- | Successfully logged into database. | + | |
- | + | ||
- | GGSCI (sourceSRV.izb.local as ggate@DBNAME) 7> cleanup EBKEXT1 | + | |
- | Cleanup completed | + | |
- | + | ||
- | + | ||
- | GGSCI (sourceSRV.izb.local as ggate@DBNAME) 8> delete EBKDMP1 | + | |
- | Deleted EXTRACT EBKDMP1. | + | |
- | + | ||
- | + | ||
- | GGSCI (sourceSRV.izb.local as ggate@DBNAME) 9> delete EBKEXT1 | + | |
- | Deleted EXTRACT EBKEXT1. | + | |
- | + | ||
- | + | ||
- | GGSCI (sourceSRV.izb.local as ggate@DBNAME) 10> info all | + | |
- | + | ||
- | Program | + | |
- | + | ||
- | MANAGER | + | |
- | + | ||
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | Be sure to delete any retail file: local retail and remote retail file. | + | |
- | Any configuration can files can be located via: | + | |
- | + | ||
- | < | + | |
- | GGSCI (sourceSRV.izb.local) 4> show all | + | |
- | + | ||
- | Parameter settings: | + | |
- | + | ||
- | SET DEBUG OFF | + | |
- | + | ||
- | Current directory: / | + | |
- | + | ||
- | Editor: | + | |
- | + | ||
- | Reports (.rpt) | + | |
- | Parameters (.prm) | + | |
- | Replicat Checkpoints (.cpr) | + | |
- | Extract Checkpoints (.cpe) | + | |
- | Process Status (.pcs) | + | |
- | SQL Scripts (.sql) | + | |
- | Database Definitions (.def) | + | |
- | Dump files (.dmp) | + | |
- | Masterkey wallet files (.wlt) | + | |
- | Credential store files (.crd) | + | |
- | </ | + | |
- | + | ||
- | **!!!!!P.S. DO NOT DELETE THE REDO LOG FILES :) !!!!!!** | + | |
- | + | ||
- | =====Configuration===== | + | |
In order to configure a export on the SOURCE, we should configure 3 jobs: | In order to configure a export on the SOURCE, we should configure 3 jobs: | ||
Line 116: | Line 90: | ||
* Extract Job <- Reads the redo | * Extract Job <- Reads the redo | ||
* Dump Job <- Takes the information from the previous job and dump it into retail file. | * Dump Job <- Takes the information from the previous job and dump it into retail file. | ||
- | |||
- | Be sure to clean any remaining files: | ||
- | |||
- | <sxh> | ||
- | [oracle@sourceSRV dirdat]$ ls -lart | ||
- | total 8 | ||
- | drwxr-xr-x 29 oracle oinstall 4096 Nov 14 14:35 .. | ||
- | drwxr-x--- | ||
- | </ | ||
- | |||
- | ====Configuration Files==== | ||
Create the configuration file with the same name as you want the JOB name to be called. | Create the configuration file with the same name as you want the JOB name to be called. | ||
===Manager=== | ===Manager=== | ||
- | <sxh bash> | + | <Code:bash|Manager Config> |
[oracle@matar dirprm]$ cat mgr.prm | [oracle@matar dirprm]$ cat mgr.prm | ||
PORT 7809 | PORT 7809 | ||
Line 139: | Line 102: | ||
Autostart Extract EBK* | Autostart Extract EBK* | ||
AUTORESTART Extract *, WaitMinutes 2, Retries 6 | AUTORESTART Extract *, WaitMinutes 2, Retries 6 | ||
- | </sxh> | + | </Code> |
===Extract job: EBKEXT1=== | ===Extract job: EBKEXT1=== | ||
- | <sxh> | + | <Code: |
cat / | cat / | ||
Extract ebkext1 | Extract ebkext1 | ||
Line 156: | Line 119: | ||
Table SCHEMANAME1.* ; | Table SCHEMANAME1.* ; | ||
Table SCHEMANAME2.* ; | Table SCHEMANAME2.* ; | ||
- | </sxh> | + | </Code> |
===DUMP job: EBKDMP1=== | ===DUMP job: EBKDMP1=== | ||
+ | < | ||
cat / | cat / | ||
- | <sxh bash> | ||
Extract EBKDMP1 | Extract EBKDMP1 | ||
USERID ggate, PASSWORD " | USERID ggate, PASSWORD " | ||
Line 169: | Line 132: | ||
Table schema_name1.* ; | Table schema_name1.* ; | ||
Table schema_name2.* ; | Table schema_name2.* ; | ||
- | </sxh> | + | </Code> |
Line 175: | Line 138: | ||
The jobs should be added to the configuration as well using the GoldenGate Software Command Interface(GGSCI) | The jobs should be added to the configuration as well using the GoldenGate Software Command Interface(GGSCI) | ||
- | <sxh> | + | <Code: |
[oracle@sourceSRV dirdat]$ / | [oracle@sourceSRV dirdat]$ / | ||
Line 190: | Line 153: | ||
Successfully logged into database. | Successfully logged into database. | ||
+ | ---Add the Classical Extract | ||
GGSCI (sourceSRV.izb.local as ggate@DBNAME) 2> add extract EBKEXT1, TRANLOG, BEGIN NOW | GGSCI (sourceSRV.izb.local as ggate@DBNAME) 2> add extract EBKEXT1, TRANLOG, BEGIN NOW | ||
EXTRACT added. | EXTRACT added. | ||
+ | ---Create Local Trail and associate it with the Classical Extract | ||
GGSCI (sourceSRV.izb.local as ggate@DBNAME) 5> add exttrail ./ | GGSCI (sourceSRV.izb.local as ggate@DBNAME) 5> add exttrail ./ | ||
EXTTRAIL added. | EXTTRAIL added. | ||
+ | ---Create Data Pump process and associate it with the local trail | ||
GGSCI (sourceSRV.izb.local as ggate@DBNAME) 6> add EXTRACT EBKDMP1, EXTTRAILSOURCE ./dirdat/lt | GGSCI (sourceSRV.izb.local as ggate@DBNAME) 6> add EXTRACT EBKDMP1, EXTTRAILSOURCE ./dirdat/lt | ||
EXTRACT added. | EXTRACT added. | ||
+ | ---Add Remote trail and associate it with the Data pump process | ||
GGSCI (sourceSRV.izb.local as ggate@DBNAME) 7> add RMTTRAIL ./ | GGSCI (sourceSRV.izb.local as ggate@DBNAME) 7> add RMTTRAIL ./ | ||
RMTTRAIL added. | RMTTRAIL added. | ||
+ | ---Add Supplemental logging for the schema | ||
GGSCI (sourceSRV.izb.local as ggate@DBNAME) 8> ADD SCHEMATRANDATA SCHEMANAME1 | GGSCI (sourceSRV.izb.local as ggate@DBNAME) 8> ADD SCHEMATRANDATA SCHEMANAME1 | ||
Line 216: | Line 183: | ||
***************************************************************************************** | ***************************************************************************************** | ||
+ | ---Add supplemental logging for 2nd schema | ||
GGSCI (sourceSRV.izb.local as ggate@DBNAME) 9> add schematrandata SCHEMANAME2 | GGSCI (sourceSRV.izb.local as ggate@DBNAME) 9> add schematrandata SCHEMANAME2 | ||
Line 228: | Line 195: | ||
***************************************************************************************** | ***************************************************************************************** | ||
- | </sxh> | + | </Code> |
Line 235: | Line 202: | ||
- | <sxh> | + | <Code: |
GGSCI (sourceSRV.izb.local as ggate@DBNAME) 10> info all | GGSCI (sourceSRV.izb.local as ggate@DBNAME) 10> info all | ||
Line 265: | Line 232: | ||
EXTRACT | EXTRACT | ||
- | </sxh> | + | </Code> |
Wait them for couple minutes, to assure that they will not end abnormally (ABEND) | Wait them for couple minutes, to assure that they will not end abnormally (ABEND) | ||