Rechercher dans ce blog

lundi 9 mai 2011

Golden Gate :

Mes docs de  references :
Pour l installation  du  soft

On souhaite  répliquer  la table sender.mg  vers le  schéma receiver.mgr  dans la  même base.
 On doit  créer  en plus  un user  ggate .
Si  c  était 2  db  differentes  il faudrait  le  faire des 2  cotes.

Configuration  de  la base:

Reseau :


network identity
Node
IP
defined name
adresse host 1
Aix_rac1
192.168.100.180
aix-rac1
private1
Aix_rac1
172.16.21.180
rac1-priv
adresse vip1

192.168.100.102
rac-vip1
adress host 2
Aix_rac2
192.168.100.181
aix-rac2
private2
Aix_rac2
172.16.21.181
rac2-priv
adresse vip2

192.168.100.103
rac-vip2
scan vip1
gerer par le cluster oracle
192.168.100.204
aix-scan


ASM :


Diskgroup ASM
Raw devices
pp size Mo
taille Go
Redundancy
FG
Data (2 failgroups
2 way mirroring)
raw dev1
160
5
normal
RAC_FG1
raw dev2
160
5
normal

raw dev3
160
5
normal
RAC_FG2
raw dev4
160
5
normal

FRA
raw dev5
128
4
external

CLWARE
raw dev6
25
0,8
normal

raw dev7
25
0,8
normal

raw dev8
25
0,8
normal



Les  archiveslogs  sont   dans la  FRA  le   diskgroup  FRA  pour les  2 threads.

Aspect   oracle


Ajout  d  un   user  ggate  dans  l asm  typique 11g :

Create  user   ggate  identified  by  qwerty ;
Grant  sysdba  to  ggate;

User    oracle  dans la  bd  RACTEST

alter database add supplemental log data;
alter system set recyclebin=off scope=both;

Ggate :
CREATE USER GGATE IDENTIFIED BY VALUES '' DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP;
GRANT CONNECT TO GGATE;
GRANT GGS_GGSUSER_ROLE TO GGATE;
GRANT RESOURCE TO GGATE;
GRANT SELECT ANY DICTIONARY TO GGATE;
GRANT SELECT ANY TABLE TO GGATE;
GRANT UNLIMITED TABLESPACE TO GGATE;
GRANT CREATE ANY DIRECTORY TO GGATE;
GRANT DROP ANY DIRECTORY TO GGATE;
GRANT ALTER SESSION TO GGATE;
grant  select  any dictionary  to  ggate;
grant   update  any  table  to  ggate;
grant  insert  any table  to  ggate;
Sender :
CREATE USER SENDER IDENTIFIED BY VALUES '' DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP;

GRANT CONNECT TO SENDER;
GRANT RESOURCE TO SENDER;

GRANT UNLIMITED TABLESPACE TO SENDER;
Receiver

CREATE USER RECEIVER IDENTIFIED BY VALUES '' DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP;

GRANT CONNECT TO RECEIVER;
GRANT RESOURCE TO RECEIVER;

GRANT UNLIMITED TABLESPACE TO RECEIVER;
grant select on sys.props$ to GGATE;

Les  tables

create  table sender. MG (mg varchar2(10));
create  table receiver. MGR (mg varchar2(10));

TNSNAMES.ora pour l ASM

Pour  pouvoir faire  les  extract   vu  que les archives  sont  sur ASM  il  va   falloir se connecter  via la  couche  sqlnet  a  l asm.
tnsnames.ora  
ASM =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = aix_rac1)(PORT = 1421))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ASM)
      (INSTANCE_NAME = +ASM1)
    )
  )

Aspect golden gate

Installation du  soft  ggate


[aix_rac1:oracle:RACTEST1:/upload/oracle/ggate]
#tar  -xvf  *.tar

[aix_rac1:oracle:RACTEST1:/upload/oracle/ggate]
#./ggsci

Oracle GoldenGate Command Interpreter for Oracle
Version 11.1.1.0.0 Build 078
AIX 5L, ppc, 64bit (optimized), Oracle 11 on Jul 28 2010 15:53:00

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

GGSCI (aix_rac1) 1> CREATE SUBDIRS

Creating subdirectories under current directory /upload/oracle/ggate

Parameter files                /upload/oracle/ggate/dirprm: created
Report files                   /upload/oracle/ggate/dirrpt: created
Checkpoint files               /upload/oracle/ggate/dirchk: created
Process status files           /upload/oracle/ggate/dirpcs: created
SQL script files               /upload/oracle/ggate/dirsql: created
Database definitions files     /upload/oracle/ggate/dirdef: created
Extract data files             /upload/oracle/ggate/dirdat: created
Temporary files                /upload/oracle/ggate/dirtmp: created
Veridata files                 /upload/oracle/ggate/dirver: created
Veridata Lock files            /upload/oracle/ggate/dirver/lock: created
Veridata Out-Of-Sync files     /upload/oracle/ggate/dirver/oos: created
Veridata Out-Of-Sync XML files /upload/oracle/ggate/dirver/oosxml: created
Veridata Parameter files       /upload/oracle/ggate/dirver/params: created
Veridata Report files          /upload/oracle/ggate/dirver/report: created
Veridata Status files          /upload/oracle/ggate/dirver/status: created
Veridata Trace files           /upload/oracle/ggate/dirver/trace: created
Stdout files                   /upload/oracle/ggate/dirout: created


GGSCI (aix_rac1) 2>       exit
echo export  LIBPATH=/u01/app/oracle/11.2.0/lib>>~/.profile

1.        c) Run scripts for creating all necessary objects for support ddl replication:

SQL> @$GGATE/marker_setup.sql
SQL> @$GGATE/ddl_setup.sql
SQL> @$GGATE/role_setup.sql
SQL> grant GGS_GGSUSER_ROLE to ggate;
SQL> @$GGATE/ddl_enable.sql


Fichier  global

#cat GLOBAL
GGSCHEMA ggate
CHECKPOINTTABLE ggate.checkpoint

Fichier de  configuration du  manager :

#cat mgr.prm
PORT 7809
USERID ggate,PASSWORD qwerty

Fichier de  configuration pour  l extract :

add extract ext1  tranlog,thread 2,begin now
--extract group--
extract ext1
--connection to database--
userid ggate, password qwerty
--specify redo/archive location
--TRANLOGOPTIONS ALTARCHIVELOGDEST primary instance RACTEST1 +FRA/RACTEST/ARCHIVELOG/2011_04_25, ALTARCHIVELOGDEST primary instance RACTEST2 +FRA/RACTEST/ARCHIVELOG/2011_04_25
--TRANLOGOPTIONS  ALTARCHIVEDLOGFORMAT %t_%s_%r.dbf
--specify ASM connectivity as we are using ASM
TRANLOGOPTIONS ASMUSER ggate@ASM, ASMPASSWORD qwerty
--hostname and port for trail--
rmthost aix_rac1, mgrport 7809
--path and name for trail--
rmttrail /upload/oracle/ggate/dirdat/lt
--DDL support
-- ddl include mapped objname sender.*;
--DML table
TABLE sender.mg;

Fichier de  configuration de la replication :

add checkpointtable ggate.checkpoint
Successfully created checkpoint table GGATE.CHECKPOINT.
add replicat rep1, exttrail /upload/oracle/ggate/dirdat/lt,checkpointtable ggate.checkpoint
--Replicat group --
replicat rep1
--source and target definitions
ASSUMETARGETDEFS
--target database login --
userid ggate, password qwerty
--file for dicarded transaction --
discardfile /upload/oracle/ggate/discard/rep1_discard.txt, append, megabytes 10
--ddl support
DDL
--Specify table mapping ---
map sender.mg, target receiver.mgr;

suppression  :
GGSCI (aix_rac1) 5> dblogin  userid  ggate
Password:
Successfully logged into database.

GGSCI (aix_rac1) 6>  delete  replicat  rep1

ADMINISTRSATION   GOLDEN GATE

Liste de   commandes
GGSCI (aix_rac1) 3> start manager
GGSCI (aix_rac1) 4> info  all
GGSCI (aix_rac1) 5> view  params  mgr
add extract ext1  tranlog,thread 2,begin now
dblogin  userid ggate : connection a  la db
show   :  permet  de connaitre  les  fichiers de configurations
info  replicat  rep1
info  extract  ext1
view  report  rep1
view  report  ext1
Fchier  log  des erreurs  : $GG_HOME = /upload/oracle/ggate/ ggserr.log

Aucun commentaire:

Enregistrer un commentaire