ibm-information-center/dist/eclipse/plugins/i5OS.ic.ddp_5.4.0.1/rbal1othertips.htm

236 lines
15 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="reference" />
<meta name="DC.Title" content="Other tips for interoperating in unlike environments" />
<meta name="abstract" content="This topic collection provides additional information for using DB2 Universal Database for iSeries with DB2 Universal Database for Linux, UNIX and Windows. These tips were developed from experiences testing with the products on an OS/2 platform, but it is believed that they apply to all environments to which they have been ported." />
<meta name="description" content="This topic collection provides additional information for using DB2 Universal Database for iSeries with DB2 Universal Database for Linux, UNIX and Windows. These tips were developed from experiences testing with the products on an OS/2 platform, but it is believed that they apply to all environments to which they have been ported." />
<meta name="DC.Relation" scheme="URI" content="rbal1xplat.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rbal1othertips" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>Other tips for interoperating in unlike environments</title>
</head>
<body id="rbal1othertips"><a name="rbal1othertips"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Other tips for interoperating in unlike environments</h1>
<div><p>This topic collection provides additional information for using DB2
Universal Database™ for iSeries™ with DB2 Universal Database™ for Linux<sup>®</sup>, UNIX<sup>®</sup> and Windows<sup>®</sup>.
These tips were developed from experiences testing with the products on an OS/2<sup>®</sup> platform,
but it is believed that they apply to all environments to which they have
been ported.</p>
<div class="section"><h4 class="sectiontitle">DB2
Connect™ as opposed to DB2 Universal Database for Linux, UNIX and Windows</h4><p>Users
are sometimes confused over what products are needed to perform the DRDA<sup>®</sup> application
server function as opposed to the application requester (client) function.
The AR is sometimes referred to as DB2 Connect™; and both the AR and
AS as DB2
Universal Database for Linux, UNIX and Windows. DB2<sup>®</sup> UDB refers to the following products: </p>
<ul><li>DB2
Universal Database for AIX<sup>®</sup></li>
<li>DB2
Universal Database for HP-UX</li>
<li>DB2
Universal Database for Linux</li>
<li>DB2
Universal Database for Sun Solaris</li>
<li>DB2
Universal Database for Windows</li>
</ul>
</div>
<div class="section"><h4 class="sectiontitle">Proper configuration and maintenance level</h4><p>Be sure
to follow the installation and configuration instructions given in the product
manuals carefully. Make sure that you have the most current level of the products.
Apply the appropriate fix packs if not.</p>
</div>
<div class="section"><h4 class="sectiontitle">Table and collection naming</h4><p>SQL tables accessed
by DRDA applications
have three-part names: the first part is the <dfn class="term">database name</dfn>, the
second part is a <dfn class="term">collection ID</dfn>, and the third part is the <dfn class="term">base
table name</dfn>. The first two parts are optional. <span class="keyword">DB2 UDB for iSeries</span> qualifies
table names at the second level by a collection (or library) name. Tables
reside in the <span class="keyword">DB2 UDB for iSeries</span> database.</p>
<p>Before
V5R2 and the advent of independent auxiliary storage pools, there was only
one database for each <span class="keyword">iSeries server</span>.
However, in DB2 UDB,
tables are qualified by a user ID (that of the creator of the table), and
reside in one of possibly multiple databases on the platform. <span>DB2
Universal Database for Linux, UNIX and Windows</span> has the same notion of
using the user ID for the collection ID.</p>
<p>A dynamic query from <span>DB2
Universal Database for Linux, UNIX and Windows</span> to <span class="keyword">DB2 UDB for iSeries</span> will
use the user ID of the target side job (on the <span class="keyword">iSeries server</span>)
for the default collection name, if the name of the queried table was specified
without a collection name. This might not be what is expected by the user
and can cause the table to be not found.</p>
<p>A dynamic query from <span class="keyword">DB2 UDB for iSeries</span> to DB2 UDB would have an implied table qualifier
if it is not specified in the query in the form <em>qualifier.table-name</em>.
The second-level UDB table qualifier defaults to the user ID of the user making
the query.</p>
<p>You might want to create the DB2 UDB databases and tables with a common
user ID. Remember, for UDB there are no physical collections as there are
in <span class="keyword">DB2 UDB for iSeries</span>; there is only
a table qualifier, which is the user ID of the creator.</p>
</div>
<div class="section"><h4 class="sectiontitle">APPC communications setup</h4><p><span class="keyword">i5/OS™</span> communications must be configured
properly, with a controller and device created for the workstation when you
use APPC with either <span>DB2 Universal Database for Linux, UNIX and Windows</span> as
an AR, or with DB2 UDB
as an AS.</p>
</div>
<div class="section"><h4 class="sectiontitle">Set up the RDB directory</h4><p>When adding an entry in
the RDB directory for each DB2 UDB database that an iSeries server will connect to, use the <span class="cmdname">Add
Relational Database Directory Entry (ADDRDBDIRE)</span> command. The RDB
name is the UDB database name. </p>
<p>When using APPC communications, the
remote location name is the name of the workstation.</p>
<p>When using TCP/IP,
the remote location name is the domain name of the workstation, or its IP
address. The port used by the UDB DRDA server is typically not 446, the well-known DRDA port
that the <span class="keyword">iSeries server</span> uses (*DDM).</p>
<p>Consult
the UDB product documentation to determine the port number. A common value
used is 50000. An example DSPRDBDIRE screen showing a properly configured
RDB entry for a UDB server follows. </p>
<pre>Display Relational Database Detail
Relational database . . . . . . : SAMPLE
Remote location:
Remote location . . . . . . . : 9.5.36.17
Type . . . . . . . . . . . . : *IP
Port number or service name . : 50000
Text . . . . . . . . . . . . . . : My UDB server</pre>
</div>
<div class="section"><h4 class="sectiontitle">How do I create the NULLID packages used by DB2
UDB for Linux, UNIX and Windows and IBM<sup>®</sup> DB2 Universal Driver for SQLJ and JDBC?</h4><p>Before
using <span>DB2 Universal Database for Linux, UNIX and Windows</span> to
access data on <span class="keyword">DB2 UDB for iSeries</span>, you
must create SQL packages on the <span class="keyword">iSeries server</span> for
application programs and for the DB2 Universal Database for Linux, UNIX and Windows utilities.</p>
<p>The DB2 (PREP)
command can be used to process an application program source file with embedded
SQL. This processing will create a modified source file containing host language
calls for the SQL statements and it will, by default, create an SQL package
in the database you are currently connected to.</p>
<p>To bind DB2
Universal Database for Linux, UNIX and Windows to a <span class="keyword">DB2 UDB for iSeries</span> server:</p>
<ol><li>CONNECT TO rdbname</li>
<li>Bind path@ddcs400.lst BLOCKING ALL SQLERROR CONTINUE MESSAGES DDCS400.MGS
GRANT PUBLIC <p>Replace 'path' in the path@ddcs400.lst parameter above with
the default path C:\SQLLIB\BND\ (c:/sqllib/bin/ on non-INTEL platforms), or
with your value if you did not install to the default directory.</p>
</li>
<li>CONNECT RESET</li>
</ol>
</div>
<div class="section"><h4 class="sectiontitle">How do I set up the Interactive SQL packages?</h4><p>To
use Interactive SQL, you need the <span class="keyword">DB2 UDB Query Manager and SQL Development Kit</span> product
installed on <span class="keyword">i5/OS</span>. To
access data on DB2
Universal Database:</p>
<ol><li>When starting a session with STRSQL, use session attributes of NAMING(*SQL),
DATFMT(*ISO), and TIMFMT(*ISO). Other formats besides *ISO work, but not all,
and what is used for the date format (DATFMT) must also be used for the time
format (TIMFMT).</li>
<li>Note the correspondence between COLLECTIONs on the <span class="keyword">iSeries server</span>,
and table qualifier (the creator's user ID) for UDB.</li>
<li>For the first interactive session, you must do this sequence of SQL statements
to get a package created on UDB: (1) RELEASE ALL, (2) COMMIT, and (3) CONNECT
TO rdbname (where 'rdbname' is replaced with a particular database).</li>
</ol>
<p>As part of your setup for the use of Interactive SQL,
you might also want to use the statement GRANT EXECUTE ON PACKAGE QSQL400.QSQLabcd
TO PUBLIC (or to specific users), so that others can use the SQL PKG created
on the PC for Interactive SQL. The actual value for abcd in the following
GRANT statement can be determined from the following table, which gives the
package names for various sets of options that are in effect when the package
is created. For example, you would use the statement GRANT EXECUTE ON PACKAGE
QSQL400.QSQL0200 TO <var class="varname">some-user</var> if the following options
were in use when you created the package: *ISO for date, *ISO for time, *CS
for commitment control, a single quotation mark for string delimiter, and
single byte for character subtype.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="hsides" border="1" rules="rows"><thead align="left"><tr><th align="left" valign="top" width="10.616438356164384%" id="d0e393">Position</th>
<th align="left" valign="top" width="36.64383561643836%" id="d0e395">Option</th>
<th align="left" valign="top" width="52.73972602739726%" id="d0e397">Value</th>
</tr>
</thead>
<tbody><tr><td align="left" valign="top" width="10.616438356164384%" headers="d0e393 ">a</td>
<td align="left" valign="top" width="36.64383561643836%" headers="d0e395 ">Date Format</td>
<td align="left" valign="top" width="52.73972602739726%" headers="d0e397 ">0 = ISO, JIS date format 1 = USA date format 2 = EUR date
format</td>
</tr>
<tr><td align="left" valign="top" width="10.616438356164384%" headers="d0e393 ">b</td>
<td align="left" valign="top" width="36.64383561643836%" headers="d0e395 ">Time Format</td>
<td align="left" valign="top" width="52.73972602739726%" headers="d0e397 ">0 = JIS time format 1 = USA time format 2 = EUR, ISO time
format</td>
</tr>
<tr><td align="left" valign="top" width="10.616438356164384%" headers="d0e393 ">c</td>
<td align="left" valign="top" width="36.64383561643836%" headers="d0e395 ">Commitment Control Decimal Delimiter</td>
<td align="left" valign="top" width="52.73972602739726%" headers="d0e397 ">0 = *CS commitment control period decimal delimiter 1
= *CS commitment control comma decimal delimiter 2 = *RR commitment control
period decimal delimiter 3 = *RR commitment control comma decimal delimiter</td>
</tr>
<tr><td align="left" valign="top" width="10.616438356164384%" headers="d0e393 ">d</td>
<td align="left" valign="top" width="36.64383561643836%" headers="d0e395 ">String Delimiter Default Character Subtype</td>
<td align="left" valign="top" width="52.73972602739726%" headers="d0e397 ">0 = single quotation mark string delimiter, single byte
character subtype 1 = single quotation mark string delimiter, double byte
character subtype 2 = quotation marks string delimiter, single byte character
subtype 3 = quotation marks string delimiter, double byte character subtype</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="rbal1othertips__rbal1cursor"><a name="rbal1othertips__rbal1cursor"><!-- --></a><h4 class="sectiontitle">Close of queries</h4><p>DB2
Universal Database for Linux, UNIX and Windows now provides an option to request
that read locks be released when queries are closed either implicitly or explicitly.
It is not considered an error if the server does not honor the request, which
is the case for <span class="keyword">iSeries</span> servers. DB2
Universal Database for Linux, UNIX and Windows provides another new option
to specify whether the server should close the query implicitly for a non-scrollable
cursor when there are no more rows to read. Previously the server made this
decision. The <span class="keyword">iSeries</span> AS supports
this new feature in V5R3.</p>
</div>
<div class="section" id="rbal1othertips__rbal1idlength"><a name="rbal1othertips__rbal1idlength"><!-- --></a><h4 class="sectiontitle">What is the maximum length of user IDs
and passwords in a heterogeneous environment?</h4><p>DB2 UDB for iSeries running
as the application requester (AR) allows user IDs and passwords longer than
ten characters when running to an unlike application server (AS). The exact
limits are specified in the description of the specific interface being used.
For example, see the <a href="../db2/rbafzmst02.htm" target="_blank">SQL
reference</a> topic for limits on the SQL CONNECT statement.</p>
</div>
<div class="section"><h4 class="sectiontitle">Create Interactive SQL packages on DB2 UDB Server for VM</h4><p>On DB2
Universal Database Server for VM, a collection name is synonymous with
a user ID. To create packages to be used with Interactive SQL or <span class="keyword">iSeries</span> Query Manager on an DB2
Universal Database Server for VM application server, create a user ID
of QSQL400 on the <span class="keyword">i5/OS</span> operating
system. This user ID can be used to create all the necessary packages on the DB2
Universal Database Server for VM application server. Users can then use
their own user IDs to access DB2 Universal Database Server for
VM through Interactive SQL or <span class="keyword">iSeries</span> Query
Manager on <span class="keyword">i5/OS</span>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbal1xplat.htm" title="This topic collection concentrates on describing iSeries support for distributed relational databases in a network of iSeries servers (a like environment).">User FAQs</a></div>
</div>
</div>
</body>
</html>