Indosat Golden Gate-Deployment Document_2011!05!24_A1

13
Indosat Golden gate Deployement Document Indosat Golden Gate deployment Document © Copyright Utiba Pty Ltd The contents of this document are copyright and remain the property of Utiba Pty Ltd. This document is not to be reproduced in any form, whether electronic, mechanical or by any other means without written permission of authorised officers of Utiba Pty Ltd.

description

Indosat Golden Gate-Deployment Document_2011!05!24_A1

Transcript of Indosat Golden Gate-Deployment Document_2011!05!24_A1

  • Indosat Golden gate Deployement Document

    Indosat Golden Gate deployment

    Document

    Copyright Utiba Pty Ltd

    The contents of this document are copyright and remain the property of Utiba Pty Ltd. This document is not to be reproduced in any form, whether electronic, mechanical or by any other means without written

    permission of authorised officers of Utiba Pty Ltd.

  • Title: Indosat Golden gate deployment Document

    Document Type: Indosat Golden gate deployment Document

    Doc. No.: Indosat Golden Gate-Deployment Document_2011-05-24_A1.doc

    Utiba Pte Ltd. Commercial in Confidence Page 2 of 13

    Contents

    1 Preparing for Golden gate installation .......................................................................................................... 3 1.1 Installation path .................................................................................................................................... 3 1.2 Install Golden gate ............................................................................................................................... 3 1.3 Set parameter in profile ....................................................................................................................... 3 1.4 Create folders ...................................................................................................................................... 3 1.5 Oracle-specific installation steps ......................................................................................................... 3

    2 Golden Gate account ................................................................................................................................... 4 2.1 Create user .......................................................................................................................................... 4 2.2 Create role ........................................................................................................................................... 4 2.3 Grant permission on umarket objects .................................................................................................. 4 2.4 Add supplemental logging for tables ................................................................................................... 4

    3 Golden gate configuration ............................................................................................................................ 5 3.1 Manager process ................................................................................................................................. 5 3.2 Extract process .................................................................................................................................... 5 3.3 PUMP process ..................................................................................................................................... 6 3.4 a. Manager process ............................................................................................................................. 6 3.5 b.Replication process .......................................................................................................................... 7

    4 Cut-over ........................................................................................................................................................ 7 4.1 Start processes .................................................................................................................................... 7 4.2 Export data .......................................................................................................................................... 7 4.3 Export data .......................................................................................................................................... 8 4.4 Import data into Database at SERPONG ............................................................................................ 9

    5 Register Golden Gate into Oracle clusterware ........................................................................................... 10 5.1 Add an application VIP ...................................................................................................................... 10 5.2 Create an action program .................................................................................................................. 12 5.3 Create an application profile .............................................................................................................. 12 5.4 Start the application ........................................................................................................................... 13

  • Title: Indosat Golden gate deployment Document

    Document Type: Indosat Golden gate deployment Document

    Doc. No.: Indosat Golden Gate-Deployment Document_2011-05-24_A1.doc

    Utiba Pte Ltd. Commercial in Confidence Page 3 of 13

    1 Preparing for Golden gate installation

    1.1 Installation path

    We will use the partition /oracle/oraindex16 for Golden gate binary and trail file

    On DM:

    mkdir /oracle/oraindex16/ggsci

    On SP:

    mkdir /oracle/oraindex16/ggsci

    1.2 Install Golden gate

    Download bundle Goldengate for Orace 10g on Solaris and HP-UX from Oracle website

    Then unzip to /oracle/oraindex16/ggsci

    1.3 Set parameter in profile

    Edit profile of oracle user by adding this parameter

    export LD_LIBRARY_PATH= $LD_LIBRARY_PATH: /oracle/oraindex16/ggsci

    1.4 Create folders

    cd /oracle/oraindex16/ggsci

    ./ggsci

    GGSCI> CREATE SUBDIRS

    GGSCI> EXIT

    1.5 Oracle-specific installation steps

    The following steps are only required when installing GoldenGate for Oracle.

    Turn on supplemental logging at the database level. This command requires the ALTER DATABASE permissions.

    Shell> sqlplus /

    Switch to the next redo log file. SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;

    SQL> ALTER SYSTEM SWITCH LOGFILE;

    SQL> EXIT

    Switch to the next redo log file. SQL> ALTER SYSTEM SWITCH LOGFILE;

    SQL> EXIT

  • Title: Indosat Golden gate deployment Document

    Document Type: Indosat Golden gate deployment Document

    Doc. No.: Indosat Golden Gate-Deployment Document_2011-05-24_A1.doc

    Utiba Pte Ltd. Commercial in Confidence Page 4 of 13

    2 Golden Gate account

    We will use another user for Golden gate purpose, on each site DM and SP.

    2.1 Create user

    sqlplus / as sysdba

    create user goldengate identified by oracle temporary tablespace temp

    default tablespace users;

    grant resource,connect,dba,select any dictionary to goldengate;

    grant CREATE SESSION, ALTER SESSION,RESOURCE,CONNECT,SELECT ANY

    DICTIONARY,FLASHBACK ANY TABLE,SELECT ANY TABLE to goldengate

    grant resource,connect,dba,select any dictionary to indosat_ub_umarketadm;

    grant CREATE SESSION, ALTER SESSION,RESOURCE,CONNECT,SELECT ANY

    DICTIONARY,FLASHBACK ANY TABLE,SELECT ANY TABLE to indosat_ub_umarketadm;

    2.2 Create role

    sqlplus / as sysdba

    @role_setup.sql;

    Then type username: goldengate when is asked

    2.3 Grant permission on umarket objects

    Run this process on two sites (DM and SP)

    sqlplus INDOSAT_UB_UMARKETADM/Utiba99

    set pages 0;

    set lines 300;

    spool grants.sql

    select grant select,insert,update,delete on||table_name|| to goldengate; from tabs;

    spool off;

    @grants.sql

    2.4 Add supplemental logging for tables

    Shell> ggsci

  • Title: Indosat Golden gate deployment Document

    Document Type: Indosat Golden gate deployment Document

    Doc. No.: Indosat Golden Gate-Deployment Document_2011-05-24_A1.doc

    Utiba Pte Ltd. Commercial in Confidence Page 5 of 13

    GGSCI> DBLOGIN USERID INDOSAT_UB_UMARKETADM, PASSWORD Utiba99

    GGSCI> ADD TRANDATA INDOSAT_UB_UMARKETADM.*

    Verify that supplemental logging has been turned on for these tables.

    GGSCI> INFO TRANDATA INDOSAT_UB_UMARKETADM.*

    3 Golden gate configuration

    At DM:

    3.1 Manager process

    Shell> ggsci

    EDIT PARAMS MGR

    port 9999

    3.2 Extract process

    EDIT PARAM EXTG_DMG

    EXTRACT EXTG_DMG

    USERID goldengate, PASSWORD oracle

    EXTTRAIL ./dirdat/dm

    TABLE INDOSAT_UB_UMARKETADM.ACCOUNT_CAP;

    TABLE INDOSAT_UB_UMARKETADM.ACCOUNT_DATA;

    TABLE INDOSAT_UB_UMARKETADM.ACCOUNT_MONEY;

    TABLE INDOSAT_UB_UMARKETADM.AGENT_AUTH_TOKEN;

    TABLE INDOSAT_UB_UMARKETADM.AGENT_BODY;

    TABLE INDOSAT_UB_UMARKETADM.AGENT_DATA;

    TABLE INDOSAT_UB_UMARKETADM.AGENT_GROUP;

    TABLE INDOSAT_UB_UMARKETADM.AGENT_GROUP_DATA;

    TABLE INDOSAT_UB_UMARKETADM.AGENT_GROUP_MAP;

    TABLE INDOSAT_UB_UMARKETADM.AGENT_REF;

    TABLE INDOSAT_UB_UMARKETADM.CAP_DETAILS;

    TABLE INDOSAT_UB_UMARKETADM.CAP_INFO;

    TABLE INDOSAT_UB_UMARKETADM.CAP_SET;

    TABLE INDOSAT_UB_UMARKETADM.CLASS_ENTRY;

    TABLE INDOSAT_UB_UMARKETADM.CLASS_MAP;

    TABLE INDOSAT_UB_UMARKETADM.COUPON;

    TABLE INDOSAT_UB_UMARKETADM.JOIN_AGENT_MAP;

    TABLE INDOSAT_UB_UMARKETADM.MONEY_DETAILS;

    TABLE INDOSAT_UB_UMARKETADM.MONEY_DETAILS_DATA;

    TABLE INDOSAT_UB_UMARKETADM.MONEY_HISTORY;

  • Title: Indosat Golden gate deployment Document

    Document Type: Indosat Golden gate deployment Document

    Doc. No.: Indosat Golden Gate-Deployment Document_2011-05-24_A1.doc

    Utiba Pte Ltd. Commercial in Confidence Page 6 of 13

    --TABLE INDOSAT_UB_UMARKETADM.NUMBER_SEQUENCE;

    TABLE INDOSAT_UB_UMARKETADM.PASSWORDS;

    TABLE INDOSAT_UB_UMARKETADM.PURCHASE_ORDER;

    TABLE INDOSAT_UB_UMARKETADM.RETRYLIST;

    TABLE INDOSAT_UB_UMARKETADM.RT_DATA;

    TABLE INDOSAT_UB_UMARKETADM.RULE;

    TABLE INDOSAT_UB_UMARKETADM.RULE_CONTEXT;

    TABLE INDOSAT_UB_UMARKETADM.RULE_DATA;

    TABLE INDOSAT_UB_UMARKETADM.RULE_ENTITY;

    TABLE INDOSAT_UB_UMARKETADM.RULE_MAP;

    TABLE INDOSAT_UB_UMARKETADM.RULE_TEMPLATE;

    TABLE INDOSAT_UB_UMARKETADM.RULE_VERSION;

    TABLE INDOSAT_UB_UMARKETADM.SCHED;

    TABLE INDOSAT_UB_UMARKETADM.SCHED_DATA;

    TABLE INDOSAT_UB_UMARKETADM.TRANS;

    TABLE INDOSAT_UB_UMARKETADM.TRANS_DATA;

    TABLE INDOSAT_UB_UMARKETADM.TRANS_EXT_DATA;

    TABLE INDOSAT_UB_UMARKETADM.TRANS_EXT_TRANS;

    TABLE INDOSAT_UB_UMARKETADM.TRANS_MONEY;

    TABLE INDOSAT_UB_UMARKETADM.TRANS_PARTY;

    TABLE INDOSAT_UB_UMARKETADM.VOUCHER;

    TABLE INDOSAT_UB_UMARKETADM.VOUCHER_DATA;

    ADD EXTRACT EXTG_DMG, TRANLOG, BEGIN NOW, THREADS 2

    ADD EXTTRAIL ./dirdat/dm, extract EXTG_DMG, megabytes 200

    3.3 PUMP process

    EDIT PARAMS PUMP_DMG

    EXTRACT PUMP_DMG

    PASSTHRU

    RMTHOST 192.168.1.138, MGRPORT 9999

    RMTTRAIL ./dirdat/sp

    At SERPONG:

    3.4 a. Manager process

    Shell> ggsci

  • Title: Indosat Golden gate deployment Document

    Document Type: Indosat Golden gate deployment Document

    Doc. No.: Indosat Golden Gate-Deployment Document_2011-05-24_A1.doc

    Utiba Pte Ltd. Commercial in Confidence Page 7 of 13

    EDIT PARAMS MGR

    port 9999

    3.5 .Replication process

    EDIT PARAM REP_SRP

    REPLICAT REP_STB

    USERID goldengate, PASSWORD oracle

    ASSUMETARGETDEFS

    DISCARDFILE ./dirrpt/umarket_srp.dsc, PURGE

    MAP INDOSAT_UB_UMARKETADM.*,TARGET INDOSAT_UB_UMARKETADM.*;

    4 Cut-over

    4.1 Start processes

    At DM, need to start manager,extract process before doing anything

    cd /oracle/oraindex16/ggsci

    ./ggsci

    start manager;

    start extract extg_dmg;

    exit;

    4.2 Export data

    Create a export parameter as below

    vi gg_data_initial.par

    userid=indosat_ub_umarketadm/utiba99@SEVDB5

    indexes=n

    constraints=y

    triggers=y

    recordlength=64000

    buffer=1000000

    FILESIZE=30000M

    file=/datadump/export/gg_data_initial01.dmp,/datadump/export/gg_data_initial02.dm

    p,/datadump/export/gg_data_initial03.dmp

    log=/datadump/export/gg_data_initial.log

    rows=y

    direct=y

    consistent=y

  • Title: Indosat Golden gate deployment Document

    Document Type: Indosat Golden gate deployment Document

    Doc. No.: Indosat Golden Gate-Deployment Document_2011-05-24_A1.doc

    Utiba Pte Ltd. Commercial in Confidence Page 8 of 13

    compress=y

    tables=(

    ACCOUNT,

    ACCOUNT_CAP,

    ACCOUNT_DATA,

    ACCOUNT_MONEY,

    AGENT_AUTH_TOKEN,

    AGENT_BODY,

    AGENT_DATA,

    AGENT_GROUP,

    AGENT_GROUP_DATA,

    AGENT_GROUP_MAP,

    AGENT_REF,

    CAP_DETAILS,

    CAP_INFO,

    CAP_SET,

    CLASS_ENTRY,

    CLASS_MAP,

    COUPON,

    JOIN_AGENT_MAP,

    MONEY_DETAILS,

    MONEY_DETAILS_DATA,

    MONEY_HISTORY,

    PASSWORDS,

    PURCHASE_ORDER,

    RETRYLIST,

    RT_DATA,

    RULE,

    RULE_CONTEXT,

    RULE_DATA,

    RULE_ENTITY,

    RULE_MAP,

    RULE_TEMPLATE,

    RULE_VERSION,

    SCHED,

    SCHED_DATA,

    VOUCHER,

    VOUCHER_DATA)

    4.3 Export data

    Run following command to export data

    exp par= gg_data_initial.par

  • Title: Indosat Golden gate deployment Document

    Document Type: Indosat Golden gate deployment Document

    Doc. No.: Indosat Golden Gate-Deployment Document_2011-05-24_A1.doc

    Utiba Pte Ltd. Commercial in Confidence Page 9 of 13

    4.4 Import data into Database at SERPONG

    At SERPONG:

    Run following commands to clean data on database and import data from DMG into DB

    sqlplus indosat_ub_umarketadm/utiba99

    set pages 0;

    set lines 200;

    spool truncate_data.sql;

    select truncate table || table_name ||; from tabs;

    spool off;

    @truncate_data.sql;

    Exit;

    Create a parameter as below

    vi data_initial_imp.par

    userid=indosat_ub_umarketadm/Utiba99

    file=/datadump/export/gg_data_initial01.dmp,/datadump/export/gg_data_initial02.dmp,/datadu

    mp/export/gg_data_initial03.dmp

    log=/datadump/export/gg_data_initial.log

    indexes=y

    constraints=y

    grants=y

    commit=y

    ignore=y

    rows=y

    recordlength=65535

    show=

    feedback=1000

    buffer=1024000

    tables=(

    ACCOUNT,

    ACCOUNT_CAP,

    ACCOUNT_DATA,

    ACCOUNT_MONEY,

    AGENT_AUTH_TOKEN,

    AGENT_BODY,

    AGENT_DATA,

    AGENT_GROUP,

    AGENT_GROUP_DATA,

    AGENT_GROUP_MAP,

    AGENT_REF,

    CAP_DETAILS,

    CAP_INFO,

    CAP_SET,

    CLASS_ENTRY,

    CLASS_MAP,

    COUPON,

    JOIN_AGENT_MAP,

  • Title: Indosat Golden gate deployment Document

    Document Type: Indosat Golden gate deployment Document

    Doc. No.: Indosat Golden Gate-Deployment Document_2011-05-24_A1.doc

    Utiba Pte Ltd. Commercial in Confidence Page 10 of 13

    MONEY_DETAILS,

    MONEY_DETAILS_DATA,

    MONEY_HISTORY,

    PASSWORDS,

    PURCHASE_ORDER,

    RETRYLIST,

    RT_DATA,

    RULE,

    RULE_CONTEXT,

    RULE_DATA,

    RULE_ENTITY,

    RULE_MAP,

    RULE_TEMPLATE,

    RULE_VERSION,

    SCHED,

    SCHED_DATA,

    VOUCHER,

    VOUCHER_DATA)

    Imp parfile= data_initial_imp.par

    5 Register Golden Gate into Oracle clusterware

    5.1 Add an application VIP

    The first step is to create an application VIP. The VIP will be used to access Oracle

    GoldenGate (e.g. by a remote pump or by the Management Pack for Oracle GoldenGate).

    Oracle Clusterware will assign the VIP to a physical server, and migrate the VIP if that server

    were to go down or if you instruct Clusterware to do so.

    To create the application VIP, login as the OS Oracle software owner (oracle in this

    example) and run:

    CLUSTERWARE_HOME/bin/crs_profile -create ggatevip \

    -t application \

    -a CLUSTERWARE_HOME/bin/usrvip \

    -o oi=lan900,ov=10.144.1.115,on=255.255.255.0

    with:

    CLUSTERWARE_HOME as the oracle home in which Oracle Clusterware is installed (e.g.

    /u01/app/oracle/crs111).

    ggatevip is the name of the application VIP that you will create.

  • Title: Indosat Golden gate deployment Document

    Document Type: Indosat Golden gate deployment Document

    Doc. No.: Indosat Golden Gate-Deployment Document_2011-05-24_A1.doc

    Utiba Pte Ltd. Commercial in Confidence Page 11 of 13

    oi=eth0; eth0 is the public interface in this example.

    ov=10.144.1.115; the virtual IP address is 192.168.1.23 in this example.

    on=255.255.255.0; the subnet mask. This should be the same subnet mask for the

    public (general) IP address.

    There are more options you can set through the crs_* commands. For example, you can

    indicate what nodes can be used to host the application, if there is a preference for a node to run

    the application, and whether you want to always start the application upon reboot, never, or

    restore the last state upon reboot (the default).

    Next, register the VIP as oracle:

    CLUSTERWARE_HOME/bin/crs_register ggatevip

    Because the assignment of an IP address is done by the root user, you have to set the

    ownership of the VIP to the root user. Connect as root and execute:

    CLUSTERWARE_HOME/bin/crs_setperm ggatevip -o root

    As root, allow oracle to run the script to start the VIP.

    CLUSTERWARE_HOME/bin/crs_setperm ggatevip -u user:oracle:r-x

    Then, as oracle, start the VIP:

    CLUSTERWARE_HOME/bin/crs_start ggatevip

    To validate whether the VIP is running and on which node it is running, execute:

    CLSUTERWARE_HOME/bin/crs_stat ggatevip -t

    For example:

    [oracle@spgdb01 bin]$ crs_stat ggatevip -t

    Name Type Target State Host

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

    ggatevip application ONLINE ONLINE spgdb01

  • Title: Indosat Golden gate deployment Document

    Document Type: Indosat Golden gate deployment Document

    Doc. No.: Indosat Golden Gate-Deployment Document_2011-05-24_A1.doc

    Utiba Pte Ltd. Commercial in Confidence Page 12 of 13

    5.2 Create an action program

    Create a file called : goldengate_action.scr and located in

    /oracle/oraindex16/ggsci

    5.3 Create an application profile

    The application profile is a text file with key-value pairs. Rather than creating such a text

    file from scratch you use CLUSTERWARE_HOME/bin/crs_profile to create and

    manipulate the file. Connect as oracle and execute:

    CLUSTERWARE_HOME/bin/crs_profile \

    -create goldengate_app \

    -t application \

    -r ggatevip \

    -a CLUSTERWARE_HOME/crs/public/goldengate_action.scr \

    -o ci=10

    The following values are used:

    -create goldengate_app: the application name is goldengate_app.

    -r ggatevip: -r specifies the required resources that must be running for the

    application to start. In this case the VIP ggatevip must be running before Oracle

    GoldenGate starts.

    -a CLUSTERWARE_HOME/crs/public/goldengate_action.scr specifies

    the action script (reminder: this script must be available in this location on every server

    and be executable).

    -o ci=10: the -o flag specifies options. In this case the only option that is specified is

    the Check Interval which is set to 10 seconds.

    For more information about the crs_profile command and its options, please refer to

    the Oracle Clusterware documentation.

    The next step is to register the application with Oracle Clusterware. Run this command as

    oracle:

    CLUSTERWARE_HOME/bin/crs_register goldengate_app

  • Title: Indosat Golden gate deployment Document

    Document Type: Indosat Golden gate deployment Document

    Doc. No.: Indosat Golden Gate-Deployment Document_2011-05-24_A1.doc

    Utiba Pte Ltd. Commercial in Confidence Page 13 of 13

    Unless you installed Oracle GoldenGate as Oracle software owner, you will have to

    change the ownership of the application to your Oracle GoldenGate software owner. This

    example assumes you use ggate as the Oracle GoldenGate software owner. If you use

    oracle as the Oracle GoldenGate software owner then you can skip the following 2

    commands.

    Login as root and change the ownership of the goldengate_app application:

    CLUSTERWARE_HOME/bin/crs_setperm goldengate_app -o ggate

    As root, allow oracle to run the script to start the goldengate_app application.

    CLUSTERWARE_HOME/bin/crs_setperm goldengate_app -u user:oracle:r-x

    5.4 Start the application

    From now on you should always use Oracle Clusterware to start Oracle GoldenGate.

    Login as oracle and execute:

    CLUSTERWARE_HOME/bin/crs_start goldengate_app

    To check the status of the application:

    CLUSTERWARE_HOME/bin/crs_stat goldengate_app -t

    For example:

    [oracle@spgdb01 bin]$ crs_stat goldengate_app -t

    Name Type Target State Host

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

    goldengate_app application ONLINE ONLINE spgdb01

    [oracle@ spgdb01bin]$

    Note: This step will be executed at DB servers( at DM and SP)