Wednesday, November 17, 2010

Configure DDL synchronization/replication (Post 22 of series,DDL synchronization/replication with Tutorial)

The soul-bride is of no use at all, if she is evil and without virtue. She does not find peace in this world or the next; she burns in falsehood
and corruption. Coming and going are very difficult for that bride who is abandoned and forgotten by her Husband Lord.


Index of all the posts of Gurpartap Singh's Blog

Now before proceeding with more complex replication tutorials/examples lets install the DDL synchronization/replication first.

Now after sometime you would like to patch your application to add new features to it. One part of it would be to
upgrade the schema to next version i.e. change DDL. Don't worry goldengate is a golden product with lots of flexiblility and it will
happily replicate your DDL to target too. To replicate DDL's we need to configure DDL synchronization. It has few steps to it.
Lets configure DDL synchronization.

To do the following steps you should have user "goldengate" created in the database as we did in our previous posts.
From Goldengate installation directroy execute the following scripts as sysdba in source database as:


oracle : rac1.rac.meditate.com : @simar1 : /u01/app/oracle/product/goldengate
$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Wed Nov 17 22:03:36 2010

Copyright (c) 1982, 2009, Oracle. All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> @marker_setup

Marker setup script

You will be prompted for the name of a schema for the GoldenGate database objects.
NOTE: The schema must be created prior to running this script.
NOTE: Stop all DDL replication before starting this installation.

Enter GoldenGate schema name:GOLDENGATE


Marker setup table script complete, running verification script...
Please enter the name of a schema for the GoldenGate database objects:
Setting schema name to GOLDENGATE

MARKER TABLE
-------------------------------
OK

MARKER SEQUENCE
-------------------------------
OK

Script complete.
SQL> alter session set recyclebin=OFF;

Session altered.

SQL> @ddl_setup

GoldenGate DDL Replication setup script

Verifying that current user has privileges to install DDL Replication...

You will be prompted for the name of a schema for the GoldenGate database objects.
NOTE: The schema must be created prior to running this script.
NOTE: On Oracle 10g and up, system recycle bin must be disabled.
NOTE: Stop all DDL replication before starting this installation.

Enter GoldenGate schema name:GOLDENGATE

You will be prompted for the mode of installation.
To install or reinstall DDL replication, enter INITIALSETUP
To upgrade DDL replication, enter NORMAL
Enter mode of installation:INITIALSETUP

Working, please wait ...
Spooling to file ddl_setup_spool.txt


Using GOLDENGATE as a GoldenGate schema name, INITIALSETUP as a mode of installation.

Working, please wait ...

RECYCLEBIN must be empty.
This installation will purge RECYCLEBIN for all users.
To proceed, enter yes. To stop installation, enter no.

Enter yes or no:yes


DDL replication setup script complete, running verification script...
Please enter the name of a schema for the GoldenGate database objects:
Setting schema name to GOLDENGATE

DDLORA_GETTABLESPACESIZE STATUS:

Line/pos
----------------------------------------
Error
-----------------------------------------------------------------
No errors
No errors


CLEAR_TRACE STATUS:

Line/pos
----------------------------------------
Error
-----------------------------------------------------------------
No errors
No errors


CREATE_TRACE STATUS:

Line/pos
----------------------------------------
Error
-----------------------------------------------------------------
No errors
No errors


TRACE_PUT_LINE STATUS:

Line/pos
----------------------------------------
Error
-----------------------------------------------------------------
No errors
No errors


INITIAL_SETUP STATUS:

Line/pos
----------------------------------------
Error
-----------------------------------------------------------------
No errors
No errors


DDLVERSIONSPECIFIC PACKAGE STATUS:

Line/pos
----------------------------------------
Error
-----------------------------------------------------------------
No errors
No errors


DDLREPLICATION PACKAGE STATUS:

Line/pos
----------------------------------------
Error
-----------------------------------------------------------------
No errors
No errors


DDLREPLICATION PACKAGE BODY STATUS:

Line/pos
----------------------------------------
Error
-----------------------------------------------------------------
No errors
No errors


DDL HISTORY TABLE
-----------------------------------
OK

DDL HISTORY TABLE(1)
-----------------------------------
OK

DDL DUMP TABLES
-----------------------------------
OK

DDL DUMP COLUMNS
-----------------------------------
OK

DDL DUMP LOG GROUPS
-----------------------------------
OK

DDL DUMP PARTITIONS
-----------------------------------
OK

DDL DUMP PRIMARY KEYS
-----------------------------------
OK

DDL SEQUENCE
-----------------------------------
OK

GGS_TEMP_COLS
-----------------------------------
OK

GGS_TEMP_UK
-----------------------------------
OK

DDL TRIGGER CODE STATUS:

Line/pos
----------------------------------------
Error
-----------------------------------------------------------------
No errors
No errors


DDL TRIGGER INSTALL STATUS
-----------------------------------
OK

DDL TRIGGER RUNNING STATUS
--------------------------------------------------------------------------------
ENABLED

STAYMETADATA IN TRIGGER
--------------------------------------------------------------------------------
OFF

DDL TRIGGER SQL TRACING
--------------------------------------------------------------------------------
0

DDL TRIGGER TRACE LEVEL
--------------------------------------------------------------------------------
0

LOCATION OF DDL TRACE FILE
--------------------------------------------------------------------------------
/u01/app/oracle/diag/rdbms/simar/simar1/trace/ggs_ddl_trace.log

Analyzing installation status...


STATUS OF DDL REPLICATION
--------------------------------------------------------------------------------
SUCCESSFUL installation of DDL Replication software components

Script complete.
SQL> @role_setup

GGS Role setup script

This script will drop and recreate the role GGS_GGSUSER_ROLE
To use a different role name, quit this script and then edit the params.sql script to change the gg_role parameter to the preferred name. (Do not run the script.)

You will be prompted for the name of a schema for the GoldenGate database objects.
NOTE: The schema must be created prior to running this script.
NOTE: Stop all DDL replication before starting this installation.

Enter GoldenGate schema name:GOLDENGATE
Wrote file role_setup_set.txt

PL/SQL procedure successfully completed.


Role setup script complete

Grant this role to each user assigned to the Extract, GGSCI, and Manager processes, by using the following SQL command:

GRANT GGS_GGSUSER_ROLE TO

where is the user assigned to the GoldenGate processes.
SQL> grant ggs_ggsuser_role to GOLDENGATE;

Grant succeeded.

SQL> @ddl_enable

Trigger altered.

SQL> @ddl_pin GOLDENGATE

PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

oracle : rac1.rac.meditate.com : @simar1 : /u01/app/oracle/product/goldengate
$


Now we will enable additional suplemental logging for the tables to enable DDL replication for them.
Though we can enable additional supplemental logging on at column level also but here we will enable
at table level.

Use command:
DBLOGIN USERID meditate, PASSWORD meditate
ADD TRANDATA meditate.EMPLOYEE;
ADD TRANDATA meditate.RESULTS;
ADD TRANDATA meditate.LIFE;

Output is as:

GGSCI (rac1.rac.meditate.com) 6> DBLOGIN USERID meditate, PASSWORD meditate
Successfully logged into database.

GGSCI (rac1.rac.meditate.com) 7> ADD TRANDATA meditate.EMPLOYEE;
ERROR: No viable tables matched specification.

GGSCI (rac1.rac.meditate.com) 8> ADD TRANDATA meditate.RESULTS;
ERROR: No viable tables matched specification.

GGSCI (rac1.rac.meditate.com) 9> ADD TRANDATA meditate.LIFE;
ERROR: No viable tables matched specification.

GGSCI (rac1.rac.meditate.com) 10>


Output in logs is as:

2010-11-17 22:28:00 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): ADD TRANDATA meditate.EMPLOYEE;.
2010-11-17 22:28:18 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): ADD TRANDATA meditate.RESULTS;.
2010-11-17 22:28:32 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): ADD TRANDATA meditate.LIFE;.



Now alter the parameter recyclebin from default on to off using following command and bounce the database as:
alter system set recyclebin=OFF scope=spfile;
srvtl stop database -d simar
srcvctl start database -d simar

Output is as:

SQL> alter system set recyclebin=OFF scope=spfile;

System altered.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

oracle : rac1.rac.meditate.com : @simar1 : /home/oracle
$


oracle : rac1.rac.meditate.com : @crs : /home/oracle
$ srvctl stop database -d simar


oracle : rac1.rac.meditate.com : @crs : /home/oracle
$ srvctl start database -d simar


oracle : rac1.rac.meditate.com : @crs : /home/oracle
$ crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora.DATA1.dg ora....up.type 0/5 0/ ONLINE ONLINE rac1
ora....ER.lsnr ora....er.type 0/5 0/ ONLINE ONLINE rac1
ora....N1.lsnr ora....er.type 0/5 0/0 ONLINE ONLINE rac2
ora.RECV1.dg ora....up.type 0/5 0/ ONLINE ONLINE rac1
ora.asm ora.asm.type 0/5 0/ ONLINE ONLINE rac1
ora.eons ora.eons.type 0/3 0/ ONLINE ONLINE rac1
ora.gsd ora.gsd.type 0/5 0/ ONLINE ONLINE rac1
ora....network ora....rk.type 0/5 0/ ONLINE ONLINE rac1
ora.ons ora.ons.type 0/3 0/ ONLINE ONLINE rac1
ora.prabgun.db ora....se.type 0/2 0/2 ONLINE OFFLINE
ora....sv3.svc ora....ce.type 0/0 0/0 ONLINE OFFLINE
ora....SM1.asm application 0/5 0/0 ONLINE ONLINE rac1
ora....C1.lsnr application 0/5 0/0 ONLINE ONLINE rac1
ora.rac1.gsd application 0/5 0/0 ONLINE ONLINE rac1
ora.rac1.ons application 0/3 0/0 ONLINE ONLINE rac1
ora.rac1.vip ora....t1.type 0/0 0/0 ONLINE ONLINE rac1
ora....SM2.asm application 0/5 0/0 ONLINE ONLINE rac2
ora....C2.lsnr application 0/5 0/0 ONLINE ONLINE rac2
ora.rac2.gsd application 0/5 0/0 ONLINE ONLINE rac2
ora.rac2.ons application 0/3 0/0 ONLINE ONLINE rac2
ora.rac2.vip ora....t1.type 0/0 0/0 ONLINE ONLINE rac2
ora....SM3.asm application 0/5 0/0 ONLINE ONLINE rac3
ora....C3.lsnr application 0/5 0/0 ONLINE ONLINE rac3
ora.rac3.gsd application 0/5 0/0 ONLINE ONLINE rac3
ora.rac3.ons application 0/3 0/0 ONLINE ONLINE rac3
ora.rac3.vip ora....t1.type 0/0 0/0 ONLINE ONLINE rac3
ora....ry.acfs ora....fs.type 0/5 0/ ONLINE ONLINE rac1
ora.scan1.vip ora....ip.type 0/0 0/0 ONLINE ONLINE rac2
ora.simar.db ora....se.type 0/2 0/1 ONLINE ONLINE rac1
ora....sv1.svc ora....ce.type 0/0 0/0 ONLINE ONLINE rac1

oracle : rac1.rac.meditate.com : @crs : /home/oracle
$


oracle : rac1.rac.meditate.com : @simar1 : /home/oracle
$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Wed Nov 17 23:15:04 2010

Copyright (c) 1982, 2009, Oracle. All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> show parameter recycle

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
buffer_pool_recycle string
db_recycle_cache_size big integer 0
recyclebin string OFF
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

oracle : rac1.rac.meditate.com : @simar1 : /home/oracle
$


------------------------------------------------------------------------------------------------------------------

Now lets enable DDL replication by adding parameter "DDL INCLUDE MAPPED" in teh extract parameter file.

From documentation we have :

DDL
Valid for Extract and Replicat
Use the DDL parameter to enable DDL support and filter DDL operations. When used
without options, the DDL parameter causes all DDL operations to be propagated as follows:
? As an Extract parameter, it captures all supported DDL operations that are generated
on all supported database objects and sends them to the trail.
? As a Replicat parameter, it replicates all DDL operations from the GoldenGate trail
and applies them to the target. This is the same as the default behavior without this
parameter.
When used with options, DDL acts as a filtering agent to include or exclude DDL operations
based on:
? scope
? object type
? operation type
? object name
? strings in the DDL command syntax or comments, or both
SPTHREAD | NOSPTHREAD Valid for Extract and Replicat. Creates a separate database
connection thread for stored procedures. The default is
NOSPTHREAD.
TDSPACKETSIZE Valid for Replicat. Sets the TDS packet size for replication to a
Sybase target. Must be set to a multiple of 512. Valid values are
512 (the default) through 8192.
TRUSTEDCONNECTION Valid for Extract and Replicat for SQL Server. Causes
GoldenGate to connect by using trusted connection = yes. Contact
GoldenGate Technical Support before using this option.
XMLBUFSIZE Valid for Extract for Oracle. Sets the size of the memory buffer
that stores XML data that was extracted from the sys.xmltype
attribute of a SDO_GEORASTER object type. The default is 1048576
bytes (1MB). If the data exceeds the default buffer size, Extract
will abend. If this occurs, increase the buffer size and start
Extract again. The valid range of values is 1024 to 10485760 bytes.


Only one DDL parameter can be used in a parameter file, but you can combine multiple
inclusion and exclusion options to filter the DDL to the required level.
? When combined, multiple option specifications are linked logically as AND statements.
? All criteria specified with multiple options must be satisfied for a DDL statement to be
replicated.
? When using complex DDL filtering criteria, it is recommended that you test your
configuration in a test environment before using it in production.
WARNING Do not include any GoldenGate-installed DDL objects in a DDL parameter, in
a TABLE parameter, or in a MAP parameter, nor in a TABLEEXCLUDE or
MAPEXCLUDE parameter. Make certain that wildcard specifications in those
parameters do not include GoldenGate-installed DDL objects. These objects
must not be part of the GoldenGate configuration, but the Extract process
must be aware of operations on them, and that is why you must not explicitly
exclude them from the configuration with an EXCLUDE, TABLEEXCLUDE, or
MAPEXCLUDE parameter statement.
Do not use DDL for an Extract data pump or for a VAM-sort Extract. These process types do
not permit mapping or conversion of DDL and will propogate DDL records automatically
in PASSTHRU mode (see page 250). DDL that is performed on a source table of a certain name
(for example ALTER TABLE TableA...) will be applied by Replicat with the same table name (ALTER
TABLE TableA). It cannot be mapped as ALTER TABLE TableB.
For detailed information about how to use GoldenGate DDL support, see the GoldenGate
for Windows and UNIX Administrator Guide.


==========================================================================================================


GGSCI (rac1.rac.meditate.com) 11> edit params etruth

EXTRACT etruth
USERID goldengate@simarsv1, PASSWORD AACAAAAAAAAAAAKAPATACEHBIGQGCFZCCDIGAEMCQFFBZHVC, ENCRYPTKEY default
TRANLOGOPTIONS ASMUSER sys@RAC1ASM, ASMPASSWORD AACAAAAAAAAAAAJASAOBIHRGNFGAYCKBHJPAGIXFGGBJUAXI, ENCRYPTKEY default
EXTTRAIL /u01/app/oracle/product/goldengate/dirdat/tr
DDL INCLUDE MAPPED
TABLE meditate.results;


Since we have bounced the database without stopping the extracts etruth and ecreator will go to status ABENDED. So, we need to restart these processes as:

GGSCI (rac1.rac.meditate.com) 12> start extract etruth


GGSCI (rac1.rac.meditate.com) 12> start extract ecreator

I am not showing logout put here as by now we have done this many times earlier.

Now lets test it as:

Before DDL change talbe in source and target is as:

SQL> desc results
Name Null? Type
----------------------------------------- -------- ----------------------------
DEED_ID NUMBER
DEED VARCHAR2(60)
DEED_RESULT VARCHAR2(100)

SQL>

and after DDL change the table in source is as:


SQL> alter table results add test_col VARCHAR2(30);

Table altered.

SQL> desc results
Name Null? Type
----------------------------------------- -------- ----------------------------
DEED_ID NUMBER
DEED VARCHAR2(60)
DEED_RESULT VARCHAR2(100)
TEST_COL VARCHAR2(30)

SQL>



and target is also as:

SQL> desc results
Name Null? Type
----------------------------- -------- --------------------
DEED_ID NUMBER
DEED VARCHAR2(60)
DEED_RESULT VARCHAR2(100)
TEST_COL VARCHAR2(30)

SQL>


In an instant, one is born, and in an instant, one dies. In an instant one comes, and in an instant one goes. One who recognizes the Shabad merges into it, and is not afflicted by death.

Friday, November 12, 2010

Configure little bit complex Goldengate Replication (Post 21 of series,Configure little bit complex Goldengate Replication on Linux)

O Lord, You are Your Own Glorious Praise. You Yourself speak it; You Yourself hear it and contemplate it. You Yourself are the Jewel, and You are the Appraiser. You Yourself are of Infinite Value. O True Lord, You are Honor and Glory; You Yourself are the Giver.


Index of all the posts of Gurpartap Singh's Blog


Lets create a little bit more data for a litle bit complex replication

create table results (
deed_id number,
deed varchar2(60),
deed_result varchar2(100)
);

CREATE UNIQUE INDEX results_ix ON results(deed_id);


alter table results add constraint results_uq
unique (deed_id)
using index results_ix;


insert into results values (1,'Before Death was thinking of Money','Becomes snake in next incarnations');
insert into results values (2,'Before Death was thinking on Property','Becomes goblin in next incarnations');
insert into results values (3,'Before death was thinking of kids','Becomes pig in next incarnations');
insert into results values (4,'Before death was thinking of women','Becomes prostitute in next incarnations');
insert into results values (5,'Before death was thinking of LORD','Liberated');
commit;



create table life (
HUMAN_ID number,
FIRSTNAME varchar2(30),
LASTNAME varchar2(20),
DATE_OF_BITH date,
AGE_AT_TIME_OF_DEATH number,
DEED_ID_AT_TIME_OF_DEATH number
);

create unique index life_uk1 on life(human_id,firstname,lastname);

ALTER TABLE life
ADD CONSTRAINT life_fk1
FOREIGN KEY (DEED_ID_AT_TIME_OF_DEATH)
REFERENCES results (deed_id);


insert into life values (1,'AB','CD',SYSDATE - 23725,65,1);
insert into life values (1,'EF','GH',SYSDATE - 27375,75,2);
insert into life values (1,'IJ','KL',SYSDATE - 31025,85,3);
insert into life values (1,'MN','OP',SYSDATE - 34675,95,4);
insert into life values (1,'QR','ST',SYSDATE - 29200,80,5);

commit;



create or replace view PEOPLE_CLASSIFIED_ON_DEEDS as
select life.human_id, life.firstname, life.lastname, results.deed
from
life, results
where
results.deed_id=life.DEED_ID_AT_TIME_OF_DEATH
order by life.human_id
;


=====================================================================================

On target this table is not there and the coresponding table is "TENURE" as:

create table tenure (
PERSON_ID number,
INITIALNAME varchar2(30),
ENDNAME varchar2(20),
BIRTH_DATE date,
AGE_AT_DEATH number,
DEED_ID_AT_DEATH number
);

create unique index tenure_uk1 on tenure(PERSON_ID,INITIALNAME,ENDNAME);


ALTER TABLE tenure
ADD CONSTRAINT tenure_fk1
FOREIGN KEY (DEED_ID_AT_DEATH)
REFERENCES results (deed_id);

----------------------------------------------------------------------------------------

I have created the ddl on the targetside and now we can load initial data to it with expdp, insert (as just 5 recods) or we can use goldengate initial load method ( we have already used teh goldengate initial load method in old post so I will just use inset as I understand eveybody knows how yo use expdp/impdp

insert into tenure values (1,'AB','CD',SYSDATE - 23725,65,1);
insert into tenure values (1,'EF','GH',SYSDATE - 27375,75,2);
insert into tenure values (1,'IJ','KL',SYSDATE - 31025,85,3);
insert into tenure values (1,'MN','OP',SYSDATE - 34675,95,4);
insert into tenure values (1,'QR','ST',SYSDATE - 29200,80,5);

commit;

Output is as:

SQL> create table tenure (
PERSON_ID number,
INITIALNAME varchar2(30),
ENDNAME varchar2(20),
BIRTH_DATE date,
AGE_AT_DEATH number,
DEED_ID_AT_DEATH number
);
2 3 4 5 6 7 8
Table created.

SQL> create unique index tenure_uk1 on tenure(PERSON_ID,INITIALNAME,ENDNAME);

Index created.

SQL> ALTER TABLE tenure
ADD CONSTRAINT tenure_fk1
FOREIGN KEY (DEED_ID_AT_DEATH)
REFERENCES results (deed_id);
2 3 4
Table altered.

SQL> insert into tenure values (1,'AB','CD',SYSDATE - 23725,65,1);

1 row created.

SQL> insert into tenure values (1,'EF','GH',SYSDATE - 27375,75,2);
insert into tenure values (1,'IJ','KL',SYSDATE - 31025,85,3);
insert into tenure values (1,'MN','OP',SYSDATE - 34675,95,4);
insert into tenure values (1,'QR','ST',SYSDATE - 29200,80,5);

commit;

1 row created.

SQL>
1 row created.

SQL>
1 row created.

SQL>
1 row created.

SQL> SQL>
Commit complete.

SQL> select * from tenure;

PERSON_ID INITIALNAME ENDNAME BIRTH_DAT AGE_AT_DEATH DEED_ID_AT_DEATH
---------- ------------------------------ -------------------- --------- ------------ ----------------
1 AB CD 28-NOV-45 65 1
1 EF GH 01-DEC-35 75 2
1 IJ KL 03-DEC-25 85 3
1 MN OP 06-DEC-15 95 4
1 QR ST 02-DEC-30 80 5

SQL>
=========================================================================================

Now lets start a little bit complex replication:

Lets replicate records from table life in source to table tenure in target:

Parameter file for source should be:

ecreator
ADD EXTRACT ecreator, TRANLOG, BEGIN NOW, threads 3

ADD EXTTRAIL /u01/app/oracle/product/goldengate/dirdat/cr, EXTRACT ecreator


EDIT PARAMS ecreator

EXTRACT ecreator
USERID goldengate, PASSWORD AACAAAAAAAAAAAKAPATACEHBIGQGCFZCCDIGAEMCQFFBZHVC, ENCRYPTKEY default
TRANLOGOPTIONS ASMUSER sys@RAC1ASM, ASMPASSWORD AACAAAAAAAAAAAJASAOBIHRGNFGAYCKBHJPAGIXFGGBJUAXI, ENCRYPTKEY default
EXTTRAIL /u01/app/oracle/product/goldengate/dirdat/cr
TABLE meditate.life;

pcreator
ADD EXTRACT pcreator, EXTTRAILSOURCE /u01/app/oracle/product/goldengate/dirdat/cr

ADD RMTTRAIL /u01/app/oracle/product/goldengate/dirdat/cr, EXTRACT pcreator

EDIT PARAMS pcreator

EXTRACT pcreator
RMTHOST goldengate, MGRPORT 7909
RMTTRAIL /u01/app/oracle/product/goldengate/dirdat/cr
PASSTHRU
TABLE meditate.life;



start EXTRACT ecreator
info all
info extract Ecreator, detail

start extract Pcreator
info extract Ecreator, detail
info all


Output is as:

GGSCI (rac1.rac.meditate.com) 31> info all

Program Status Group Lag Time Since Chkpt

MANAGER RUNNING
EXTRACT RUNNING ELORD1 00:00:00 00:00:00
EXTRACT RUNNING ETRUTH 00:00:00 00:00:05
EXTRACT RUNNING PTRUTH 00:00:00 00:00:00


GGSCI (rac1.rac.meditate.com) 32> ADD EXTRACT ecreator, TRANLOG, BEGIN NOW, threads 3
EXTRACT added.


GGSCI (rac1.rac.meditate.com) 33> ADD EXTTRAIL /u01/app/oracle/product/goldengate/dirdat/cr, EXTRACT ecreator
EXTTRAIL added.


GGSCI (rac1.rac.meditate.com) 34> EDIT PARAMS ecreator



GGSCI (rac1.rac.meditate.com) 35> ADD EXTRACT pcreator, EXTTRAILSOURCE /u01/app/oracle/product/goldengate/dirdat/cr
EXTRACT added.


GGSCI (rac1.rac.meditate.com) 36> ADD RMTTRAIL /u01/app/oracle/product/goldengate/dirdat/cr, EXTRACT pcreator
RMTTRAIL added.


GGSCI (rac1.rac.meditate.com) 37> EDIT PARAMS pcreator



GGSCI (rac1.rac.meditate.com) 38> start EXTRACT ecreator

Sending START request to MANAGER ...
EXTRACT ECREATOR starting


GGSCI (rac1.rac.meditate.com) 39> info all

Program Status Group Lag Time Since Chkpt

MANAGER RUNNING
EXTRACT STOPPED ECREATOR 00:00:00 00:02:06
EXTRACT RUNNING ELORD1 00:00:00 00:00:02
EXTRACT RUNNING ETRUTH 00:00:00 00:00:05
EXTRACT STOPPED PCREATOR 00:00:00 00:01:31
EXTRACT RUNNING PTRUTH 00:00:00 00:00:05


GGSCI (rac1.rac.meditate.com) 40> info all

Program Status Group Lag Time Since Chkpt

MANAGER RUNNING
EXTRACT RUNNING ECREATOR 00:00:00 00:00:09
EXTRACT RUNNING ELORD1 00:00:00 00:00:07
EXTRACT RUNNING ETRUTH 00:00:00 00:00:05
EXTRACT STOPPED PCREATOR 00:00:00 00:02:50
EXTRACT RUNNING PTRUTH 00:00:00 00:00:04


GGSCI (rac1.rac.meditate.com) 41> info extract Ecreator, detail

EXTRACT ECREATOR Last Started 2010-11-12 15:01 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:00:02 ago)
Log Read Checkpoint Oracle Redo Logs
2010-11-12 15:02:50 Thread 1, Seqno 25/, RBA 16292368
Log Read Checkpoint Oracle Redo Logs
2010-11-12 15:02:50 Thread 2, Seqno 25, RBA 6216704
Log Read Checkpoint Oracle Redo Logs
2010-11-12 15:02:49 Thread 3, Seqno 21, RBA 38467584

Target Extract Trails:

Remote Trail Name Seqno RBA Max MB

/u01/app/oracle/product/goldengate/dirdat/cr 0 1012 10

Extract Source Begin End

+RECV1/simar/onlinelog/group_5.261.734045029 2010-11-12 14:59 2010-11-12 15:02
Not Available * Initialized * 2010-11-12 14:59


Current directory /u01/app/oracle/product/goldengate

Report file /u01/app/oracle/product/goldengate/dirrpt/ECREATOR.rpt
Parameter file /u01/app/oracle/product/goldengate/dirprm/ecreator.prm
Checkpoint file /u01/app/oracle/product/goldengate/dirchk/ECREATOR.cpe
Process file /u01/app/oracle/product/goldengate/dirpcs/ECREATOR.pce
Stdout file /u01/app/oracle/product/goldengate/dirout/ECREATOR.out
Error log /u01/app/oracle/product/goldengate/ggserr.log


GGSCI (rac1.rac.meditate.com) 42> start extract Pcreator

Sending START request to MANAGER ...
EXTRACT PCREATOR starting


GGSCI (rac1.rac.meditate.com) 43> info extract Ecreator, detail

EXTRACT ECREATOR Last Started 2010-11-12 15:01 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:00:05 ago)
Log Read Checkpoint Oracle Redo Logs
2010-11-12 15:03:10 Thread 1, Seqno 25, RBA 16301072
Log Read Checkpoint Oracle Redo Logs
2010-11-12 15:03:10 Thread 2, Seqno 25, RBA 6225920
Log Read Checkpoint Oracle Redo Logs
2010-11-12 15:03:09 Thread 3, Seqno 21, RBA 38482432

Target Extract Trails:

Remote Trail Name Seqno RBA Max MB

/u01/app/oracle/product/goldengate/dirdat/cr 0 1012 10

Extract Source Begin End

+RECV1/simar/onlinelog/group_5.261.734045029 2010-11-12 14:59 2010-11-12 15:03
Not Available * Initialized * 2010-11-12 14:59


Current directory /u01/app/oracle/product/goldengate

Report file /u01/app/oracle/product/goldengate/dirrpt/ECREATOR.rpt
Parameter file /u01/app/oracle/product/goldengate/dirprm/ecreator.prm
Checkpoint file /u01/app/oracle/product/goldengate/dirchk/ECREATOR.cpe
Process file /u01/app/oracle/product/goldengate/dirpcs/ECREATOR.pce
Stdout file /u01/app/oracle/product/goldengate/dirout/ECREATOR.out
Error log /u01/app/oracle/product/goldengate/ggserr.log


GGSCI (rac1.rac.meditate.com) 44> info all

Program Status Group Lag Time Since Chkpt

MANAGER RUNNING
EXTRACT RUNNING ECREATOR 00:00:00 00:00:04
EXTRACT RUNNING ELORD1 00:00:00 00:00:01
EXTRACT RUNNING ETRUTH 00:00:00 00:00:09
EXTRACT RUNNING PCREATOR 00:00:00 00:03:37
EXTRACT RUNNING PTRUTH 00:00:00 00:00:00


GGSCI (rac1.rac.meditate.com) 45>





In logs you will see:

2010-11-12 14:59:12 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): ADD EXTRACT ecreator TRANLOG, BEGIN NOW, threads 3.
2010-11-12 14:59:18 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): ADD EXTTRAIL /u01/app/oracle/product/goldengate/dirdat/cr EXTRACT ecreator.
2010-11-12 14:59:24 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): EDIT PARAMS ecreator.
2010-11-12 14:59:48 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): ADD EXTRACT pcreator EXTTRAILSOURCE /u01/app/oracle/product/goldengate/dirdat/cr.
2010-11-12 14:59:54 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): ADD RMTTRAIL /u01/app/oracle/product/goldengate/dirdat/cr EXTRACT pcreator.
2010-11-12 15:00:02 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): EDIT PARAMS pcreator.
2010-11-12 15:00:23 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): start EXTRACT ecreator.
2010-11-12 15:00:23 GGS INFO 301 Oracle GoldenGate Manager for Oracle, mgr.prm: Command received from GGSCI on host 192.168.1.176 (START EXTRACT ECREATOR ).
2010-11-12 15:00:23 GGS INFO 302 Oracle GoldenGate Manager for Oracle, mgr.prm: EXTRACT ECREATOR starting.
2010-11-12 15:00:23 GGS INFO 310 Oracle GoldenGate Capture for Oracle, ecreator.prm: EXTRACT ECREATOR starting.
2010-11-12 15:01:31 GGS INFO Z0-016 Oracle GoldenGate Capture for Oracle, ecreator.prm: Default thread stack size: 33554432.
2010-11-12 15:01:37 GGS INFO 310 Oracle GoldenGate Capture for Oracle, ecreator.prm: EXTRACT ECREATOR started.
2010-11-12 15:01:37 GGS INFO 112 Oracle GoldenGate Capture for Oracle, ecreator.prm: No recovery is required for target file /u01/app/oracle/product/goldengate/dirdat/cr000000, at RBA 0 (file not opened).
2010-11-12 15:01:37 GGS INFO Z0-05M Oracle GoldenGate Capture for Oracle, ecreator.prm: Output file /u01/app/oracle/product/goldengate/dirdat/cr is using format RELEASE 10.4.
2010-11-12 15:03:09 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): start extract Pcreator.
2010-11-12 15:03:09 GGS INFO 301 Oracle GoldenGate Manager for Oracle, mgr.prm: Command received from GGSCI on host 192.168.1.176 (START EXTRACT PCREATOR ).
2010-11-12 15:03:09 GGS INFO 302 Oracle GoldenGate Manager for Oracle, mgr.prm: EXTRACT PCREATOR starting.
2010-11-12 15:03:09 GGS INFO 310 Oracle GoldenGate Capture for Oracle, pcreator.prm: EXTRACT PCREATOR starting.
2010-11-12 15:03:09 GGS INFO 310 Oracle GoldenGate Capture for Oracle, pcreator.prm: EXTRACT PCREATOR started.
2010-11-12 15:03:14 GGS INFO 406 Oracle GoldenGate Capture for Oracle, pcreator.prm: Socket buffer size set to 27985 (flush size 27985).
2010-11-12 15:03:29 GGS INFO 112 Oracle GoldenGate Capture for Oracle, pcreator.prm: No recovery is required for target file /u01/app/oracle/product/goldengate/dirdat/cr000000, at RBA 0 (file not opened).
2010-11-12 15:03:29 GGS INFO Z0-05M Oracle GoldenGate Capture for Oracle, pcreator.prm: Output file /u01/app/oracle/product/goldengate/dirdat/cr is using format RELEASE 10.4.



In out case the definition of tables in source and target are not same so we need to create a definition file
so that target could understand what is coming to it.

I will create a file defecreator.prm under directroy $GOLDEN_GATE_INSALL/dirprm/defjun.prm on source as:

cd /u01/app/oracle/product/goldengate/dirprm
vi defecreator.prm

DEFSFILE /u01/app/oracle/product/goldengate/dirdat/defecreator
USERID goldengate, PASSWORD AACAAAAAAAAAAAKAPATACEHBIGQGCFZCCDIGAEMCQFFBZHVC, ENCRYPTKEY default
TABLE meditate.life;

and then execute:

cd /u01/app/oracle/product/goldengate
./defgen paramfile dirprm/defecreator.prm



Here is the output:

oracle : rac1.rac.meditate.com : @simar1 : /u01/app/oracle/product/goldengate/dirprm
$ cd /u01/app/oracle/product/goldengate

$ ./defgen paramfile dirprm/defecreator.prm

***********************************************************************
Oracle GoldenGate Table Definition Generator for Oracle
Version 10.4.0.19 Build 002
Linux, x64, 64bit (optimized), Oracle 11 on Sep 18 2009 00:09:13

Copyright (C) 1995, 2009, Oracle and/or its affiliates. All rights reserved.


Starting at 2010-11-12 15:48:20
***********************************************************************

Operating System Version:
Linux
Version #1 SMP Thu Sep 3 03:28:30 EDT 2009, Release 2.6.18-164.el5
Node: rac1.rac.meditate.com
Machine: x86_64
soft limit hard limit
Address Space Size : unlimited unlimited
Heap Size : unlimited unlimited
File Size : unlimited unlimited
CPU Time : unlimited unlimited

Process id: 26919

***********************************************************************
** Running with the following parameters **
***********************************************************************
DEFSFILE /u01/app/oracle/product/goldengate/dirdat/defecreator
USERID goldengate, PASSWORD ************************************************* ENCRYPTKEY default
TABLE meditate.life;
Retrieving definition for MEDITATE.LIFE



Definitions generated for 1 tables in /u01/app/oracle/product/goldengate/dirdat/defecreator


oracle : rac1.rac.meditate.com : @simar1 : /u01/app/oracle/product/goldengate
$




This generated the definition file for this and now we will move this definition file to target with scp to location: /u01/app/oracle/product/goldengate/dirdat/defecreator

Then we need to use the following paramter in the target paramter file so that target knows of
the definitions from the souce sife.

SOURCEDEFS /u01/app/oracle/product/goldengate/dirdat/defecreator

----------------------------------------------------------------------------------------------------
On target lets add the replicats taht will apply changes from source to the target database as:


ADD REPLICAT rcreator, EXTTRAIL /u01/app/oracle/product/goldengate/dirdat/cr


Create the parameter file for the Replicat group

In the parameter file we have new parameter SOURCEDEFS that defines the
definition of the source objects.
then we have map parameter that defines the mapping of tables and the COLMAP parameter
that defines the column mapping of the tables. KEYCOL designates columns that uniquely identify rows.


EDIT PARAMS rcreator

REPLICAT rcreator
SOURCEDEFS /u01/app/oracle/product/goldengate/dirdat/defecreator
USERID goldengate, PASSWORD AACAAAAAAAAAAAKAPATACEHBIGQGCFZCCDIGAEMCQFFBZHVC, ENCRYPTKEY default
MAP meditate.life, TARGET CONSCIOUSNESS.tenure, &
COLMAP (PERSON_ID=HUMAN_ID, &
INITIALNAME=FIRSTNAME, &
ENDNAME=LASTNAME, &
BIRTH_DATE=DATE_OF_BITH, &
AGE_AT_DEATH=AGE_AT_TIME_OF_DEATH, &
DEED_ID_AT_DEATH=DEED_ID_AT_TIME_OF_DEATH, &
KEYCOLS (PERSON_ID, INITIALNAME,ENDNAME);

start replicat Rcreator
status replicat Rcreator

Output is as:

GGSCI (goldengate) 48> ADD REPLICAT rcreator, EXTTRAIL /u01/app/oracle/product/goldengate/dirdat/cr
REPLICAT added.


GGSCI (goldengate) 49> EDIT PARAMS rcreator

REPLICAT rcreator
SOURCEDEFS /u01/app/oracle/product/goldengate/dirdat/defecreator
USERID goldengate, PASSWORD AACAAAAAAAAAAAKAPATACEHBIGQGCFZCCDIGAEMCQFFBZHVC, ENCRYPTKEY default
MAP meditate.life, TARGET CONSCIOUSNESS.tenure, &
COLMAP (PERSON_ID=HUMAN_ID, &
INITIALNAME=FIRSTNAME, &
ENDNAME=LASTNAME, &
BIRTH_DATE=DATE_OF_BITH, &
AGE_AT_DEATH=AGE_AT_TIME_OF_DEATH, &
DEED_ID_AT_DEATH=DEED_ID_AT_TIME_OF_DEATH, &
KEYCOLS (PERSON_ID, INITIALNAME,ENDNAME);





GGSCI (goldengate) 52> start replicat Rcreator

Sending START request to MANAGER ...
REPLICAT RCREATOR starting


GGSCI (goldengate) 53> status replicat Rcreator
REPLICAT RCREATOR: RUNNING


GGSCI (goldengate) 54> info all

Program Status Group Lag Time Since Chkpt

MANAGER RUNNING
REPLICAT RUNNING RCREATOR 00:00:00 00:00:05
REPLICAT RUNNING RLORD1 00:00:00 00:00:09
REPLICAT RUNNING RTRUTH 00:00:00 00:00:06


GGSCI (goldengate) 55>



In logs you will see:

2010-11-12 14:40:19 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): ADD REPLICAT rcreator EXTTRAIL /u01/app/oracle/product/goldengate/dirdat/cr.
2010-11-12 14:40:31 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): EDIT PARAMS rcreator.
2010-11-12 14:42:25 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): start replicat Rcreator.
2010-11-12 14:42:25 GGS INFO 301 Oracle GoldenGate Manager for Oracle, mgr.prm: Command received from GGSCI on host 192.168.1.169 (START REPLICAT RCREATOR ).
2010-11-12 14:42:25 GGS INFO 302 Oracle GoldenGate Manager for Oracle, mgr.prm: REPLICAT RCREATOR starting.
2010-11-12 14:42:25 GGS INFO 320 Oracle GoldenGate Delivery for Oracle, rcreator.prm: REPLICAT RCREATOR starting.
2010-11-12 14:42:26 GGS INFO 320 Oracle GoldenGate Delivery for Oracle, rcreator.prm: REPLICAT RCREATOR started.






Now, do replication


On Source:
SQL> set line 300
SQL> select * from life;

HUMAN_ID FIRSTNAME LASTNAME DATE_OF_BITH AGE_AT_TIME_OF_DEATH DEED_ID_AT_TIME_OF_DEATH
---------- ------------------------------ -------------------- ------------------ -------------------- ------------------------
1 AB CD 26-NOV-45 65 1
1 EF GH 29-NOV-35 75 2
1 IJ KL 01-DEC-25 85 3
1 MN OP 04-DEC-15 95 4
1 QR ST 30-NOV-30 80 5

5 rows selected.

SQL>

On target:

SQL> set line 300
SQL> select * from tenure;

PERSON_ID INITIALNAME ENDNAME BIRTH_DAT AGE_AT_DEATH DEED_ID_AT_DEATH
---------- ------------------------------ -------------------- --------- ------------ ----------------
1 AB CD 28-NOV-45 65 1
1 EF GH 01-DEC-35 75 2
1 IJ KL 03-DEC-25 85 3
1 MN OP 06-DEC-15 95 4
1 QR ST 02-DEC-30 80 5

SQL>


On Souce:

select * from life;
insert into life values (2,'AB','CD',SYSDATE - 23725,65,1);
insert into life values (2,'EF','GH',SYSDATE - 27375,75,2);
insert into life values (2,'IJ','KL',SYSDATE - 31025,85,3);
insert into life values (2,'MN','OP',SYSDATE - 34675,95,4);
insert into life values (2,'QR','ST',SYSDATE - 29200,80,5);
commit;


Output is as:

SQL> select * from life;

HUMAN_ID FIRSTNAME LASTNAME DATE_OF_BITH AGE_AT_TIME_OF_DEATH DEED_ID_AT_TIME_OF_DEATH
---------- ------------------------------ -------------------- ------------------ -------------------- ------------------------
1 AB CD 26-NOV-45 65 1
1 EF GH 29-NOV-35 75 2
1 IJ KL 01-DEC-25 85 3
1 MN OP 04-DEC-15 95 4
1 QR ST 30-NOV-30 80 5

5 rows selected.

SQL> insert into life values (2,'AB','CD',SYSDATE - 23725,65,1);
insert into life values (2,'EF','GH',SYSDATE - 27375,75,2);
insert into life values (2,'IJ','KL',SYSDATE - 31025,85,3);
insert into life values (2,'MN','OP',SYSDATE - 34675,95,4);
insert into life values (2,'QR','ST',SYSDATE - 29200,80,5);
commit;
1 row created.

SQL>
1 row created.

SQL>
1 row created.

SQL>
1 row created.

SQL>
1 row created.

SQL> commit;

Commit complete.

SQL>


and On target replication is done as:

SQL> select * from tenure;

PERSON_ID INITIALNAME ENDNAME BIRTH_DAT AGE_AT_DEATH DEED_ID_AT_DEATH
---------- ------------------------------ -------------------- --------- ------------ ----------------
1 AB CD 28-NOV-45 65 1
1 EF GH 01-DEC-35 75 2
1 IJ KL 03-DEC-25 85 3
1 MN OP 06-DEC-15 95 4
1 QR ST 02-DEC-30 80 5
2 AB CD 28-NOV-45 65 1
2 EF GH 01-DEC-35 75 2
2 IJ KL 03-DEC-25 85 3
2 MN OP 06-DEC-15 95 4
2 QR ST 02-DEC-30 80 5
1 AB CD 28-NOV-45 65 1
1 EF GH 01-DEC-35 75 2
1 IJ KL 03-DEC-25 85 3
1 MN OP 06-DEC-15 95 4
1 QR ST 02-DEC-30 80 5

10 rows selected.

SQL>


Next we will do a little bit more complex parameter file:

Then the servers on source side crashed and then after a reboot/crash we need to start
the manager process if manager process is not configured to start at reboot. Also
we can confugure all the extracts to start when manager process is started but we haven't then
you need to start it manually as following.


$ ./ggsci

Oracle GoldenGate Command Interpreter for Oracle
Version 10.4.0.19 Build 002
Linux, x64, 64bit (optimized), Oracle 11 on Sep 17 2009 23:51:28

Copyright (C) 1995, 2009, Oracle and/or its affiliates. All rights reserved.



GGSCI (rac1.rac.meditate.com) 1> info all

Program Status Group Lag Time Since Chkpt

MANAGER RUNNING
EXTRACT ABENDED ECREATOR 00:00:00 09:55:31
EXTRACT ABENDED ELORD1 00:00:00 09:55:49
EXTRACT ABENDED ETRUTH 00:00:00 09:55:48
EXTRACT ABENDED PCREATOR 00:00:00 09:55:54
EXTRACT ABENDED PTRUTH 00:00:00 09:55:54


GGSCI (rac1.rac.meditate.com) 2> start extract ETRUTH

Sending START request to MANAGER ...
EXTRACT ETRUTH starting


GGSCI (rac1.rac.meditate.com) 8> info all

Program Status Group Lag Time Since Chkpt

MANAGER RUNNING
EXTRACT ABENDED ECREATOR 00:00:00 09:59:42
EXTRACT ABENDED ELORD1 00:00:00 10:00:00
EXTRACT RUNNING ETRUTH 00:00:00 00:00:01
EXTRACT ABENDED PCREATOR 00:00:00 10:00:05
EXTRACT ABENDED PTRUTH 00:00:00 10:00:05


GGSCI (rac1.rac.meditate.com) 9> start extract PTRUTH

Sending START request to MANAGER ...
EXTRACT PTRUTH starting


GGSCI (rac1.rac.meditate.com) 10> start extract ECREATOR

Sending START request to MANAGER ...
EXTRACT ECREATOR starting


GGSCI (rac1.rac.meditate.com) 13> info all

Program Status Group Lag Time Since Chkpt

MANAGER RUNNING
EXTRACT RUNNING ECREATOR 00:00:00 00:00:10
EXTRACT ABENDED ELORD1 00:00:00 10:03:37
EXTRACT RUNNING ETRUTH 00:00:00 00:00:08
EXTRACT ABENDED PCREATOR 00:00:00 10:03:42
EXTRACT RUNNING PTRUTH 00:00:00 00:00:00


GGSCI (rac1.rac.meditate.com) 14> start extract PCREATOR

Sending START request to MANAGER ...
EXTRACT PCREATOR starting


GGSCI (rac1.rac.meditate.com) 15> info all

Program Status Group Lag Time Since Chkpt

MANAGER RUNNING
EXTRACT RUNNING ECREATOR 00:00:00 00:00:02
EXTRACT ABENDED ELORD1 00:00:00 10:04:44
EXTRACT RUNNING ETRUTH 00:00:00 00:00:00
EXTRACT RUNNING PCREATOR 00:00:00 00:00:09
EXTRACT RUNNING PTRUTH 00:00:00 00:00:07


GGSCI (rac1.rac.meditate.com) 16>


==============================================================================================================
Info in logs on source

2010-11-13 08:43:13 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): start extract ETRUTH.
2010-11-13 08:43:13 GGS INFO 301 Oracle GoldenGate Manager for Oracle, mgr.prm: Command received from GGSCI on host 192.168.1.176 (START EXTRACT ETRUTH ).
2010-11-13 08:43:13 GGS INFO 302 Oracle GoldenGate Manager for Oracle, mgr.prm: EXTRACT ETRUTH starting.
2010-11-13 08:43:13 GGS INFO 310 Oracle GoldenGate Capture for Oracle, etruth.prm: EXTRACT ETRUTH starting.
2010-11-13 08:46:34 GGS INFO Z0-016 Oracle GoldenGate Capture for Oracle, etruth.prm: Default thread stack size: 33554432.
2010-11-13 08:46:35 GGS INFO 310 Oracle GoldenGate Capture for Oracle, etruth.prm: EXTRACT ETRUTH started.
2010-11-13 08:46:36 GGS INFO 112 Oracle GoldenGate Capture for Oracle, etruth.prm: Recovery initialization completed for target file /u01/app/oracle/product/goldengate/dirdat/tr000001, at RBA 1071.
2010-11-13 08:46:36 GGS INFO Z0-05M Oracle GoldenGate Capture for Oracle, etruth.prm: Output file /u01/app/oracle/product/goldengate/dirdat/tr is using format RELEASE 10.4.
2010-11-13 08:46:36 GGS INFO 224 Oracle GoldenGate Capture for Oracle, etruth.prm: Rolling over remote file /u01/app/oracle/product/goldengate/dirdat/tr000001.
2010-11-13 08:46:36 GGS INFO 112 Oracle GoldenGate Capture for Oracle, etruth.prm: Recovery completed for target file /u01/app/oracle/product/goldengate/dirdat/tr000002, at RBA 1071.
2010-11-13 08:46:36 GGS INFO 112 Oracle GoldenGate Capture for Oracle, etruth.prm: Recovery completed for all targets.
2010-11-13 08:46:37 GGS INFO 220 Oracle GoldenGate Capture for Oracle, etruth.prm: Found crash recovery marker from thread #2 on sequence 28 at RBA 1040. Aborting uncommitted transactions.
2010-11-13 08:47:25 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): start extract PTRUTH.
2010-11-13 08:47:25 GGS INFO 301 Oracle GoldenGate Manager for Oracle, mgr.prm: Command received from GGSCI on host 192.168.1.176 (START EXTRACT PTRUTH ).
2010-11-13 08:47:25 GGS INFO 302 Oracle GoldenGate Manager for Oracle, mgr.prm: EXTRACT PTRUTH starting.
2010-11-13 08:47:25 GGS INFO 310 Oracle GoldenGate Capture for Oracle, ptruth.prm: EXTRACT PTRUTH starting.
2010-11-13 08:47:25 GGS INFO 310 Oracle GoldenGate Capture for Oracle, ptruth.prm: EXTRACT PTRUTH started.
2010-11-13 08:47:30 GGS INFO 406 Oracle GoldenGate Capture for Oracle, ptruth.prm: Socket buffer size set to 27985 (flush size 27985).
2010-11-13 08:47:45 GGS INFO 112 Oracle GoldenGate Capture for Oracle, ptruth.prm: Recovery initialization completed for target file /u01/app/oracle/product/goldengate/dirdat/tr000000, at RBA 1954.
2010-11-13 08:47:45 GGS INFO Z0-05M Oracle GoldenGate Capture for Oracle, ptruth.prm: Output file /u01/app/oracle/product/goldengate/dirdat/tr is using format RELEASE 10.4.
2010-11-13 08:47:45 GGS INFO 224 Oracle GoldenGate Capture for Oracle, ptruth.prm: Rolling over remote file /u01/app/oracle/product/goldengate/dirdat/tr000001.
2010-11-13 08:47:45 GGS INFO 112 Oracle GoldenGate Capture for Oracle, ptruth.prm: Recovery completed for target file /u01/app/oracle/product/goldengate/dirdat/tr000001, at RBA 511.
2010-11-13 08:47:45 GGS INFO 112 Oracle GoldenGate Capture for Oracle, ptruth.prm: Recovery completed for all targets.
2010-11-13 08:47:57 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): start extract ECREATOR.
2010-11-13 08:47:57 GGS INFO 301 Oracle GoldenGate Manager for Oracle, mgr.prm: Command received from GGSCI on host 192.168.1.176 (START EXTRACT ECREATOR ).
2010-11-13 08:47:57 GGS INFO 302 Oracle GoldenGate Manager for Oracle, mgr.prm: EXTRACT ECREATOR starting.
2010-11-13 08:47:57 GGS INFO 310 Oracle GoldenGate Capture for Oracle, ecreator.prm: EXTRACT ECREATOR starting.
2010-11-13 08:50:22 GGS INFO Z0-016 Oracle GoldenGate Capture for Oracle, ecreator.prm: Default thread stack size: 33554432.
2010-11-13 08:50:25 GGS INFO 310 Oracle GoldenGate Capture for Oracle, ecreator.prm: EXTRACT ECREATOR started.
2010-11-13 08:50:25 GGS INFO 112 Oracle GoldenGate Capture for Oracle, ecreator.prm: Recovery initialization completed for target file /u01/app/oracle/product/goldengate/dirdat/cr000000, at RBA 4816.
2010-11-13 08:50:25 GGS INFO Z0-05M Oracle GoldenGate Capture for Oracle, ecreator.prm: Output file /u01/app/oracle/product/goldengate/dirdat/cr is using format RELEASE 10.4.
2010-11-13 08:50:25 GGS INFO 224 Oracle GoldenGate Capture for Oracle, ecreator.prm: Rolling over remote file /u01/app/oracle/product/goldengate/dirdat/cr000000.
2010-11-13 08:50:25 GGS INFO 112 Oracle GoldenGate Capture for Oracle, ecreator.prm: Recovery completed for target file /u01/app/oracle/product/goldengate/dirdat/cr000001, at RBA 1075.
2010-11-13 08:50:25 GGS INFO 112 Oracle GoldenGate Capture for Oracle, ecreator.prm: Recovery completed for all targets.
2010-11-13 08:50:25 GGS INFO 220 Oracle GoldenGate Capture for Oracle, ecreator.prm: Found crash recovery marker from thread #2 on sequence 28 at RBA 1040. Aborting uncommitted transactions.
2010-11-13 08:50:59 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): start extract PCREATOR.
2010-11-13 08:50:59 GGS INFO 301 Oracle GoldenGate Manager for Oracle, mgr.prm: Command received from GGSCI on host 192.168.1.176 (START EXTRACT PCREATOR ).
2010-11-13 08:50:59 GGS INFO 302 Oracle GoldenGate Manager for Oracle, mgr.prm: EXTRACT PCREATOR starting.
2010-11-13 08:50:59 GGS INFO 310 Oracle GoldenGate Capture for Oracle, pcreator.prm: EXTRACT PCREATOR starting.
2010-11-13 08:51:05 GGS INFO 310 Oracle GoldenGate Capture for Oracle, pcreator.prm: EXTRACT PCREATOR started.
2010-11-13 08:51:10 GGS INFO 406 Oracle GoldenGate Capture for Oracle, pcreator.prm: Socket buffer size set to 27985 (flush size 27985).
2010-11-13 08:51:24 GGS INFO 112 Oracle GoldenGate Capture for Oracle, pcreator.prm: Recovery initialization completed for target file /u01/app/oracle/product/goldengate/dirdat/cr000000, at RBA 4886.
2010-11-13 08:51:24 GGS INFO Z0-05M Oracle GoldenGate Capture for Oracle, pcreator.prm: Output file /u01/app/oracle/product/goldengate/dirdat/cr is using format RELEASE 10.4.
2010-11-13 08:51:24 GGS INFO 224 Oracle GoldenGate Capture for Oracle, pcreator.prm: Rolling over remote file /u01/app/oracle/product/goldengate/dirdat/cr000001.
2010-11-13 08:51:24 GGS INFO 112 Oracle GoldenGate Capture for Oracle, pcreator.prm: Recovery completed for target file /u01/app/oracle/product/goldengate/dirdat/cr000001, at RBA 511.
2010-11-13 08:51:24 GGS INFO 112 Oracle GoldenGate Capture for Oracle, pcreator.prm: Recovery completed for all targets.


==================================================================================================================

Info from logs in target:

2010-11-13 08:16:31 GGS INFO 301 Oracle GoldenGate Manager for Oracle, mgr.prm: Command received from EXTRACT on host 192.168.1.176 (START SERVER CPU -1 PRI -1 PARAMS ).
2010-11-13 08:16:31 GGS INFO 302 Oracle GoldenGate Manager for Oracle, mgr.prm: Manager started collector process (Port 7846).
2010-11-13 08:16:31 GGS INFO 373 Oracle GoldenGate Collector, port 7846: Waiting for connection (started dynamically).
2010-11-13 08:16:50 GGS INFO 373 Oracle GoldenGate Collector: Connected to 192.168.1.176:13240.
2010-11-13 08:16:50 GGS INFO 370 Oracle GoldenGate Collector, port 7846: Opening /u01/app/oracle/product/goldengate/dirdat/tr000000 (byte 1954, current EOF 1954).
2010-11-13 08:16:50 GGS INFO 371 Oracle GoldenGate Collector, port 7846: Closing /u01/app/oracle/product/goldengate/dirdat/tr000000.
2010-11-13 08:16:50 GGS INFO 370 Oracle GoldenGate Collector, port 7846: Opening /u01/app/oracle/product/goldengate/dirdat/tr000001 (byte -1, current EOF 0).
2010-11-13 08:16:50 GGS INFO 323 Oracle GoldenGate Delivery for Oracle, rtruth.prm: Processed extract process RESTART_ABEND record at seq 1, rba 511 (aborted 0 records).
2010-11-13 08:16:51 GGS INFO 323 Oracle GoldenGate Delivery for Oracle, rtruth.prm: Processed extract process RESTART_ABEND record at seq 1, rba 572 (aborted 0 records).
2010-11-13 08:20:10 GGS INFO 301 Oracle GoldenGate Manager for Oracle, mgr.prm: Command received from EXTRACT on host 192.168.1.176 (START SERVER CPU -1 PRI -1 PARAMS ).
2010-11-13 08:20:10 GGS INFO 373 Oracle GoldenGate Collector, port 7847: Waiting for connection (started dynamically).
2010-11-13 08:20:10 GGS INFO 302 Oracle GoldenGate Manager for Oracle, mgr.prm: Manager started collector process (Port 7847).
2010-11-13 08:20:30 GGS INFO 373 Oracle GoldenGate Collector: Connected to 192.168.1.176:16891.
2010-11-13 08:20:30 GGS INFO 370 Oracle GoldenGate Collector, port 7847: Opening /u01/app/oracle/product/goldengate/dirdat/cr000000 (byte 4886, current EOF 4886).
2010-11-13 08:20:30 GGS INFO 371 Oracle GoldenGate Collector, port 7847: Closing /u01/app/oracle/product/goldengate/dirdat/cr000000.
2010-11-13 08:20:30 GGS INFO 370 Oracle GoldenGate Collector, port 7847: Opening /u01/app/oracle/product/goldengate/dirdat/cr000001 (byte -1, current EOF 0).
2010-11-13 08:20:30 GGS INFO 323 Oracle GoldenGate Delivery for Oracle, rcreator.prm: Processed extract process RESTART_ABEND record at seq 1, rba 511 (aborted 0 records).
2010-11-13 08:20:31 GGS INFO 323 Oracle GoldenGate Delivery for Oracle, rcreator.prm: Processed extract process RESTART_ABEND record at seq 1, rba 574 (aborted 0 records).

=================================================================================================================


Now lets modify the parameter file on the target side so that it just picks inserts as:

Take the backup of the old parameter file on target as:

oracle : goldengate : @emrep : /u01/app/oracle/product/goldengate/dirprm
$ cp rcreator.prm rcreator.prm.orig

oracle : goldengate : @emrep : /u01/app/oracle/product/goldengate/dirprm
$ ls -lart
total 36
-rw-rw-rw- 1 oracle oinstall 11 Sep 12 22:10 mgr.prm
-rw-rw-rw- 1 oracle oinstall 233 Sep 13 21:38 r1cust.prm
-rw-rw-rw- 1 oracle oinstall 185 Nov 7 21:15 onetime.prm
drwxr-xr-x 13 oracle oinstall 4096 Nov 7 22:18 ..
-rw-rw-rw- 1 oracle oinstall 185 Nov 8 22:53 rlord1.prm
-rw-rw-rw- 1 oracle oinstall 183 Nov 9 22:42 rtruth.prm
-rw-rw-rw- 1 oracle oinstall 458 Nov 12 15:30 rcreator.prm
-rw-r--r-- 1 oracle oinstall 458 Nov 13 10:38 rcreator.prm.orig
drwxrwxr-x 2 oracle oinstall 4096 Nov 13 10:38 .

oracle : goldengate : @emrep : /u01/app/oracle/product/goldengate/dirprm
$


Now we will use some more parameters in the parameter file and they are described as below in the documentation:

DISCARDFILE :

Valid for Extract and Replicat
Use the DISCARDFILE parameter to generate a discard file to which GoldenGate can log
records that it cannot process. Records can be discarded for several reasons. For example,
a record is discarded if the underlying table structure changed since the record was written
to the trail. You can use the discard file to help you identify the cause of processing errors.
Each entry in the discard file contains the discarded record buffer and an error code
indicating the reason. GoldenGate creates the specified discard file in the dirrpt subdirectory
of the GoldenGate installation directory. You can view it with a text editor or by
using the following command in GGSCI.
VIEW REPORT
Where: is the fully qualified name of the discard file.
To prevent having to perform manual maintenance of discard files, use either the PURGE or
APPEND option. Otherwise, you must specify a different discard file name before starting
each process run, because GoldenGate will not write to an existing discard file.
To set an upper limit for the size of the file, use either the MAXBYTES or MEGABYTES option. If
the specified size is exceeded, the process will abend.
Default By default, GoldenGate does not generate a discard file.


DISCARDROLLOVER:

Valid for Extract and Replicat
Use the DISCARDROLLOVER parameter to set a schedule for aging discard files. For long or
continuous runs, setting an aging schedule prevents the discard file from filling up and
causing the process to abend, and it provides a predictable set of archives that can be
included in your archiving routine.
When the DISCARDROLLOVER age point is reached, a new discard file is created, and old files
are renamed in the format of ., where:
? is the name of the Extract or Replicat group
? is a number that gets incremented by one each time a new file is created, for
example: myext0.dsc, myext1.dsc, myext2.dsc, and so forth.
You can specify a time of day, a day of the week, or both. Specifying just a time of day (AT
option) without a day of the week (ON option) generates a discard file at the specified time
every day.
Default Disabled. No rules specified.


REPERROR:

Use REPERROR to specify an error and a response that together control how Replicat responds
to the error when executing the MAP statement. You can use REPERROR at the MAP level to
override and supplement global error handling rules set with the REPERROR parameter.
Multiple REPERROR statements can be applied to the same MAP statement to
enable automatic, comprehensive management of errors and interruption-free replication
processing.

DEFAULT Sets a global response to all errors except those for which explicit
REPERROR statements are specified.


GETDELETES | IGNOREDELETES:

Valid for Extract and Replicat
Use the GETDELETES and IGNOREDELETES parameters to control whether or not GoldenGate
processes delete operations. These parameters are table-specific. One parameter remains
in effect for all subsequent TABLE or MAP statements, until the other parameter is
encountered.



GETUPDATES | IGNOREUPDATES:

Valid for Extract and Replicat
Use the GETUPDATES and IGNOREUPDATES parameters to control whether or not GoldenGate
processes update operations. The parameters are table-specific. One parameter remains in
effect for all subsequent TABLE or MAP statements, until the other parameter is encountered.


GETINSERTS | IGNOREINSERTS:

Valid for Extract and Replicat
Use the GETINSERTS and IGNOREINSERTS parameters to control whether or not insert operations
are processed by GoldenGate. The parameters are table-specific. One parameter remains
in effect for all subsequent TABLE or MAP statements, until the other parameter is
encountered.



and now update the parameter file on target as:

GGSCI (goldengate) 7> edit params rcreator


REPLICAT rcreator
SOURCEDEFS /u01/app/oracle/product/goldengate/dirdat/defecreator
DISCARDFILE /u01/app/oracle/product/goldengate/dirdat/creator_err, purge
DISCARDROLLOVER ON saturday
USERID goldengate, PASSWORD AACAAAAAAAAAAAKAPATACEHBIGQGCFZCCDIGAEMCQFFBZHVC, ENCRYPTKEY default
REPERROR (DEFAULT, DISCARD)
IGNOREDELETES
IGNOREUPDATES
GETINSERTS
MAP meditate.life, TARGET CONSCIOUSNESS.tenure, &
COLMAP (PERSON_ID=HUMAN_ID, &
INITIALNAME=FIRSTNAME, &
ENDNAME=LASTNAME, &
BIRTH_DATE=DATE_OF_BITH, &
AGE_AT_DEATH=AGE_AT_TIME_OF_DEATH, &
DEED_ID_AT_DEATH=DEED_ID_AT_TIME_OF_DEATH), &
KEYCOLS (PERSON_ID, INITIALNAME,ENDNAME);


Now stop and start the replicat on target as:

GGSCI (goldengate) 9> stop replicat RCREATOR

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


GGSCI (goldengate) 10> info all

Program Status Group Lag Time Since Chkpt

MANAGER RUNNING
REPLICAT STOPPED RCREATOR 00:00:00 00:00:04
REPLICAT RUNNING RLORD1 00:00:00 00:00:05
REPLICAT RUNNING RTRUTH 00:00:00 00:00:04


GGSCI (goldengate) 11> start REPLICAT RCREATOR

Sending START request to MANAGER ...
REPLICAT RCREATOR starting


GGSCI (goldengate) 12>



Now, lets see if our replication is working:

Source before insets:

SQL> l
1* select * from life
SQL> /

HUMAN_ID FIRSTNAME LASTNAME DATE_OF_BITH AGE_AT_TIME_OF_DEATH DEED_ID_AT_TIME_OF_DEATH
---------- ------------------------------ -------------------- ------------------ -------------------- ------------------------
1 AB CD 26-NOV-45 65 1
1 EF GH 29-NOV-35 75 2
1 IJ KL 01-DEC-25 85 3
1 MN OP 04-DEC-15 95 4
1 QR ST 30-NOV-30 80 5
2 AB CD 28-NOV-45 65 1
2 EF GH 01-DEC-35 75 2
2 IJ KL 03-DEC-25 85 3
2 MN OP 06-DEC-15 95 4
2 QR ST 02-DEC-30 80 5

10 rows selected.

SQL>

Target before inserts in source as:

SQL> l
1* select * from tenure
SQL> /

PERSON_ID INITIALNAME ENDNAME BIRTH_DAT AGE_AT_DEATH DEED_ID_AT_DEATH
---------- ------------------------------ -------------------- --------- ------------ ----------------
2 AB CD 28-NOV-45 65 1
2 EF GH 01-DEC-35 75 2
2 IJ KL 03-DEC-25 85 3
2 MN OP 06-DEC-15 95 4
2 QR ST 02-DEC-30 80 5
1 AB CD 28-NOV-45 65 1
1 EF GH 01-DEC-35 75 2
1 IJ KL 03-DEC-25 85 3
1 MN OP 06-DEC-15 95 4
1 QR ST 02-DEC-30 80 5

10 rows selected.

SQL>



Now lets insert in source as:

insert into life values (3,'AB','CD',SYSDATE - 23725,65,1);
insert into life values (3,'EF','GH',SYSDATE - 27375,75,2);
insert into life values (3,'IJ','KL',SYSDATE - 31025,85,3);
insert into life values (3,'MN','OP',SYSDATE - 34675,95,4);
insert into life values (3,'QR','ST',SYSDATE - 29200,80,5);
commit;


------------------------------------------------------------------------------------


SQL> insert into life values (3,'AB','CD',SYSDATE - 23725,65,1);
insert into life values (3,'EF','GH',SYSDATE - 27375,75,2);
insert into life values (3,'IJ','KL',SYSDATE - 31025,85,3);
insert into life values (3,'MN','OP',SYSDATE - 34675,95,4);
insert into life values (3,'QR','ST',SYSDATE - 29200,80,5);
commit;

1 row created.

SQL>
1 row created.

SQL>
1 row created.

SQL>
1 row created.

SQL>
1 row created.

SQL>
Commit complete.

SQL>

------------------------------------------------------------

Target:

SQL> l
1* select * from tenure
SQL> /

PERSON_ID INITIALNAME ENDNAME BIRTH_DAT AGE_AT_DEATH DEED_ID_AT_DEATH
---------- ------------------------------ -------------------- --------- ------------ ----------------
3 AB CD 29-NOV-45 65 1
3 EF GH 02-DEC-35 75 2
3 IJ KL 04-DEC-25 85 3
3 MN OP 07-DEC-15 95 4
3 QR ST 03-DEC-30 80 5
2 AB CD 28-NOV-45 65 1
2 EF GH 01-DEC-35 75 2
2 IJ KL 03-DEC-25 85 3
2 MN OP 06-DEC-15 95 4
2 QR ST 02-DEC-30 80 5
1 AB CD 28-NOV-45 65 1

PERSON_ID INITIALNAME ENDNAME BIRTH_DAT AGE_AT_DEATH DEED_ID_AT_DEATH
---------- ------------------------------ -------------------- --------- ------------ ----------------
1 EF GH 01-DEC-35 75 2
1 IJ KL 03-DEC-25 85 3
1 MN OP 06-DEC-15 95 4
1 QR ST 02-DEC-30 80 5

15 rows selected.

SQL>






.



O Dear Lord, You are the Creator and the Cause. If it is Your Will, please save and protect me; please bless me with the lifestyle of the Lord's Name.

Configure Goldengate Replication with Datapump (Post 20 of series, Configure Oracle Goldengate Replication with Datapump on Linux)

As long as the soul-companion is with the body, it dwells in happiness. But when the companion arises and departs, then the body-bride mingles with dust.


Index of all the posts of Gurpartap Singh's Blog



Lets create table results and create the data for it in source as:

create table results (
deed_id number,
deed varchar2(60),
deed_result varchar2(100)
);

CREATE UNIQUE INDEX results_ix ON results(deed_id);

insert into results values (1,'Before Death was thinking of Money','Becomes snake in next incarnations');
insert into results values (2,'Before Death was thinking on Property','Becomes goblin in next incarnations');
insert into results values (3,'Before death was thinking of kids','Becomes pig in next incarnations');
insert into results values (4,'Before death was thinking of women','Becomes prostitute in next incarnations');
commit;



Output is as:

SQL>
SQL> show user
USER is "MEDITATE"
SQL> create table results (
deed_id number,
deed varchar2(60),
deed_result varchar2(100)
);
2 3 4 5

Table created.

SQL> CREATE UNIQUE INDEX results_ix ON results(deed_id);

Index created.

SQL>
SQL> insert into results values (1,'Before Death was thinking of Money','Becomes snake in next incarnations');

1 row created.

SQL> insert into results values (2,'Before Death was thinking on Property','Becomes goblin in next incarnations');
insert into results values (3,'Before death was thinking of kids','Becomes pig in next incarnations');
insert into results values (4,'Before death was thinking of women','Becomes prostitute in next incarnations');

1 row created.

SQL>
1 row created.

SQL>
1 row created.

SQL>
SQL> commit;

Commit complete.

SQL>

--------------------------------------------------------------------------------------------


The datapump for goldengate is different than from expdp. This is the secondary extract group that is created on the
source system. This is the optional group but is very useful to beat network failures. When its not configured
extract process writes to a remote trail that is located on the target system using TCP/IP.
But when we have it configured the extract process writes to a local trail and from here Data Pump will read the
trail and write the data over the network to the remote trail located on the target system. It will also be useful
when we are consolidating data from several sources into one central target where data pump on each individual source
system can write to one common trail file on the target.


Now lets create the Extract process

ADD EXTRACT etruth, TRANLOG, BEGIN NOW, threads 3


Create a local trail

Using the ADD EXTRAIL command we will now create a local trail on the source system where the Extract process
will write to and which is then read by the Data Pump process. We will link this local trail to the Primary Extract
group we just created, etruth

ADD EXTTRAIL /u01/app/oracle/product/goldengate/dirdat/tr, EXTRACT etruth


Now, lets create the parameter file for the primary extract group i.e. etruth

EDIT PARAMS etruth

EXTRACT etruth
USERID goldengate, PASSWORD AACAAAAAAAAAAAKAPATACEHBIGQGCFZCCDIGAEMCQFFBZHVC, ENCRYPTKEY default
TRANLOGOPTIONS ASMUSER sys@RAC1ASM, ASMPASSWORD AACAAAAAAAAAAAJASAOBIHRGNFGAYCKBHJPAGIXFGGBJUAXI, ENCRYPTKEY default
EXTTRAIL /u01/app/oracle/product/goldengate/dirdat/tr
TABLE meditate.results;


Output is as:


GGSCI (rac1.rac.meditate.com) 14> ADD EXTRACT etruth, TRANLOG, BEGIN NOW, threads 3
EXTRACT added.


GGSCI (rac1.rac.meditate.com) 15> ADD EXTTRAIL /u01/app/oracle/product/goldengate/dirdat/tr, EXTRACT etruth
EXTTRAIL added.


GGSCI (rac1.rac.meditate.com) 16> EDIT PARAMS etruth

EXTRACT etruth
USERID goldengate, PASSWORD AACAAAAAAAAAAAKAPATACEHBIGQGCFZCCDIGAEMCQFFBZHVC, ENCRYPTKEY default
TRANLOGOPTIONS ASMUSER sys@RAC1ASM, ASMPASSWORD AACAAAAAAAAAAAJASAOBIHRGNFGAYCKBHJPAGIXFGGBJUAXI, ENCRYPTKEY default
EXTTRAIL /u01/app/oracle/product/goldengate/dirdat/tr
TABLE meditate.results;


Output from log is:

2010-11-09 22:03:24 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): ADD EXTRACT etruth TRANLOG, BEGIN NOW,threads 3.
2010-11-09 22:03:50 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): ADD EXTTRAIL /u01/app/oracle/product/goldengate/dirdat/tr EXTRACT etruth.
2010-11-09 22:05:03 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): EDIT PARAMS etruth.



--------------------------------------------------------------------------------------

Specify the location of the remote trail on the target system

Use the RMTTRAIL to specify the location of the remote trail and associate the same with the Data Pump group as it will
be wriiten to over the network by the data pump process

ADD EXTRACT ptruth, EXTTRAILSOURCE /u01/app/oracle/product/goldengate/dirdat/tr

ADD RMTTRAIL /u01/app/oracle/product/goldengate/dirdat/tr, EXTRACT ptruth


Create the parameter file for the Data Pump group

Note- the parameter PASSTHRU signifies the mode being used for the Data Pump which means that the names of
the source and target objects are identical and no column mapping or filtering is being performed here.

EDIT PARAMS ptruth

EXTRACT ptruth
RMTHOST goldengate, MGRPORT 7909
RMTTRAIL /u01/app/oracle/product/goldengate/dirdat/tr
PASSTHRU
TABLE meditate.results;




Output is as:
GGSCI (rac1.rac.meditate.com) 19> ADD EXTRACT ptruth, EXTTRAILSOURCE /u01/app/oracle/product/goldengate/dirdat/tr
EXTRACT added.


GGSCI (rac1.rac.meditate.com) 20> ADD RMTTRAIL /u01/app/oracle/product/goldengate/dirdat/tr, EXTRACT ptruth
RMTTRAIL added.


GGSCI (rac1.rac.meditate.com) 21> EDIT PARAMS ptruth


EXTRACT ptruth
RMTHOST goldengate, MGRPORT 7909
RMTTRAIL /u01/app/oracle/product/goldengate/dirdat/tr
PASSTHRU
TABLE meditate.results;




From logs its:
2010-11-09 22:23:26 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): ADD EXTRACT ptruth EXTTRAILSOURCE /u01/app/oracle/product/goldengate/dirdat/tr.
2010-11-09 22:23:38 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): ADD RMTTRAIL /u01/app/oracle/product/goldengate/dirdat/tr EXTRACT ptruth.
2010-11-09 22:23:50 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): EDIT PARAMS ptruth.



----------------------------------------------------------------------------------------

Now lets start extracts etruth and ptruth


GGSCI (rac1.rac.meditate.com) 29> info all

Program Status Group Lag Time Since Chkpt

MANAGER RUNNING
EXTRACT RUNNING ELORD1 00:00:00 00:00:03
EXTRACT STOPPED ETRUTH 00:00:01 00:01:08
EXTRACT STOPPED PTRUTH 00:00:00 00:08:21


GGSCI (rac1.rac.meditate.com) 30> start extract ETRUTH

Sending START request to MANAGER ...
EXTRACT ETRUTH starting


GGSCI (rac1.rac.meditate.com) 31> info extract ETRUTH, detail

EXTRACT ETRUTH Last Started 2010-11-09 22:33 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:00:09 ago)
Log Read Checkpoint Oracle Redo Logs
2010-11-09 22:33:39 Thread 1, Seqno 17, RBA 36973568
Log Read Checkpoint Oracle Redo Logs
2010-11-09 22:33:40 Thread 2, Seqno 18, RBA 1101312
Log Read Checkpoint Oracle Redo Logs
2010-11-09 22:33:40 Thread 3, Seqno 14, RBA 34875904

Target Extract Trails:

Remote Trail Name Seqno RBA Max MB

/u01/app/oracle/product/goldengate/dirdat/tr 0 1010 10

Extract Source Begin End

+RECV1/simar/onlinelog/group_6.260.734045033 2010-11-09 22:30 2010-11-09 22:33
Not Available * Initialized * 2010-11-09 22:30


Current directory /u01/app/oracle/product/goldengate

Report file /u01/app/oracle/product/goldengate/dirrpt/ETRUTH.rpt
Parameter file /u01/app/oracle/product/goldengate/dirprm/etruth.prm
Checkpoint file /u01/app/oracle/product/goldengate/dirchk/ETRUTH.cpe
Process file /u01/app/oracle/product/goldengate/dirpcs/ETRUTH.pce
Stdout file /u01/app/oracle/product/goldengate/dirout/ETRUTH.out
Error log /u01/app/oracle/product/goldengate/ggserr.log


GGSCI (rac1.rac.meditate.com) 32> info all

Program Status Group Lag Time Since Chkpt

MANAGER RUNNING
EXTRACT RUNNING ELORD1 00:00:00 00:00:04
EXTRACT RUNNING ETRUTH 00:00:00 00:00:09
EXTRACT STOPPED PTRUTH 00:00:00 00:12:29


GGSCI (rac1.rac.meditate.com) 33> start extract PTRUTH

Sending START request to MANAGER ...
EXTRACT PTRUTH starting


GGSCI (rac1.rac.meditate.com) 34> info all

Program Status Group Lag Time Since Chkpt

MANAGER RUNNING
EXTRACT RUNNING ELORD1 00:00:00 00:00:01
EXTRACT RUNNING ETRUTH 00:00:00 00:00:08
EXTRACT RUNNING PTRUTH 00:00:00 00:00:09


GGSCI (rac1.rac.meditate.com) 35>










In logs you will see:

2010-11-09 22:32:05 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): start extract ETRUTH.
2010-11-09 22:32:05 GGS INFO 301 Oracle GoldenGate Manager for Oracle, mgr.prm: Command received from GGSCI on host 192.168.1.176 (START EXTRACT ETRUTH ).
2010-11-09 22:32:05 GGS INFO 302 Oracle GoldenGate Manager for Oracle, mgr.prm: EXTRACT ETRUTH starting.
2010-11-09 22:32:05 GGS INFO 310 Oracle GoldenGate Capture for Oracle, etruth.prm: EXTRACT ETRUTH starting.
2010-11-09 22:33:08 GGS INFO Z0-016 Oracle GoldenGate Capture for Oracle, etruth.prm: Default thread stack size: 33554432.
2010-11-09 22:33:20 GGS INFO 310 Oracle GoldenGate Capture for Oracle, etruth.prm: EXTRACT ETRUTH started.
2010-11-09 22:33:20 GGS INFO 112 Oracle GoldenGate Capture for Oracle, etruth.prm: No recovery is required for target file /u01/app/oracle/product/goldengate/dirdat/tr000000, at RBA 0 (file not opened).
2010-11-09 22:33:20 GGS INFO Z0-05M Oracle GoldenGate Capture for Oracle, etruth.prm: Output file /u01/app/oracle/product/goldengate/dirdat/tr is using format RELEASE 10.4.
2010-11-09 22:36:08 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): start extract PTRUTH.
2010-11-09 22:36:08 GGS INFO 301 Oracle GoldenGate Manager for Oracle, mgr.prm: Command received from GGSCI on host 192.168.1.176 (START EXTRACT PTRUTH ).
2010-11-09 22:36:08 GGS INFO 302 Oracle GoldenGate Manager for Oracle, mgr.prm: EXTRACT PTRUTH starting.
2010-11-09 22:36:08 GGS INFO 310 Oracle GoldenGate Capture for Oracle, ptruth.prm: EXTRACT PTRUTH starting.
2010-11-09 22:36:08 GGS INFO 310 Oracle GoldenGate Capture for Oracle, ptruth.prm: EXTRACT PTRUTH started.
2010-11-09 22:36:13 GGS INFO 406 Oracle GoldenGate Capture for Oracle, ptruth.prm: Socket buffer size set to 27985 (flush size 27985).
2010-11-09 22:36:26 GGS INFO 112 Oracle GoldenGate Capture for Oracle, ptruth.prm: No recovery is required for target file /u01/app/oracle/product/goldengate/dirdat/tr000000, at RBA 0 (file not opened).
2010-11-09 22:36:26 GGS INFO Z0-05M Oracle GoldenGate Capture for Oracle, ptruth.prm: Output file /u01/app/oracle/product/goldengate/dirdat/tr is using format RELEASE 10.4.

---------------------------------------------------------------------------------------

Now we will create the replicat on the target side.

First I will create the table in the schema and instead of doing initial load I will copy the data as we did on the source as:


SQL> show user
USER is "CONSCIOUSNESS"
SQL> create table results (
deed_id number,
deed varchar2(60),
deed_result varchar2(100)
);
2 3 4 5
Table created.

SQL>
SQL> CREATE UNIQUE INDEX results_ix ON results(deed_id);

Index created.

SQL> insert into results values (1,'Before Death was thinking of Money','Becomes snake in next incarnations');
insert into results values (2,'Before Death was thinking on Property','Becomes goblin in next incarnations');
insert into results values (3,'Before death was thinking of kids','Becomes pig in next incarnations');
insert into results values (4,'Before death was thinking of women','Becomes prostitute in next incarnations');

1 row created.

SQL>
1 row created.

SQL>
1 row created.

SQL>
1 row created.

SQL> commit;

Commit complete.

SQL> select count(*) from results;

COUNT(*)
----------
4

SQL> set line 300
SQL> select * from results;

DEED_ID DEED DEED_RESULT
---------- ------------------------------------------------------------ ----------------------------------------------------------------------------------------------------
1 Before Death was thinking of Money Becomes snake in next incarnations
2 Before Death was thinking on Property Becomes goblin in next incarnations
3 Before death was thinking of kids Becomes pig in next incarnations
4 Before death was thinking of women Becomes prostitute in next incarnations

SQL>




Create the Replicat group

The EXTTRAIL clause indicates the location of the remote trail and should be the same as the RMTTRAIL value that
was used when creating the Data Pump process on the source system.

ADD REPLICAT rtruth, EXTTRAIL /u01/app/oracle/product/goldengate/dirdat/tr


Create the parameter file for the Replicat group

EDIT PARAMS rtruth

REPLICAT rtruth
ASSUMETARGETDEFS
USERID goldengate, PASSWORD AACAAAAAAAAAAAKAPATACEHBIGQGCFZCCDIGAEMCQFFBZHVC, ENCRYPTKEY default
MAP meditate.results, TARGET CONSCIOUSNESS.results;


Output is as:

GGSCI (goldengate) 26> ADD REPLICAT rtruth, EXTTRAIL /u01/app/oracle/product/goldengate/dirdat/tr
REPLICAT added.


GGSCI (goldengate) 27> EDIT PARAMS rtruth


REPLICAT rtruth
ASSUMETARGETDEFS
USERID goldengate, PASSWORD AACAAAAAAAAAAAKAPATACEHBIGQGCFZCCDIGAEMCQFFBZHVC, ENCRYPTKEY default
MAP meditate.results, TARGET CONSCIOUSNESS.results;




In logs you will see:

2010-11-09 22:14:39 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): ADD REPLICAT rtruth EXTTRAIL /u01/app/oracle/product/goldengate/dirdat/tr.
2010-11-09 22:15:03 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): EDIT PARAMS rtruth.



---------------------------------------------------------

Here are the details:


GGSCI (rac1.rac.meditate.com) 36> info extract ETRUTH

EXTRACT ETRUTH Last Started 2010-11-09 22:33 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:00:04 ago)
Log Read Checkpoint Oracle Redo Logs
2010-11-09 22:48:19 Thread 1, Seqno 17, RBA 37490688
Log Read Checkpoint Oracle Redo Logs
2010-11-09 22:48:20 Thread 2, Seqno 18, RBA 1619456
Log Read Checkpoint Oracle Redo Logs
2010-11-09 22:48:21 Thread 3, Seqno 14, RBA 35416576


GGSCI (rac1.rac.meditate.com) 37> info extract PTRUTH

EXTRACT PTRUTH Last Started 2010-11-09 22:36 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:00:03 ago)
Log Read Checkpoint File /u01/app/oracle/product/goldengate/dirdat/tr000000
First Record RBA 1010


GGSCI (rac1.rac.meditate.com) 38>





Now lets start the replicat on the target as:

GGSCI (goldengate) 28> info all

Program Status Group Lag Time Since Chkpt

MANAGER RUNNING
REPLICAT RUNNING RLORD1 00:00:00 00:00:09
REPLICAT STOPPED RTRUTH 00:00:00 00:04:04


GGSCI (goldengate) 29> start replicat RTRUTH

Sending START request to MANAGER ...
REPLICAT RTRUTH starting


GGSCI (goldengate) 31> status replicat RTRUTH
REPLICAT RTRUTH: RUNNING


GGSCI (goldengate) 32>



In logs you will see:

2010-11-09 22:19:58 GGS INFO 399 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): start replicat RTRUTH.
2010-11-09 22:19:58 GGS INFO 301 Oracle GoldenGate Manager for Oracle, mgr.prm: Command received from GGSCI on host 192.168.1.169 (START REPLICAT RTRUTH ).
2010-11-09 22:19:58 GGS INFO 302 Oracle GoldenGate Manager for Oracle, mgr.prm: REPLICAT RTRUTH starting.
2010-11-09 22:19:58 GGS INFO 320 Oracle GoldenGate Delivery for Oracle, rtruth.prm: REPLICAT RTRUTH starting.
2010-11-09 22:19:59 GGS INFO 320 Oracle GoldenGate Delivery for Oracle, rtruth.prm: REPLICAT RTRUTH started.

-------------------------------------------


Now lets test the replication:

insert into results values (5,'Before death was thinking of LORD','Liberated');

Ok, on source we have:

SQL> select count(*) from results;

COUNT(*)
----------
4

SQL> select * from results;

DEED_ID DEED DEED_RESULT
---------- ------------------------------------------------------------ ---------------------------------------------------------------------------------------------------
1 Before Death was thinking of Money Becomes snake in next incarnations
2 Before Death was thinking on Property Becomes goblin in next incarnations
3 Before death was thinking of kids Becomes pig in next incarnations
4 Before death was thinking of women Becomes prostitute in next incarnations

SQL>


Lets do the insert:

SQL> insert into results values (5,'Before death was thinking of LORD','Liberated');

1 row created.

SQL> commit;

Commit complete.

SQL> select * from results;

DEED_ID DEED DEED_RESULT
---------- ------------------------------------------------------------ ---------------------------------------------------------------------------------------------------
1 Before Death was thinking of Money Becomes snake in next incarnations
2 Before Death was thinking on Property Becomes goblin in next incarnations
3 Before death was thinking of kids Becomes pig in next incarnations
4 Before death was thinking of women Becomes prostitute in next incarnations
5 Before death was thinking of LORD Liberated

SQL> select count(*) from results;

COUNT(*)
----------
5

SQL> !date
Tue Nov 9 23:16:02 PST 2010

SQL>




On target we have:

SQL> select count(*) from results;

COUNT(*)
----------
5

SQL> select * from results;

DEED_ID DEED DEED_RESULT
---------- ------------------------------------------------------------ ----------------------------------------------------------------------------------------------------
1 Before Death was thinking of Money Becomes snake in next incarnations
2 Before Death was thinking on Property Becomes goblin in next incarnations
3 Before death was thinking of kids Becomes pig in next incarnations
4 Before death was thinking of women Becomes prostitute in next incarnations
5 Before death was thinking of LORD Liberated

SQL>



True is the Creator, True is the Doer. True is our Lord and Master, and True is His Support. So speak the Truest of the True. Through the True One, an intuitive and discerning mind is obtained.