Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
oracle_12_goldengate_conf_prepare_source [2020/10/26 19:10] – andonovj | oracle_12_goldengate_conf_prepare_source [2020/11/09 19:50] (current) – andonovj | ||
---|---|---|---|
Line 7: | Line 7: | ||
Both need to be configured if you want the Golden Gate to work properly. | Both need to be configured if you want the Golden Gate to work properly. | ||
- | =====Configuration===== | + | =====Configure Database===== |
+ | We have to ensure that we have enabled: | ||
+ | |||
+ | * Supplemental logging | ||
+ | * Golden Gate Replication | ||
+ | * Force Logging | ||
+ | * Necessary rights for the user | ||
+ | |||
+ | |||
+ | So let's get started. You can set supplemental logging in Oracle database in three levels: | ||
+ | |||
+ | < | ||
+ | SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA; | ||
+ | SQL> ALTER DATABASE FORCE LOGGING; | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | GGSCI> ADD SCHEMATRANDATA schema [ALLCOLS|NOSCHEDULINGCOLS] | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | GGSCI> ADD TRANDATA [container.]schema.table[ALLCOLS|NOSCHEDULINGCOLS] | ||
+ | </ | ||
+ | |||
+ | The commands from the GGSCI are heterogenous, | ||
+ | |||
+ | < | ||
+ | [oracle@edvmr1p0 les03]$ sqlplus / as sysdba | ||
+ | SQL> SELECT supplemental_log_data_min, | ||
+ | SUPPLEME FORCE_LOGGING | ||
+ | -------- --------------------------------------- | ||
+ | NO NO | ||
+ | |||
+ | SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA; | ||
+ | |||
+ | Database altered. | ||
+ | SQL> ALTER DATABASE FORCE LOGGING; | ||
+ | |||
+ | Database altered. | ||
+ | |||
+ | SQL> ALTER SYSTEM SWITCH LOGFILE; | ||
+ | |||
+ | System altered. | ||
+ | |||
+ | SQL> SELECT supplemental_log_data_min, | ||
+ | SUPPLEME FORCE_LOGGING | ||
+ | -------- --------------------------------------- | ||
+ | YES YES | ||
+ | |||
+ | </ | ||
+ | |||
+ | < | ||
+ | SQL> show parameter enable_goldengate | ||
+ | |||
+ | NAME | ||
+ | ------------------------------------ ----------- ------------------------------ | ||
+ | enable_goldengate_replication | ||
+ | SQL> | ||
+ | SQL> | ||
+ | alter system set enable_goldengate_replication=true scope=both; | ||
+ | System altered. | ||
+ | SQL> show parameter enable_goldengate | ||
+ | |||
+ | NAME | ||
+ | ------------------------------------ ----------- ------------------------------ | ||
+ | enable_goldengate_replication | ||
+ | </ | ||
+ | |||
+ | Finally, grant the necessary rights to the user: | ||
+ | < | ||
+ | SQL> exec dbms_goldengate_auth.grant_admin_privilege(' | ||
+ | | ||
+ | PL/SQL procedure successfully completed. | ||
+ | SQL> | ||
+ | </ | ||
+ | |||
+ | =====Configure Golden Gate===== | ||
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 14: | 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 37: | 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 54: | 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 67: | Line 132: | ||
Table schema_name1.* ; | Table schema_name1.* ; | ||
Table schema_name2.* ; | Table schema_name2.* ; | ||
- | </sxh> | + | </Code> |
Line 73: | 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 88: | 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 114: | 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 126: | Line 195: | ||
***************************************************************************************** | ***************************************************************************************** | ||
- | </sxh> | + | </Code> |
Line 133: | 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 163: | 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) | ||