This discussion is archived
6 Replies Latest reply: Jan 22, 2013 11:17 PM by AnnamalaiA RSS

OGG simple issue

Chanchal Wankhade Journeyer
Currently Being Moderated
Hi all,
We have oracle 10g On windows.
we are using oracle gg to replicate oracle database 10g r2 to oracle 10g r2 uni-direction on same server (Can we do this?).

We are following the below tasks and using port 7809. But the port is not open(Please suggest optional way);

after performing all the below task its say's
EXTRACT    INITEXT   Initialized   2013-01-21 17:21   Status STOPPED
Checkpoint Lag       Not Available
Log Read Checkpoint  Not Available
                     First Record         Record 0
Task                 SOURCEISTABLE


GGSCI (ITITest) 13> VIEW REPORT INITEXT
ERROR: REPORT file INITEXT does not exist.
Steps are
% sqlplus userid/password
SQLPLUS> @/ggs/demo_ora_create
SQLPLUS> @/ggs/demo_ora_insert
SQLPLUS> exit

on target schema which is in same database :-

% sqlplus userid/password
SQLPLUS> @/ggs/demo_ora_create
SQLPLUS> exit

GGSCI (unixserver1) > EDIT PARAMS MGR
PORT 7809

GGSCI (unixserver1) > EDIT PARAMS INITEXT
--
-- Extract parameter file to capture TCUSTORD
-- and TCUSTMER initial data for Replicat
--
EXTRACT INITEXT
USERID userid, PASSWORD password
RMTHOST unixserver2, MGRPORT 7809
RMTTASK REPLICAT, GROUP INITREP
TABLE schema.TCUSTMER;
TABLE schema.TCUSTORD;



GGSCI (unixserver2) > EDIT PARAMS INITREP
--
-- REPLICAT parameter file to replicate initial changes
-- for TCUSTMER.
--
REPLICAT INITREP
ASSUMETARGETDEFS
DISCARDFILE /ggs/dirrpt/tcustmer.dsc, PURGE
USERID userid, PASSWORD password
MAP schema.*, TARGET schema.*;

GGSCI (unixserver1) > ADD EXTRACT INITEXT, SOURCEISTABLE

GGSCI (unixserver2) > ADD REPLICAT INITREP, SPECIALRUN

GGSCI (unixserver1) > START EXTRACT INITEXT

GGSCI (unixserver1) > INFO EXTRACT INITEXT

GGSCI (unixserver1) > VIEW REPORT INITEXT
Please help us to perform our first replicate activity.
  • 1. Re: OGG simple issue
    AnnamalaiA Journeyer
    Currently Being Moderated
    Hi ,

    You can very much replicat data between two schemas in same server databases.

    for this, better you have to install OGG in two different directories with two different mgr port numbers.

    for example,

    1. i have installed ogg software on F:\OGG_ORA folder for source database and OGG MGR port number for this *7845*

    2. For target , installed on F:\OGG_ORA2 , MGR port for this *7846*

    3. the source DB is SRC , and Target DB is TGT both are running on the same windows machine,

    4. Created user name as ggtest in SRC database as well ggtest on TGT databases ,

    5. created new table name as INIT on both the databases,

    See the steps below,


    On F:\OGG_ORA as source

    GGSCI 1> edit params mgr

    GGSCI ) 2> view params mgr

    PORT 7845


    GGSCI 3> edit params initext

    GGSCI 1> view params initext

    EXTRACT INITEXT
    USERID username@tns, PASSWORD password
    RMTHOST <ip address>, MGRPORT 7845
    RMTTASK REPLICAT, GROUP INITREP
    TABLE ggtest.init;

    GGSCI (DS-7071BCA861C9) 5> ADD EXTRACT INITEXT, SOURCEISTABLE

    EXTRACT added.


    ON F:\OGG_ORA*2* -------------- as target in same server

    GGSCI 4> view params mgr

    PORT 7846

    GGSCI 5> view params initrep

    REPLICAT INITREP
    ASSUMETARGETDEFS
    DISCARDFILE f:\ogg_ora\initrep.dsc, PURGE
    USERID username@tns, PASSWORD password
    MAP ggtest.*, TARGET ggtest.*;


    ON Database SRC :

    SQL> show user

    USER is "GGTEST"

    SQL> create table init(no number , name varchar2(10));


    Table created.

    SQL> conn ggtest
    Connected.
    SQL> begin
    2 for i in 1..100 loop
    3 insert into init values(i,'INIT');
    4 commit;
    5 end loop;
    6 end;
    7 /

    PL/SQL procedure successfully completed.

    SQL> select count(*) from init;

    COUNT(*)
    ----------
    100


    Now on TGT database which is running on same server,


    SQL> show user

    USER is "GGTEST"

    SQL> create table init(no number , name varchar2(10));


    Table created.


    SQL> select count(*) from init;

    COUNT(*)
    ----------
    0

    Now F:\OGG_ORA - Source

    F:\OGG_ORA\> ggsci

    Oracle GoldenGate Command Interpreter for Oracle
    Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230
    Windows (optimized), Oracle 11g on Apr 23 2012 04:52:28

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

    GGSCI 6> start extract initext

    Sending START request to MANAGER ...
    EXTRACT INITEXT starting


    After few minutes check the extract details and status

    GGSCI 8> info extract initext

    EXTRACT INITEXT Last Started 2013-01-22 11:32 Status STOPPED
    Checkpoint Lag Not Available
    Log Read Checkpoint Table GGTEST.INIT
    2013-01-22 11:32:59 Record 100
    Task SOURCEISTABLE


    Now check on the TGT databse

    SQL > conn ggtest@TGT
    Password

    SQL> select name from v$database;

    NAME
    ---------
    TGT


    SQL> select count(*) from init;

    COUNT(*)
    ----------
    100

    Hopefully this will help you to start your replication

    Annamalai.
  • 2. Re: OGG simple issue
    kgronau Guru
    Currently Being Moderated
    You posted a couple of steps like the way you started the extract and replicat process, but what about the manager, did you also start the manager (start mgr)?

    Please post the output of "info all" executed in ggsci.


    And just to make sure, did you add supplemental logging to the Oracle database and what about the SUBDIRS for GG, did you create them as well?

    - Klaus
  • 3. Re: OGG simple issue
    Chanchal Wankhade Journeyer
    Currently Being Moderated
    Hi,

    I am following the steps that you have mention but still not able to extract and replicate the table.

    I have doubt on :-
    I am doint extract and replication on the same server and the ports i am using is not open. Is this may be the issue?
    My database show NO when i select supplemental_log_data_min from database. Is this must be YES for the First time extract?

    Thanks.
  • 4. Re: OGG simple issue
    AnnamalaiA Journeyer
    Currently Being Moderated
    Hi,


    1. YES, The Manager process abends or fails if network ports are blocked by a firewall. You should work with your network or system administrator to ensure that the ports allocated by the Manager process are open and available so that Manager can communicate with both the source and target systems for Oracle GoldenGate.

    2. YES, To extract the committed transactions from the source Oracle database's online redo logs, as a minimum the database must be configured for supplemental
    logging on Primary Key columns. This can be enabled at database level using the following DDL executed as SYSDBA:

    SQL> alter database add supplemental log data;

    Database altered.

    or

    SQL> alter database add supplemental log data (primary key) columns;

    Database altered

    then,

    SQL> alter system switch logfile;

    System altered.

    Hopefully this will help you.

    Annamalai.
  • 5. Re: OGG simple issue
    Chanchal Wankhade Journeyer
    Currently Being Moderated
    Hi,

    Last questions Annamalai,

    What if i dont have internet connection on my PC, and I am specifying port for manager 7809 for both the directories or different port for each directories (7808 and 7809 suppose). Will this work?
    If no How can I Use GG in such a scenario.
  • 6. Re: OGG simple issue
    AnnamalaiA Journeyer
    Currently Being Moderated
    Yes, you can replicate the data between two databases in same server with out network connection.

    Tested the below scenario in my machine,

    1. Stopped both manager and other processes.

    2. disconnected the internet and network cable connection.

    3. started the mgr and other processes without network cable connections,

    4. inserted 100 rows in source database , then checked the below stats in target GGSCI,



    GGSCI 29> stats replicat ora_rep

    Sending STATS request to REPLICAT ORA_REP ...

    Start of Statistics at 2013-01-23 12:35:16.

    Replicating from SRC.ACCOUNTS to TGT.ACCOUNTS:

    *** Total statistics since 2013-01-23 12:34:31 ***
    Total inserts 100.00
    Total updates 0.00
    Total deletes 0.00
    Total discards 0.00
    Total operations 100.00

    *** End of Statistics.

    So its replicated the changed datas in to target database tables. Also make sure the prerequists for GG , like supplemental log data, no firewall restriction for ports, and CREATE SUBDIRS command execution.

    Recommand to refer the GoldenGate admin and installation and setup guides.

    HTH

    Annamalai.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points