19.06.2013 Views

DB2 UDB for z/OS Version 8 Performance Topics - IBM Redbooks

DB2 UDB for z/OS Version 8 Performance Topics - IBM Redbooks

DB2 UDB for z/OS Version 8 Performance Topics - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Since the database is defined as Unicode, any data being sent or received by the application<br />

must be converted by the DBM1 address space, such as in this example in which the<br />

EBCDIC code page is 37. Had the database remained as EBCDIC 37, no CCSID conversion<br />

would be necessary. The table contains one CHAR column called COLC (CCSID 1208) and<br />

one GRAPHIC column called COLG (CCSID 1200). When the application inserts host<br />

variables HV1 and HV2 into the table, the strings are converted by the DBM1 address space<br />

to Unicode. The CPU time <strong>for</strong> these conversions is added to the class 2 CPU time.<br />

Figure 4-13 shows a <strong>DB2</strong> Connect example using the same Unicode table.<br />

C-program<br />

INSERT<br />

HV1 943<br />

HV2 943<br />

SELECT<br />

HV1 943<br />

HV2 943<br />

<strong>DB2</strong> Connect V8<br />

Conversion<br />

Routines<br />

DisableUnicode=1<br />

AIX z/<strong>OS</strong><br />

DRDA<br />

Common<br />

Layer<br />

Figure 4-13 CCSID conversion - Remote application - 1<br />

The application is running remotely on an AIX client and uses the Japanese ASCII CCSID<br />

943. The application uses <strong>DB2</strong> Connect V8 to communicate to the z/<strong>OS</strong> server.<br />

The DRDA protocol and <strong>DB2</strong> maintain a convention strategy in which the "receiver makes<br />

right". Hence, DRDA lets <strong>DB2</strong> <strong>for</strong> z/<strong>OS</strong> do the conversions when sending data to the server,<br />

and <strong>DB2</strong> <strong>for</strong> z/<strong>OS</strong> lets the client do the conversions <strong>for</strong> data being retrieved by the client.<br />

Note however that the conversion is actually per<strong>for</strong>med by the DBM1 address space, not the<br />

DIST address space. The DBM1 address space actually does the inbound CCSID conversion<br />

<strong>for</strong> character strings, while the DIST address space per<strong>for</strong>ms the conversion <strong>for</strong> numeric data.<br />

<strong>IBM</strong> first introduced a JDBC Driver in V5 and V6, which is now known as the Legacy JDBC<br />

Driver. On workstations, the Legacy JDBC Driver interfaced with <strong>DB2</strong> Connect. When<br />

sending data to a <strong>DB2</strong> <strong>for</strong> z/<strong>OS</strong> V6 server, the Legacy JDBC Driver converted the data from<br />

UTF-16 to EBCDIC, because V6 was unable to handle incoming data in Unicode. (All <strong>IBM</strong><br />

implementations of Java use CCSID 1200 corresponding to UTF-16.)<br />

However, <strong>DB2</strong> V7 supports Unicode databases. If <strong>DB2</strong> Connect were to convert UTF-16 data<br />

to EBCDIC and then the server converted it to back to Unicode, there would be a potential <strong>for</strong><br />

data loss since not all Unicode characters exist in the intermediate EBCDIC character set. To<br />

DDF<br />

<strong>DB2</strong> Connect V8<br />

DBM1<br />

1208 COLC<br />

1200 COLG<br />

1208 COLC<br />

1200 COLG<br />

Chapter 4. <strong>DB2</strong> subsystem per<strong>for</strong>mance 177

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!