Friday, October 25, 2013

Golden Gate setup SunOS to Linux..

Source
GGSCI (puertorico) 6> versions
Operating System:
SunOS
Version Generic_139555-08, Release 5.10
Node: puertorico
Machine: sun4u

Database:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
PL/SQL Release 11.1.0.7.0 - Production
CORE    11.1.0.7.0      Production
TNS for Solaris: Version 11.1.0.7.0 - Production
NLSRTL Version 11.1.0.7.0 - Production

Target

GGSCI (tlv-d109) 6> versions
Operating System:
Linux
Version #1 SMP Fri Dec 14 05:25:59 EST 2012, Release 2.6.18-348.1.1.el5
Node: tlv-d109.dixons.co.uk
Machine: x86_64

Database:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bi
PL/SQL Release 10.2.0.2.0 - Production
CORE    10.2.0.2.0      Production
TNS for Linux: Version 10.2.0.2.0 - Production
NLSRTL Version 10.2.0.2.0 - Production

########################################################################################################

SQL> create tablespace ggs_data
  2  datafile '/rman/dupitdb/oradata/ORACLE/11g106/oradata/GALAXY/ggs_data.dbf' size 200m;

Tablespace created.

SQL> create user ggs_owner identified by ggs_owner

    default tablespace ggs_data
  2  SQL> SP2-0734: unknown command beginning "default ta..." - rest of line ignored.
SQL>  create user ggs_owner identified by ggs_owner
  2  default tablespace ggs_data;

User created.

SQL> grant connect, resource to ggs_owner;

      grant select any dictionary, select any table to ggs_owner;

      grant create table to ggs_owner;

      grant flashback any table to ggs_owner;

      grant execute on dbms_flashback to ggs_owner;

      grant execute on utl_file to ggs_owner;

      grant create any table to ggs_owner;

      grant insert any table to ggs_owner;


Grant succeeded.

SQL> SQL>       grant update any table to ggs_owner;

      grant delete any table to ggs_owner;

      grant drop any table to ggs_owner;

Grant succeeded.

SQL> SQL>
Grant succeeded.

SQL> SQL>
Grant succeeded.

SQL> SQL>
Grant succeeded.

SQL> SQL>

Grant succeeded.

SQL> SQL>
Grant succeeded.

SQL> SQL>

Grant succeeded.

SQL> SQL>
Grant succeeded.

SQL> SQL>


Grant succeeded.

SQL> SQL>
Grant succeeded.

alter database open;

 Enable minimal supplemental logging:

 SQL> alter database add supplemental log data;

 Prepare the database to support ddl replication.

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

 n  bounce the database

puertorico $ sqlplus / as sysdba

SQL*Plus: Release 11.1.0.7.0 - Production on Fri Oct 11 15:19:06 2013

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


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

SQL> marker_setup.sql
SP2-0734: unknown command beginning "marker_set..." - rest of line ignored.
SQL> @marker_setup.sql

Marker setup script

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

Enter Oracle GoldenGate schema name:GGS_OWNER


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

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

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

Script complete.
SQL> @ddl_setup.sql

Oracle 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 Oracle GoldenGate database objects.
NOTE: For an Oracle 10g source, the system recycle bin must be disabled. For Oracle 11g and later, it can be enabled.
NOTE: The schema must be created prior to running this script.
NOTE: Stop all DDL replication before starting this installation.

Enter Oracle GoldenGate schema name:GGS_OWNER

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

Checking for sessions that are holding locks on Oracle Golden Gate metadata tables ...

Check complete.







Using GGS_OWNER as a Oracle GoldenGate schema name.

Working, please wait ...

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

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 IGNORE TABLE
-----------------------------------
OK

DDL IGNORE LOG TABLE
-----------------------------------
OK

DDLAUX  PACKAGE STATUS:

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

DDLAUX PACKAGE BODY STATUS:

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

SYS.DDLCTXINFO  PACKAGE STATUS:

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

SYS.DDLCTXINFO  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
------------------------------------------------------------------------------------------------------------------------
/rman/dupitdb/oradata/ORACLE/11g106/diag/rdbms/galaxy/GALAXY/trace/ggs_ddl_trace.log

Analyzing installation status...


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

Script complete.
SQL> @role_setup.sql

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:GGS_OWNER
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 <loggedUser>

where <loggedUser> is the user assigned to the GoldenGate processes.
SQL> grant ggs_ggsuser_role to ggs_owner;

Grant succeeded.

SQL> @ddl_enable

Trigger altered.

SQL> @ddl_pin GGS_OWNER

PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.

/rman/dupitdb/oradata/ORACLE/11g106/diag/rdbms/galaxy/GALAXY/trace/ggs_ddl_trace.log
DBLOGIN USERID ggs_owner, PASSWORD ggs_owner

edit params mgr

Create MGR on source and Target
GGSCI (puertorico) 6> view params mgr

PORT 7809
USERID ggs_owner, PASSWORD ggs_owner
PURGEOLDEXTRACTS /rman/dupitdb/oradata/GOLDENGATE/dirdat/ext, USECHECKPOINTS

 $ more mgr.prm
 PORT 7809
USERID ggs_owner, PASSWORD ggs_owner
PURGEOLDEXTRACTS /rman/dupitdb/oradata/GOLDENGATE/dirdat/ext, USECHECKPOINTS


GGSCI (puertorico) 7> add trandata scott.DEPT
ERROR: Not logged into database, use DBLOGIN.

GGSCI (puertorico) 8> DBLOGIN USERID ggs_owner, PASSWORD ggs_owner;
Successfully logged into database.

GGSCI (puertorico) 9>  info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING


GGSCI (puertorico) 10>  add trandata scott.DEPT

Logging of supplemental redo data enabled for table SCOTT.DEPT.

SQL> ALTER TABLE SCOTT.EMP ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;

Table altered.

SQL> ALTER TABLE SCOTT.SALGRADE  ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;

Table altered.

SQL>  ALTER TABLE SCOTT.BONUS  ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;

Table altered.


add trandata SCOTT.SALGRADE;
add trandata SCOTT.EMP;
add trandata SCOTT.BONUS;

GGSCI (puertorico) 4> info trandata scott.*

Logging of supplemental redo log data is enabled for table SCOTT.BONUS.

Columns supplementally logged for table SCOTT.BONUS: ALL.

Logging of supplemental redo log data is enabled for table SCOTT.DEPT.

Columns supplementally logged for table SCOTT.DEPT: DEPTNO.

Logging of supplemental redo log data is enabled for table SCOTT.EMP.

Columns supplementally logged for table SCOTT.EMP: ALL.

Logging of supplemental redo log data is enabled for table SCOTT.SALGRADE.

Columns supplementally logged for table SCOTT.SALGRADE: ALL.



 Create the extract group NEED TO BE CARRIED OUT AT SOURCE
 GGSCI (puertorico) 7> add extract ext1, tranlog, begin now
EXTRACT added.

 Oracle GoldenGate Capture for Oracle, ext1.prm:
 The trail '/pda/prod/orasoft/Golden_gate/dirdat/lt' is not assigned to extract 'EXT1'. Assign the trail to the extract with the command "ADD EXTTRAIL/RMTTRAIL /pda/prod/orasoft/Golden_gate/dirdat/lt, EXTRACT EXT1".


GGSCI (puertorico) 8> add exttrail /pda/prod/orasoft/Golden_gate/dirdat/lt, extract ext1
EXTTRAIL added.


edit params ext1
extract ext1
userid ggs_owner password ggs_owner
rmthost 172.16.74.177, mgrport 7809, TCPBUFSIZE 100000
rmttrail /pda/prod/orasoft/Golden_gate/dirdat/lt  ---- -- Remote location
DDL INCLUDE MAPPED OBJNAME SCOTT.*
table SCOTT.*;
:wq

CREATE CHECKPOINT TABLE NEED TO BE CARRIED OUT AT TARGET
oracle@tlv-d109 Golden_gate]$ ./ggsci

Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Apr 23 2012 08:32:14

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

GGSCI (DBTARGET) 1> edit params ./GLOBAL
 GGSCHEMA ggs_owner
 CHECKPOINTTABLE ggs_owner.checkpoint

Golden_gate]$ more GLOBAL
GGSCHEMA ggs_owner
CHECKPOINTTABLE ggs_owner.checkpoint

GGSCI (tlv-d109) 6> dblogin userid ggs_owner password  ggs_owner
Successfully logged into database.

GGSCI (tlv-d109) 7> add checkpointtable ggs_owner.checkpoint

Successfully created checkpoint table ggs_owner.checkpoint.



GGSCI (tlv-d109.) 5> info checkpointtable ggs_owner.checkpoint

Checkpoint table ggs_owner.checkpoint created 2013-10-11 16:46:17.

CREATE REPLICAT NEED TO BE CARRIED OUT AT TARGET

4> EDIT PARAMS rep2

OR
GGSCI (tlv-d109) 17> view params REP2

REPLICAT REP2
userid ggs_owner, password ggs_owner
ASSUMETARGETDEFS
DDLERROR DEFAULT IGNORE
MAP SCOTT.*,       TARGET SCOTT.*;



add replicat REP2, exttrail /pda/prod/orasoft/Golden_gate/dirdat/lt checkpointtable ggs_owner.checkpoint


SOURCE

 $ ./ggsci

Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO
Solaris, sparc, 64bit (optimized), Oracle 10g on Apr 24 2012 09:06:57

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



GGSCI (puertorico) 1> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
EXTRACT     RUNNING     EXT1        00:00:00      00:00:08



Target

Golden_gate]$ ./ggsci

Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Apr 23 2012 08:32:14

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



GGSCI (tlv-d109) 1> info all
start mgr
start REP2

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
REPLICAT    STOPPED     REP1        00:00:00      02:46:58
REPLICAT    RUNNING     REP2        00:00:00      00:00:09

##################################################################################################

Reverse from target to Source

Schema level Golden Gate

S)


 ADD SCHEMATRANDATA SCOTT;

 ALTER TABLE HIMTEST.EMP drop SUPPLEMENTAL LOG DATA (ALL) COLUMNS;

add extract ext1_RVC, tranlog, begin now

 add exttrail /rman/dupitdb/oradata/GOLDENGATE/dirdat/lt, extract ext1_RVC

 edit params ext1_RVC
extract ext1_RVC
userid ggs_owner password ggs_owner
rmthost 172.27.4.247, mgrport 7809, TCPBUFSIZE 100000
rmttrail /rman/dupitdb/oradata/GOLDENGATE/dirdat/lt
DDL INCLUDE MAPPED OBJNAME SCOTT.*
table SCOTT.*;

8> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
EXTRACT     STOPPED     EXT1_RVC    00:00:00      00:00:10
REPLICAT    STOPPED     REP1        00:00:00      04:26:37
REPLICAT    RUNNING     REP2        00:00:00      00:00:04



Target
 edit params ./GLOBAL
 GGSCHEMA ggs_owner
 CHECKPOINTTABLE ggs_owner.checkpoint
add checkpointtable ggs_owner.checkpoint




edit params REP2_RVC

REPLICAT REP2_RVC
userid ggs_owner, password ggs_owner
ASSUMETARGETDEFS
DDLERROR DEFAULT IGNORE
MAP SCOTT.*,       TARGET SCOTT.*;

DISCARDFILE /rman/dupitdb/oradata/GOLDENGATE/dirdat/REP2_RVC1.dsc, append, megabytes 10

add replicat REP2_RVC, exttrail /rman/dupitdb/oradata/GOLDENGATE/dirdat/lt checkpointtable ggs_owner.checkpoint


GGSCI (tlv-d109.) 9> start EXT1_RVC

Sending START request to MANAGER ...
EXTRACT EXT1_RVC starting


GGSCI (tlv-d109.) 10> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
EXTRACT     STOPPED     EXT1_RVC    00:00:00      00:04:13
REPLICAT    STOPPED     REP1        00:00:00      04:30:39
REPLICAT    RUNNING     REP2        00:00:00      00:00:01


GGSCI (tlv-d109.) 11> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
EXTRACT     RUNNING     EXT1_RVC    00:00:00      00:00:08
REPLICAT    STOPPED     REP1        00:00:00      04:31:23
REPLICAT    RUNNING     REP2        00:00:00      00:00:04

GGSCI (puertorico) 37> start REP2_RVC

Sending START request to MANAGER ...
REPLICAT REP2_RVC starting


GGSCI (puertorico) 38> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
EXTRACT     RUNNING     EXT1        00:00:00      00:00:08
REPLICAT    RUNNING     REP2_RVC    00:00:00      00:01:39




info extract EXT1, detail


Cleaning --------------

dblogin userid ggs_owner password  ggs_owner
stop *
KILL replicat rep*
delete replicat r*!
delete checkpointtable ggs_owner.checkpoint
KILL extract ext_*
delete extract ext_*!
KILL extract pmp_*
delete extract pmp_*!
pause 10
stop mgr!

No comments:

Post a Comment