Такая совместимая DB2

User avatar
BOBAH
Уже с Приветом
Posts: 9885
Joined: 18 Apr 2000 09:01
Location: Moscow -> VA -> Boston, MA

Post by BOBAH »

zVlad wrote:
Dmitry67 wrote:
zVlad wrote: - обязаны ли быть клиенты разных версий совметимы с разными версиями серверной части?
Зачем? Если всегда можно иметь правильную версию клиента и для этого не нужны никакие дополнительные усилия.


Нет
Бывает что один клиент работает с серверами разных версий одновременно.
Пример - DBA, который поддерживает все сервера и выполняет квери на них


What's wrong in having few clients on the same workstation?


Я не пробовал поставить двух разных клиентов DB2 на NT, но я почему-то уверен что ничего хорошего из этого не выйдет.
User avatar
Dmitry67
Уже с Приветом
Posts: 28294
Joined: 29 Aug 2000 09:01
Location: SPB --> Gloucester, MA, US --> SPB --> Paris

Post by Dmitry67 »

zVlad wrote:What's wrong in having few clients on the same workstation?


Потмоу что часто это невозможно

Ну например вы используете ODBC. МОжет там и можно подсовывать разные DLL, но если у вас есть уже аппликация третьей фирмы, которая сама создает ODBC datasources ?

В понимании M£ connectivity - это некий софтовый пакет который глобален для компа

У этого подходы есть плюсы и минусы
Зарегистрированный нацпредатель, удостоверение N 19719876044787 от 22.09.2014
zVlad
Уже с Приветом
Posts: 15409
Joined: 30 Apr 2003 16:43

Post by zVlad »

BOBAH wrote:
zVlad wrote:
Dmitry67 wrote:
zVlad wrote: - обязаны ли быть клиенты разных версий совметимы с разными версиями серверной части?
Зачем? Если всегда можно иметь правильную версию клиента и для этого не нужны никакие дополнительные усилия.


Нет
Бывает что один клиент работает с серверами разных версий одновременно.
Пример - DBA, который поддерживает все сервера и выполняет квери на них


What's wrong in having few clients on the same workstation?


Я не пробовал поставить двух разных клиентов DB2 на NT, но я почему-то уверен что ничего хорошего из этого не выйдет.


I couldn't find direct instructions for multiple clients (I have no much time). What I was able to find in manuals are:

"Chapter 1. DB2 clients overview
DB2 clients
There are three types of DB2 ® clients:
v Run-Time Client
v Administration Client
v Application Development Client
DB2 clients can connect to DB2 servers two releases later or one release earlier
than the client’s release level, as well as to servers at the same release level.
This means that a DB2 Version 6 client can connect to DB2 servers at versions
5, 6, 7, and 8."

"Chapter 4. Configuration scenarios
Supported and non-supported client configuration scenarios
This section describes both the supported and non-supported configuration
scenarios for clients and servers.
Supported standard and gateway configuration scenarios
The following table describes the standard and gateway configuration support
for DB2 clients. For example, if you have a DB2 UDB Version 8 32-bit client,
you can connect to a DB2 UDB Version 8 64-bit server using a Version 8 32-bit
gateway:"

"Thin clients
A thin client refers to a DB2 ® Administration Client that runs its applications
from a code server across a network. A thin client can be set up by installing a
DB2 Administration client or DB2 Connect Personal Edition (PE) on a
workstation running a Windows ® 32-bit operating system. This workstation
can then act as a code server that allows the application to run with only the
immediately necessary modules at the client."
User avatar
WildVlad
Уже с Приветом
Posts: 3982
Joined: 13 Jul 2000 09:01
Location: SVX -> BOS -> BUR -> SJC

Post by WildVlad »

zVlad wrote: Вы хотите сказать, WildVlad, что Java дрова, предназначенные для скажем AS/400, плохо работают (или вовсе не работают) если их использовать для zOS?

ДА. Именно так. Абсолютно разные дрова. Одинаковые только имена классов драйверов, да и то, этого они добились применением заглушек вида
DB2Driver extends DB2SQLJOS390Driver {}; (Ну или что-то типа того)
I hated LA
zVlad
Уже с Приветом
Posts: 15409
Joined: 30 Apr 2003 16:43

Post by zVlad »

WildVlad wrote:
zVlad wrote: Вы хотите сказать, WildVlad, что Java дрова, предназначенные для скажем AS/400, плохо работают (или вовсе не работают) если их использовать для zOS?

ДА. Именно так. Абсолютно разные дрова. Одинаковые только имена классов драйверов, да и то, этого они добились применением заглушек вида
DB2Driver extends DB2SQLJOS390Driver {}; (Ну или что-то типа того)


Please correct me if I say wrong.
And you want to run OS/390 JDBC against AS/400 database. Why?
User avatar
WildVlad
Уже с Приветом
Posts: 3982
Joined: 13 Jul 2000 09:01
Location: SVX -> BOS -> BUR -> SJC

Post by WildVlad »

zVlad wrote:Please correct me if I say wrong.
And you want to run OS/390 JDBC against AS/400 database. Why?

Вы меня не правильно поняли. Я не пытаюсь из-под z/OS подцепиться к AS/400. Более того, используя z/OS-овские дрова это возможно.

Объясню более подробно. Одна из основных фишек DB2 v 8 UDB (а понятие UDB включает в себя и DB2 for z/OS, если что) было наличие так называемых JDBC Type 4 дров, обладающих следующими характеристиками:

1. Писаны целиком на Java без использования нативных библиотек.
2. Работают по DRDA протоколу, умеют коннектиться к UDB на любой платформе, если есть лицензия. То есть отпадает необходимость каталогизовать базы на клиенте, вместо этого в параметрах коннекции просто указывается хост, порт и имя базы.

На проверку дрова поставляемый для Windows платформы сумели подцепиться ко всем остальным DB2 v8 на разных платформах. Они даже смогли подцепиться и к 7ым базам, но там не смогли запускать статические запросы.

Идилия продолжалась до того момента пока не посмотрели что на z/OS IBM поставляет СОВЕРШЕННО другую версию java-кода для дров (как не вспомнить про "написано один раз - не работает ни где" :mrgreen:). Спрашивается чего им не хватило виндовской версии дров? Более того, запустить виндовские дрова на z/OS не получилось - чего то типа не хватило (есть смутное подозрение на EBCDIC, но это может быть и не так).

Идём дальше. IBM от нас потребовала использования статических запросов из Java. Это можно добиться только используя SQLJ (типа java-программа с эмбеднутыми в неё SQL-запросами). Далее на .sqlj-файл натравливается SQLJ-компилятор, который создаёт .java (или сразу .class) и .ser файл. Первый - это java-код по работе с запросами, второй - сами запросы в сериализованном формате. После чего натравливается SQLJCustomizer, который биндит пакеты в базу, меняя по ходу дела .ser файл. Все счастливы, пока использую ОДНУ версию DB2.

Далее идёт веселье:

1. SQLJ-файл построенный в расчёте на SQLJCompiler + SQLJCustomizer идущие с DB2 UDB 7 НЕ ПОДХОДИТ для DB2 UDB v8'ных. Имеем непереносимость на уровне исходников. Хотя изначально задумывалась бинарная совместимость .class/.ser с необходимостью натравить SQLJCustomizer, который забиндит пакеты по этой паре файлов на базу (только на этом этапе допускалась несовместимость) и всё путём.

2. Апофигеоз SQLJ-несовместимости наступает на DB2 v 8 (кстати, IBM оффициально это признала). .class/.ser файлы, откомпилённые используя SQLJ-компилятор (100% написан на java) под Windows'ом не будут кастомизиться на z/OS (то есть такая программа не может быть запущена на z/OS, но прекрасно будет работать под Windows и даже уметь коннектиться к DB2 for z/OS). Для того чтобы забиндить пакеты из-под z/OS (и программа и база живут на z/OS) необходимо запустить SQLJ-компилятор под z/OS'ом - да, да пойти в зелёные буковки на чёрном фоне (ну ладно пойти в USS), и всё это типа java - written once works neverwhere :)

А билд-процесс у нас типа на windows-машине... Или может программу в сырцах шипить? Так ведь сама IBM не поймёт такой наглости от нас.

Примечание:
I hated LA
Lazy44
Уже с Приветом
Posts: 525
Joined: 01 May 2002 20:29
Location: CT->MA->TX->UT

Post by Lazy44 »

zVlad wrote:
Lazy44 wrote:
zVlad wrote:
- обязаны ли быть клиенты разных версий совметимы с разными версиями серверной части?


I just asked our DBA. He said he is using Oracle 9i client to connect to Oracle 7.3.4, Oracle 8.0.4, Oracle 8i (8.1.7.2) and Oracle 9i.

You can connect to Oracle 9i using Oracle 8 client. It is working and supported. You can connect to Oracle9iR1 using Oracle 7 client. It is working . However it is not supporting :)

PS DB2 must die :mrgreen:


For me it means that just interface between Oracle server and Oracle client has never been changed, Oracle client could be just simple pipe to send text from client application to server and vice versa. Which is might be good might be not good, depends on.


Ну и что? У нас установлены клиенты на 23 тысячах машин от Oracle и DB2. База Оракл апгрейдится по мере надобности, клиенты новые ставятся последней версии Оракл на новые компьютеры.. Все работает. ДБ2 на мэйнфрейме не апгрейдилась со времен царя гороха. Сейчас я понимаю, почему - кроме базы надо апгрейдить клиентов, а это за разумное время не сделать.
zVlad
Уже с Приветом
Posts: 15409
Joined: 30 Apr 2003 16:43

Post by zVlad »

WildVlad wrote:...

Вы меня не правильно поняли. Я не пытаюсь из-под z/OS подцепиться к AS/400. Более того, используя z/OS-овские дрова это возможно.

.........:


I found on IBMLink (see below). Two links mentioned there:


http://www.ibm.com/software/data/pubs/papers/sqlj/

http://www.stldug.org/pdfs/Vonau.pdf

IBMLink gives:


"Item RTA000174817
Source..........: US DASYS
Last updated....: 08/19/2003
Abstract........: SQLJ Compilation Issues - workstation development - run on z/OS
Q:
Topic thread:
WebSphere and OS390 Servers (WAS390-WEB TECH SALES)
Wepsphere Application Servers for z/OS and OS/390
V4 (Enterprise Edition)

I have a customer developing WebSphere Applications for zOS WAS
4.01. To improve performance the application is using SQLJ to make
calls to DB2. When you use SQLJ with DIRECT BIND option, you must use
DB2 tools "dbprofc.sh" to generate what is known as DBRMLIB entries
for each SQLJ program that will contain the instructions to directly
bind the SQL to the database. DBRMLIBs are PDSs and can only be
generated on 390 (i.e. not portable)
The customer is really up in arms about the 390 Java compile
performance. IBMs 390 JAVA strategy is to develop on a workstation and
run on the mainframe. I am not sure where do go with this but can you
help me find out what recommendations I can make to the customer.
A:
The answer is complicated and I hope you will allow me to back
track somewhat. As of this moment, the SQLJ translator
produces uncustomized .ser file output as well as the input to the
javac. The customization which must occur if SQLJ is to be statically
bound must take place on z/OS. db2profc is run and produces the
customized profile (.ser) and DBRMs. The DBRMs are bound into packages
and the .ser file must be sent back to wherever the application is being
developed (typically WSAD). The .ser file is then packaged into
an .ear file for deployment. I am just recapping what happens today.

There are better times ahead, soon. There is currently a Java
Universal Driver available with DB2 for Multiplatforms (both type
2 and Type 4 drivers).The manner of generating SQLJ will be
changed drastically as is the .ser file. The key is the word
"universal", as the driver to be "universal" across the DB2 family.
That is, it will be the same code executing across all platforms, so
behaviors will be the same.

A new way of creating SQLJ will be universal across the DB2 family.
A new SQLJ translator will produce a portable .ser as well as the input
to javac. db2profc is replaced by a new utility, db2customize that
will customize the profile for the 390 platform while it is on the
workstation. It will bind the packages directly from the
workstation to zDB2. There will be no more DBRMs produced.

The Type 4 Universal Driver has Application Requester code built in
and therefore, from a workstation, has the ability to use DRDA to
connect to zDB2, customize and bind WITHOUT using DB2 Connect as
a conduit. For this functionality the Type 4 driver will be required.

So that takes care of the portability of the SQLJ. And the
.ser remains on the workstation. What else is needed? Help from
WSAD. WSAD 5.1, announced 8/05/03, is expected to provide support
for SQLJ, as a recognized object, and the capability for the developer
to remain on WSAD as he creates SQLJ, invokes the translator and
customizer. WSAD 5.1 is available during August, 2003. And you just
need the "base" WSAD.

These are the WSAD 5.1 functions in support of SQLJ:
Version 5.1 adds SQLJ wizards, editor, and builder support
1. Wizard creates a new SQLJ file in a "Java" project (Web, EJB)
2. Editor extends the Java editor to understand the SQLJ syntax
3. SQLJ errors will appear in the task list
4. The SQLJ translator will be run automatically (as a Studio builder)
It generates the .SER file and Java files
5. Generates Ant script for execution of the profiling operation
6. Can debug SQLJ at a source level (SQLJ files, not generated
Java files)
7. Has wizards to create a new Stored Procedure
8. Includes user selected predefined fragments to simplify creation
9. Editor can view and manipulate the stored procedure
10.Procedure can be built, debugged and executed from Studio
Session EJB or Java bean can be generated to invoke the Procedure

The Universal Driver will be provided in DB2 for z/OS V8 (no announced
GA) and will be retrofitted into the current DB2 for OS/390 V7 via the
service stream. It is planned to be available by year end (2003), but
as with plans, unexpected events can prevent it.

I can't offer your customer relief instantly, but IBM recognizes the
process is cumbersome at best, and I wanted to give you hope.

Q:
Thank you so much for the comprehensive answer below. One point of
clarification. Is this new universal driver going to require
WebSphere V5 with the SKD 1.4?
A:
No. It requires SDK/JDK 1.3. Support is planned for WAS
V5, as WSAD 5.1 aligns with WAS V5.0.2. I don't know if I mentioned
it but the Universal Driver by year end will also be JDBC 3.0
compliant. The main source for the Universal Driver is the README at
http://www.ibm.com/software/data/pubs/papers/sqlj/

A good presentation on it, though I think it is for Universal Driver
V1 is on
http://www.stldug.org/pdfs/Vonau.pdf

Actually I did a Google search on: DB2 Universal Driver SQLJ
and found the above presentation and some other info. Scanning the
articles, I observed most of them are for the V1.0 driver which provided
only the Type 4 driver.

S e a r c h - k e y w o r d s:
Java .ser .ear WSAD WAS V5 WebSphere db2profc db2customize classes
DB2 SPB wizard BIND DBRM"
zVlad
Уже с Приветом
Posts: 15409
Joined: 30 Apr 2003 16:43

Post by zVlad »

Lazy44 wrote:..... ДБ2 на мэйнфрейме не апгрейдилась со времен царя гороха. Сейчас я понимаю, почему - кроме базы надо апгрейдить клиентов, а это за разумное время не сделать.


You would never believe me but in most common architecture for DB2 on mainframe it doesn't need any client to be installed on workstation. CICS is used for that and TCP/IP.
When we upgraded our DB2, couple years ago, nothing needed to be changed for clients at all.

I suspect, the reason why your DB2 has never been upgraded is different.
As I explaned above, with proper FixPacks you can have compatibility:

"...DB2 clients can connect to DB2 servers two releases later or one release earlier
than the client’s release level, as well as to servers at the same release level.
This means that a DB2 Version 6 client can connect to DB2 servers at versions
5, 6, 7, and 8."
User avatar
WildVlad
Уже с Приветом
Posts: 3982
Joined: 13 Jul 2000 09:01
Location: SVX -> BOS -> BUR -> SJC

Post by WildVlad »

zVlad wrote: I found on IBMLink (see below). Two links mentioned there:
http://www.ibm.com/software/data/pubs/papers/sqlj/
http://www.stldug.org/pdfs/Vonau.pdf

IBMLink gives:

...

There are better times ahead, soon. There is currently a Java
Universal Driver available with DB2 for Multiplatforms (both type
2 and Type 4 drivers).The manner of generating SQLJ will be
changed drastically as is the .ser file. The key is the word
"universal", as the driver to be "universal" across the DB2 family.
That is, it will be the same code executing across all platforms, so
behaviors will be the same.

A new way of creating SQLJ will be universal across the DB2 family.
A new SQLJ translator will produce a portable .ser as well as the input
to javac. db2profc is replaced by a new utility, db2customize that
will customize the profile for the 390 platform while it is on the
workstation. It will bind the packages directly from the
workstation to zDB2. There will be no more DBRMs produced.

The Type 4 Universal Driver has Application Requester code built in
and therefore, from a workstation, has the ability to use DRDA to
connect to zDB2, customize and bind WITHOUT using DB2 Connect as
a conduit. For this functionality the Type 4 driver will be required.

...


Это теория. На практике выходит вот что (я немного не точно выразился в предыдущем посте):

1 .ser-файлы совместимы, если пользоваться DB2 JDBC v8 Type 4 драйвер. Однако, они не совместимы (ни в одну сторону) с 7.2-драйвером, а также с v8 Type 2 драйвером for z/OS. То есть несовместимость наблюдается даже для одной и той же версии драйвера.

2. IBM это признала и советует для DB2 JDBC v8 Type 2 driver for z/OS проводить SQLJ-компиляцию (создавать ser'ы) прямо под z/OS'ом. Кстати, эта инофрмация гораздо свежее (датирована этим годом), чем приведённая ссылка.

В результате мы компилим SQLJ-файл (я погорячился, на уровне sqlj-исходников они совместимы) 2 раза, используя SQLJ-компиляторы из v7 и v8 type4 драйверов (надо сказать выглядит это довольно эротично), а v8 Type2 не поддерживаем потому как несовместимость под z/OS'ом наблюдается.
I hated LA
User avatar
WildVlad
Уже с Приветом
Posts: 3982
Joined: 13 Jul 2000 09:01
Location: SVX -> BOS -> BUR -> SJC

Post by WildVlad »

zVlad wrote:"...DB2 clients can connect to DB2 servers two releases later or one release earlier
than the client’s release level, as well as to servers at the same release level.
This means that a DB2 Version 6 client can connect to DB2 servers at versions
5, 6, 7, and 8."

If you apply latest fixpack both to the client and server, as in case v8 client -> v7 Db2
I hated LA
User avatar
BOBAH
Уже с Приветом
Posts: 9885
Joined: 18 Apr 2000 09:01
Location: Moscow -> VA -> Boston, MA

Post by BOBAH »

zVlad wrote: As I explaned above, with proper FixPacks you can have compatibility:

"...DB2 clients can connect to DB2 servers two releases later or one release earlier
than the client’s release level, as well as to servers at the same release level.
This means that a DB2 Version 6 client can connect to DB2 servers at versions
5, 6, 7, and 8."


Согласно этой цитате клиент версии 8 должен работать с серверами версии 7. На практике это не так.
zVlad
Уже с Приветом
Posts: 15409
Joined: 30 Apr 2003 16:43

Post by zVlad »

BOBAH wrote:
zVlad wrote: As I explaned above, with proper FixPacks you can have compatibility:

"...DB2 clients can connect to DB2 servers two releases later or one release earlier
than the client’s release level, as well as to servers at the same release level.
This means that a DB2 Version 6 client can connect to DB2 servers at versions
5, 6, 7, and 8."


Согласно этой цитате клиент версии 8 должен работать с серверами версии 7. На практике это не так.


Самое время требовать с ИБМ-а сатисфакции. Цитата мною взята из вполне официального документа. В лицензионном соглашении должны быть слова типа "ИБМ гарантирует соответствие спецификациям....если не так ... до $100,000 возврат". Но скорее всего там также есть слова о FixPack-ах.
Кстати, а не пробовали клиента 7 коннектить к версии 8?
User avatar
WildVlad
Уже с Приветом
Posts: 3982
Joined: 13 Jul 2000 09:01
Location: SVX -> BOS -> BUR -> SJC

Post by WildVlad »

zVlad wrote:Кстати, а не пробовали клиента 7 коннектить к версии 8?

Пробовали. В динамическом режиме работает. Статические запросы (sqlj) не хотят :mrgreen:
I hated LA
zVlad
Уже с Приветом
Posts: 15409
Joined: 30 Apr 2003 16:43

Post by zVlad »

BOBAH wrote:......
А что касается Вашего, zVlad, ответа мне, то единственное с чем я могу согласиться это с тем, что документацию надо было читать внимательнее.


Вы знаете ВОВАН, когда я это осознал много лет назад мне стало жить намного легче. Как показывает мне моя практика, в документации ИБМ есть ответы почти на все вопросы. Если же есть также доступ к IBMLink, Вы вообще можете почувствовать себя непобедимым.

Return to “Вопросы и новости IT”