Presentation is loading. Please wait.

Presentation is loading. Please wait.

Native DB2 for iSeries Source Training

Similar presentations


Presentation on theme: "Native DB2 for iSeries Source Training"— Presentation transcript:

1 Native DB2 for iSeries Source Training
7 July 2017 John Wang

2 DB2 iSeries Prerequisites (1 of 2)
iSeries ODBC driver must be installed on the Attunity Replicate Server machine, The driver is part of IBM I Access Client Solutions. 5770-XE1 IBM i Access for Windows 5770-XL1 IBM i Access for Linux After installing the Linux Driver , Edit the file /etc/odbcinst.ini and add the section: [IBM i Access ODBC Driver 64-bit] Description = IBM i Access for Linux 64-bit ODBC Driver Driver = /opt/ibm/iaccess/lib64/libcwbodbc.so Setup = /opt/ibm/iaccess/lib64/libcwbodbcs.so Threading = 0 DontDLClose = 1 UsageCount = 1

3 DB2 iSeries Prerequisites (2 of 2)
For DB2 iSeries version 7.1 the following IBM patch need to be installed: DB2 for IBM i Group PTF SF99701: 710 DB2 for IBM i - Level 3 (released August 2010) or PTF '5770SS1 V7R1M0 SI39820' , PTF '5770SS1 V7R1M0 SI39821‘. For CDC: When you start journaling the source tables, make sure that the Record images parameter is set to *BOTH (for capturing before and after images). SI39820/SI39821 might be replaced by newer PTF SI42771/SI42772. IBM system i Navigator : search 39820

4 Required Permissions:
USER CLASS = *USER (default value) Special authority = *NONE Full Load: Read permissions for the source tables. CDC: Read permissions for the journal defined for the IBM DB2 for iSeries endpoint and for the task's source tables.

5 Required Permissions

6 Limitations Limitations: All of the source tables for a given Replicate task need to be journaled to the same journal. The name of the journal and the library in which it is located must be specified in the endpoint settings Field level encryption is not supported Drop table DDL is not supported XML Datatype is not supported Limited LOB support is actually Full LOB support

7 New Native Endpoint Architecture
Working with the new native endpoint is much simpler (No studio, daemon…), provides an optimal speed , support encryption and more.

8 Setting up the new DB2 iSeries as Source

9 Setting up the new DB2 iSeries as Source

10 Map from CCSID to Code Page – Endpoint level
The "Map from CCSID to Code Page:" gives the user the option to override a specific CCSID to another Win/Linux code page. The conversion is in the Endpoint level

11 Map from CCSID to Code Page – Column level
Note: When both Endpoint level and Column level mapping are defined on the same table , the column level will override the Endpoint level mapping.

12 DB2 iSeries CCSID mapping

13 Support of RRN Column (1 of 2)
Relative Record Number (RRN) column support have the following three options: Add RRN column to tables without a Primary key or Unique Index (Default) Add RRN column to all tables Do not add RRN column In the target table the RRN column is being created under the name: Note – when the source table does not have Primary Key or Unique Index the RRN column will be created as PK/UI in the target table

14 Support of RRN Column (2 of 2)
Partition table

15 Datatypes Mapping DB2 iSeries Datatype Replicate Datatype INTEGER INT4
SMALLINT INT2 BIGINT INT8 DECIMAL (p,s) NUMERIC (p,s) DOUBLE (=FLOAT(8)) REAL8 REAL (=FLOAT(4)) REAL4 CHAR (n) STRING n<=32KB VARCHAR (n) GRAPHIC(n) WSTRING n<=16K double byte chars VARGRAPHIC DATE TIME TIMESTAMP DATETIME(6) (always with microseconds) BLOB BLOB Max size: 2 GB CLOB CLOB Max size: 2 GB DBCLOB NCLOB Max size: 1 G double byte chars

16 In the new native IBM DB2 for iSeries we support the following
New Endpoint Benefits In the new native IBM DB2 for iSeries we support the following DDL’s support Character data moved to Replicate as binary Codepage conversion with ICU (includes custom codepages). Detailed information …

17 National Language Support Attunity Replicate support NLS
Without custom ICU With custom ICU

18 NLS – Without custom ICU
CREATE TABLE APSUPDB/TESTICU (ID CHAR(10) CCSID 37 NOT NULL, SCH VARCHAR(20) CCSID 935 NOT NULL, KOR VARCHAR(20) CCSID 933 NOT NULL, JPN VARCHAR(20) CCSID 930 NOT NULL, THA VARCHAR(20) CCSID 1160 NOT NULL, VIN VARCHAR(20) CCSID 1130 NOT NULL, DT DATE DEFAULT NULL) CCSID 37 CCSID 935 IBM EBCDIC Simplified Chinese CCSID 933 IBM EBCDIC Korean Combined CCSID 930 IBM EBCDIC Japanese Katakana Extended CCSID 1160 IBM EBCDIC Thailand (with Euro) CCSID 1130 IBM EBCDIC Vietnamese

19 NLS – Without custom ICU
DB400 insert into APSUPDB/TESTICU values ( 'SIO', x'0E45E145E245E345E40F',  ① ② ③ ④ x'0EA061A062A065A0670F',  마 막 만 많 x'0E F',  あ い 一 二 x' ',  ก ข ฃ ค x' ',  current date) PostgreSQL

20 NLS – Without custom ICU
Replicate get the columns CCSID from DB400 automatically Task log file logging components SOURCE_UNLOAD METADATA_MANAGE

21 NLS – Without custom ICU
Mapping Thailand chars to Vietnam chars manually Result in PostgreSQL

22 Special characters and custom made characters
Custom ICU Special characters and custom made characters HK and Macau, Japanese, Vietnam market Sample of .ucm

23 Building and testing custom ICU
C:\Program Files\Attunity\Replicate\bin>makeconv -v CP930NEW.ucm the total number of offsets is 0x8d06=36102 compacting toUnicode data saves bytes fromUnicode number of uint32_t in stage 2: 0x835=2101 fromUnicode number of 2-byte stage 3 mapping entries: 0x6890=26768 - Opened udata CP930NEW.cnv size of extension data: 5620 - Wrote bytes to the udata. CP930NEW.cnv Utilize custom ICU in Replicate Put CP930NEW.cnv to C:\Program Files\Attunity\Replicate\bin\ICUDT58L Export task JSON and change. (Will support in GUI)

24 NLS – With custom ICU Column setting

25 DB2 iSeries Trouble shooting
STRSQL ODBC SELECT HEX() FROM WRKOBJ DSPJRN SELECT … FROM TABLE(QSYS2.Display_Journal) SOURCE_CAPTURE, TARGET_APPLY logging

26 STRSQL = sqplus in Oracle Execute query, update Used for both Full Load & CDC

27 ODBC Any 3rd party 64-bit ODBC test tools

28 SELECT HEX() FROM Compare source and target data select id,name,hex(name) from apsupdb/kitccsid

29 WRKOBJ WRKOBJ APSUPDB/KITNOPK

30 DSPJRN DSPJRN JRN(APSUPDB/QSQJRN) FROMTIME('06/20/2017' '10:00:00') (F4 for help)

31 TABLE(QSYS2.Display_Journal)
SELECT … FROM TABLE(QSYS2.Display_Journal)

32 Thank you for participating END OF TRAINING


Download ppt "Native DB2 for iSeries Source Training"

Similar presentations


Ads by Google