At the initial stage, create two databases. And edit the hostnames as given below. Make sure tnsping is working from source to target. And here, My source is extract database & target is replicat database. Not only tnsping, ordinary ping also should work.
Source –> Extract –> extract.in –> All these will be in this color
Target –> Replicat –> Replicat.in –> All these will be in blue color
[oracle@extract golden]$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.2.133 extract.in extract
192.168.2.135 replicat.in replicat
[oracle@replicat golden]$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.2.133 extract.in extract
192.168.2.135 replicat.in replicat
[oracle@extract golden]$ ./ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO
Linux, x86, 32bit (optimized), Oracle 11g on Apr 23 2012 08:09:25
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
GGSCI (extract.in) 1> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER STOPPED
GGSCI (extract.in) 2> create subdirs
Creating subdirectories under current directory /u02/golden
Parameter files /u02/golden/dirprm: already exists
Report files /u02/golden/dirrpt: created
Checkpoint files /u02/golden/dirchk: created
Process status files /u02/golden/dirpcs: created
SQL script files /u02/golden/dirsql: created
Database definitions files /u02/golden/dirdef: created
Extract data files /u02/golden/dirdat: created
Temporary files /u02/golden/dirtmp: created
Stdout files /u02/golden/dirout: created
GGSCI (extract.in) 5> create subdirs /dir1/dir2
Creating subdirectories under current directory /u02/golden/dirdat
Parameter files /u02/golden/dirdat/dirprm: created
Report files /u02/golden/dirdat/dirrpt: created
Checkpoint files /u02/golden/dirdat/dirchk: created
Process status files /u02/golden/dirdat/dirpcs: created
SQL script files /u02/golden/dirdat/dirsql: created
Database definitions files /u02/golden/dirdat/dirdef: created
Extract data files /u02/golden/dirdat/dirdat: created
Temporary files /u02/golden/dirdat/dirtmp: created
Stdout files /u02/golden/dirdat/dirout: created
In replicat now:
****************************************
GGSCI (replicat.in) 1> create subdirs
Creating subdirectories under current directory /u02/golden
Parameter files /u02/golden/dirprm: already exists
Report files /u02/golden/dirrpt: created
Checkpoint files /u02/golden/dirchk: created
Process status files /u02/golden/dirpcs: created
SQL script files /u02/golden/dirsql: created
Database definitions files /u02/golden/dirdef: created
Extract data files /u02/golden/dirdat: created
Temporary files /u02/golden/dirtmp: created
Stdout files /u02/golden/dirout: created
GGSCI (replicat.in) 2> exit
[oracle@replicat golden]$ ./ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO
Linux, x86, 32bit (optimized), Oracle 11g on Apr 23 2012 08:09:25
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
GGSCI (replicat.in) 1> cd /u02/golden/dirdat
GGSCI (replicat.in) 2> create subdirs /dir1/dir2/dir3
Creating subdirectories under current directory /u02/golden/dirdat
Parameter files /u02/golden/dirdat/dirprm: created
Report files /u02/golden/dirdat/dirrpt: created
Checkpoint files /u02/golden/dirdat/dirchk: created
Process status files /u02/golden/dirdat/dirpcs: created
SQL script files /u02/golden/dirdat/dirsql: created
Database definitions files /u02/golden/dirdat/dirdef: created
Extract data files /u02/golden/dirdat/dirdat: created
Temporary files /u02/golden/dirdat/dirtmp: created
Stdout files /u02/golden/dirdat/dirout: created
SQL> Select supplemental_log_data_min, supplemental_log_data_pk, supplemental_log_data_ui from v$database;
SUPPLEME SUP SUP
——– — —
NO NO NO
SQL> alter database add supplemental log data(primary key, unique, foreign key) columns;
Database altered.
SQL> Select supplemental_log_data_min, supplemental_log_data_pk, supplemental_log_data_ui from v$database;
SUPPLEME SUP SUP
——– — —
IMPLICIT YES YES
SQL> alter system set recyclebin=off scope=spfile sid=’*’;
System altered.
SQL> Create tablespace GOLDEN_GATE datafile ‘/u02/oradata/extract/data/goldengate.dbf’ size 100M;
SQL> Create user gg identified by gg Default tablespace GOLDEN_GATE Temporary tablespace temp Profile default Account unlock Quota unlimited on GOLDEN_GATE;
SQL> Grant connect, resource to gg;
Grant create session to gg;
Grant alter session to gg;
Grant select any dictionary to gg;
Grant flashback any table to gg;
Grant select any table to gg;
Grant create table to gg;
Grant execute on dbms_flashback to gg;
Grant execute on utl_file to gg;
Grant dba to gg;
Create user CHECKGG identified by checkgg Default tablespace USERS Temporary tablespace temp Profile default Account unlock Quota unlimited on USERS;
Grant connect, resource to checkgg;
Create table dept (Dname number (3)Primary Key, Location varchar2(50));
Insert into dept values (10, ‘Visakhapatnam’);
Insert into dept values (20, ‘Vizianagaram’);
Insert into dept values (30, ‘Tirupathi’);
Insert into dept values (40, ‘Nellore’);
Commit;
***************************************************************************
extract DB replicat DB
Manager Name – MGR Manager Name – MGR
Extract Name – EXTRA Replicat Name – REPLICA
Datapump Name – DPNAME ******************************************************************************
./ggsci
dblogin userid gg, password gg
edit params ./GLOBALS
save below & exit(This will open in vi editor)
GGSCHEMA gg
CHECKPOINTTABLE GG.CHKPTAB
dblogin userid gg, password gg
add checkpointtable gg.chkptab
dblogin userid gg, password gg
add trandata checkgg.dept
edit params mgr
PORT 7809
USERID gg, PASSWORD gg
–AUTOSTART EXTRACT EXTRACTNAME
–AUTOSTART EXTRACT DPNAME
:wq –> Save & exit.
start manager
info all
mkdir -p /u02/golden/dirdat/dir1/dir2
add extract EXTRA, TRANLOG, BEGIN NOW
add exttrail /u02/golden/dirdat/dir1/dir2, EXTRACT extra, MEGABYTES 10
edit params EXTRA
*****************************************************
EXTRACT EXTRA
USERID gg, PASSWORD gg
exttrail /u02/golden/dirdat/dir1/dir2
tranlogoptions dblogreader
tranlogoptions EXCLUDEUSER GG
discardfile ./dirrpt/extractname.dsc, purge, megabytes 100
table checkgg.dept;
*****************************************************
start extract extra
dblogin userid gg, password gg
add extract extra1, exttrailsource /u02/golden/dirdat/dir1/dir2
add rmttrail /u02/golden/dirdat/dir1/dir2, extract extra1
mkdir -p /u02/golden/dirdat/dir1/dir2/dir3
SQL> Create tablespace GOLDEN_GATE datafile ‘/u02/oradata/replicat/data/goldengate.dbf’ size 100M;
SQL> Create tablespace GOLDEN_GATE datafile ‘/u02/oradata/replicat/data/goldengate.dbf’ size 100M;
SQL> Create user gg identified by gg Default tablespace GOLDEN_GATE Temporary tablespace temp Profile default Account unlock Quota unlimited on GOLDEN_GATE;
Grant connect, resource to gg;
Grant create session to gg;
Grant alter session to gg;
Grant select any dictionary to gg;
Grant flashback any table to gg;
Grant select any table to gg;
Grant create table to gg;
Grant execute on dbms_flashback to gg;
Grant execute on utl_file to gg;
Grant dba to gg;
SQL> Create user CHECKGG identified by checkgg Default tablespace USERS Temporary tablespace temp Profile default Account unlock Quota unlimited on USERS;
Grant connect, resource to CHECKGG;
dblogin userid gg, password gg
edit params ./GLOBALS
dblogin userid gg, password gg
add checkpointtable gg.chkptab
add trandata checkgg.dept
edit params mgr
PORT 7809
USERID gg, PASSWORD gg
–AUTOSTART REPLICAT DISCARDPARAMSFILE
add replicat REPLICA, exttrail /u02/golden/dirdat/dir1/dir2, checkpointtable chkptab
edit params REPLICA
REPLICAT REPLICA
USERID gg, PASSWORD g
ASSUMETARGETDEFS
HANDLECOLLISION
REPERROR (DEFAULT, DISCARD)
DISCARDFILE /u02/golden/dirdat/discardparamsfile.dsc, APPEND
GETTRUNCATES
APPLYNOOPUPDATES
MAP CHECKGG.DEPT, TARGET CHECKGG.DEPT;
./ggsci
start replicat replica
SQL> connect checkgg/checkgg
insert into dept values (50,’Raipur’);
insert into dept values (60,’Zaheerabad’);
commit;
SQL> select * from checkgg.dept;
–Checking again
SQL> connect checkgg/checkgg
insert into dept values (70,’Hyderabad’);
insert into dept values (80,’Secunderabad’);
commit;
SQL> select * from checkgg.dept;
Configuration is completed. I have done this as a basic configuration.
Sateesh S
January 23, 2016 at 10:53 pm
Nice Post