Teradata to Teradata: Max Performance - · PDF fileTeradata to Teradata: Max Performance Page...

of 18/18
Teradata to Teradata: Max Performance Page 1 Teradata to Teradata: Max Performance Objective Upon completion of this lesson, you will be able to keep two Teradata databases synchronized using the maximum performance method. During this lesson, you will learn how to: Prepare your user environment. Execute Teradata’s FastLoad for the initial data load process. Configure the change capture process to create a transaction log of Teradata changes in maximum performance mode. Configure and start the change delivery process of database operations. Teradata to Teradata max performance configuration The following diagram illustrates GoldenGate for Teradata in maximum performance mode. GoldenGate is installed on a separate Windows or UNIX server for the source and target Teradata<server> Teradata <server> <dsn> database Windows/Unix Server <target> database Target <database> Network Replicat Collector Trails Manager <dsn> database database Source <database> Network Windows/Unix Server <source> Manager Network Network RSG TAM/VAM Extract
  • date post

    11-Feb-2018
  • Category

    Documents

  • view

    241
  • download

    3

Embed Size (px)

Transcript of Teradata to Teradata: Max Performance - · PDF fileTeradata to Teradata: Max Performance Page...

  • Teradata to Teradata: Max Performance

    Page 1

    Teradata to Teradata: Max Performance

    Objective

    Upon completion of this lesson, you will be able to keep two Teradata databases

    synchronized using the maximum performance method.

    During this lesson, you will learn how to:

    Prepare your user environment.

    Execute Teradatas FastLoad for the initial data load process.

    Configure the change capture process to create a transaction log of Teradata changes in maximum performance mode.

    Configure and start the change delivery process of database operations.

    Teradata to Teradata max performance configuration

    The following diagram illustrates GoldenGate for Teradata in maximum performance mode.

    GoldenGate is installed on a separate Windows or UNIX server for the source and target

    Teradata

    Teradata

    database

    Windows/Unix Server

    databaseTarget

    Network

    Replicat

    Collector

    Trails

    Manager

    databasedatabase

    Source

    Network

    Windows/Unix Server

    Manager

    Network

    NetworkRSG TAM/VAM

    Extract

  • Teradata to Teradata: Max Performance

    Page 2

    systems. Source and target each communicate with a Teradata server.

    Overview of Tasks

    Prepare the Environment

    In order to execute this lesson, the GoldenGate application must be installed on both the

    source and target systems. The installation includes a sample database and scripts to generate

    initial data as well as subsequent update operations. The source and target tables are created

    and loaded with initial data. The GoldenGate Manager processes are also started so that other

    processes may be configured and started.

    Initial Data Load

    To initially load data, you have a few strategies to select from, including Teradatas FastLoad

    or GoldenGates TableCopy feature, both of which have their pros and cons. This lesson

    demonstrates using the Teradata FastLoad to load the data at high speed to the target system.

    Configure Change Capture

    For VAM-based Teradata capture in maximum performance mode, the Extract process is

    configured to capture change data directly from the Teradata Access Module (TAM) to create

    a transaction log and store the changes in data queues known as GoldenGate Trails.

    In maximum performance mode, the Extract buffers all current transactions until the

    transaction is committed. Once a commit is received, GoldenGate saves the transactional

    details in GoldenGate trail in commit order.

    Configure Change Delivery

    Once the tables have been initially loaded with data, the Replicat process is configured to

    deliver the captured change data into the target database.

    Prerequisites

    The prerequisites for this lab include the following.

    GoldenGate installed in the source and target .

    Teradata ODBC installed in the source and target environment.

    Teradata Change Data Capture facility of the Teradata Database must be installed and configured.

    Teradata Access Module library, TAM, copied to the GoldenGate installation location.

    Students should have been granted the security necessary to create replication groups.

    The Teradata ODBC, Change Data Capture facility, and the Teradata Access Module library

    are provided by NCR Corporation.

  • Prepare the Environment

    Page 3

    Exercise 1.

    Prepare the Environment

    Objective

    The goals of this exercise are to:

    Configure and start the Manager processes

    Prepare source and target sample Teradata databases

    Create ODBC data source name

    Configure Teradata replication services

    Configure the TAM initialization file.

    Configure the Manager processes

    1. Configure the Manager process on the source

    Execute the following commands on the system.

    Start the command interface

    shell> cd shell> ggsci

    Specify the port that the Manager should use.

    GGSCI> EDIT PARAMS MGR

    -- GoldenGate Manager Parameter file PORT

    Start Manager

    GGSCI> START MANAGER

    Verify the results:

    GGSCI> INFO MANAGER

  • Prepare the Environment

    Page 4

    Prepare the database

    2. Create ODBC data source name

    An ODBC system data source stores information about how to connect to the Teradata . Execute the following commands for a Teradata system.

    Create your system DSN for Teradata with a name of to connect to your source

    name. These examples show a database named GGSTera and a server named

    Tribble, but these should be changed to match your names.

    Click on the Options button. Select ANSI for the Session Mode and AAA for the DateTime

    Format.

    3. Create source tables and load with initial data

    Execute the following commands on the system.

    Edit the script, demo_tera _create.sql and demo_tera_insert.sql and change the

    to the identifier for your source database.

  • Prepare the Environment

    Page 5

    create table .tcustmer; create table .tcustord;

    For the script demo_tera_insert.sql enter the correct /, .

    Edit the script demo_tera_create_state_codes.sql and change to the identifier

    for your source database

    Note: The STATECODE table is not used in this lab exercise, but it is needed for the

    TableCopy workshop that may be included later.

    Using the Teradata command interface, BTEQ, login to the source Teradata server and

    execute the scripts.

    Shell> bteq BTEQ> .logon /

    This will prompt you to enter the . Then you can run the script.

    BTEQ> .run file = /demo_tera_create.sql; BTEQ> .run file = /demo_tera_insert.sql;

    BTEQ> .run file = /demo_tera_create_state_codes.sql; BTEQ> .run file = /demo_tera_insert_state_codes.sql;

    Verify the results for the tables used in this lab:

    BTEQ> select * from .tcustmer; BTEQ> select * from .tcustord;

    4. Create the obey file to configure the Teradata replication group

    On the system, create the sql obey file RepGroupPerf.sql with the following

    statement. Change the and to your values.

    Create Replication Group REPGROUP (.tcustmer, .tcustord, .statecode);

    5. Configure the Teradata Access Module initialization file VAMPERF.ini

    The initialization (.ini) file contains information to be passed to the TAM. These details

    include the replication mode, ODBC connection strings, the security token for the Replication

    group, and other TAM variables.

    On your system, use an editor such as WordPad to create a text file named \VAMPERF.ini. This should contain the following information set to your

    values.

    Note: As of Teradata 12.0, the following rules apply:

    The RepliationGroupName parameter is no longer required. It is replaced by GroupID.

  • Prepare the Environment

    Page 6

    If the replication group already exists, both the SecurityToken and GroupID must be entered.

    Multiple RSG connections may be supplied as shown in the example below.

    ; Sets the mode for this extract process ("Replication" or "TableCopy") Mode=Replication

    ; ODBC connection string used to access metadata from ; the data dictionary of the primary Teradata system

    DictOdbcConnString=DSN=;uid=;pwd=

    ; ODBC connection string used to execute management functions ; (such as CREATE REPLICATION GROUP) on the primary Teradata system

    MgmtOdbcConnString=DSN=;uid=;pwd=

    ; Name of the replication group is not needed when using ; CreateGroupStmtFile ; Otherwise for Teradata v2r6 enter (must be uppercase):

    ; ReplicationGroupName=REPGROUP ; For Teradata v12 enter: ; GroupID= (enter the group ID number)

    ; If the group already exists, enter Security token ; SecurityToken= (enter the security token) ; OR enter the name of the file containing CREATE REPLICATION GROUP ; statement for a new group (set up in step 4) CreateGroupStmtFile=./RepGroupPerf.sql

    ; Character set (ASCII, UTF16) CharacterSet=ASCII

    ; RSG Node addresses - specify name or IP, with optional port

    ControlRSG=:5298

    DataRSG1=:5298 ; As of Teradata 12.0 multiple RSG connections may be included

    ; DataRSG2=:

    ; DataRSG3=:

    ; Specifies which types of messages are encrypted (None, Control, Data, ; or All) Encryption=None

    Prepare the Teradata target environment

    6. Configure the Manager process

    Execute the following command on the Teradata system.

  • Prepare the Environment

    Page 7

    Start the command interface

    shell> cd shell> ggsci

    Specify the port that the Manager should use.

    GGSCI> EDIT PARAMS MGR

    -- GoldenGate Manager Parameter file PORT

    Start Manager

    GGSCI> START MANAGER

    Verify the results:

    GGSCI> INFO MANAGER

    7. Create ODBC data source name

    An ODBC system data source stores information about how to connect to the Teradata . Execute the following commands on the Teradata system.

    Create your system DSN for Teradata with a name of to connect to your target

    name. These examples show a DSN named GGSTera and a server named Tribble,

    but these should be changed to match your n