Monday, March 12, 2012

How to config a linked server from SQL to DB2

I have a DB2 database 7.2.
(
Server Host Name = SVR1,
Database name = PROD,
schema name = db2admin,
Port number = 50000)
How can I config a linked server to this DB2 database from
SQL. I check the doc find the sample like this:
EXEC sp_addlinkedserver
@.server='DB2',
@.srvproduct='Microsoft OLE DB Provider for DB2',
@.catalog='DB2',
@.provider='DB2OLEDB',
@.provstr='Initial Catalog=PUBS;Data
Source=DB2;HostCCSID=1252;Network Address=XYZ;Network
Port=50000;Package Collection=admin;Default Schema=admin;'
I have a little bit confuse with the connect string
@.provstr, anybody can tell me how to mapping my DB2
information to this @.provstr?
I try this wouldn't work
@.provstr='Initial
Catalog=PROD;DataSource=DB2;HostCCSID=1252;Network
Address=SVR1;Network Port=50000;Package
Collection=db2admin;Default Schema=db2admin;'
I got error message: Error 7403: Could not locate registry
entry for OLE DB provider 'DB2OLEDB' OLE DB error trace
[Non-interface error: Provider not registered]
Thanks,
HGDo u have DB2 client installed in your machine,
Thanks
Hari
MCDBA
"HG" <Hansen.gu@.aegoncanada.ca> wrote in message
news:008401c3ae0b$069335d0$a101280a@.phx.gbl...
> I have a DB2 database 7.2.
>
> Server Host Name = SVR1,
> Database name = PROD,
> schema name = db2admin,
> Port number = 50000)
> How can I config a linked server to this DB2 database from
> SQL. I check the doc find the sample like this:
> EXEC sp_addlinkedserver
> @.server='DB2',
> @.srvproduct='Microsoft OLE DB Provider for DB2',
> @.catalog='DB2',
> @.provider='DB2OLEDB',
> @.provstr='Initial Catalog=PUBS;Data
> Source=DB2;HostCCSID=1252;Network Address=XYZ;Network
> Port=50000;Package Collection=admin;Default Schema=admin;'
>
> I have a little bit confuse with the connect string
> @.provstr, anybody can tell me how to mapping my DB2
> information to this @.provstr?
> I try this wouldn't work
> @.provstr='Initial
> Catalog=PROD;DataSource=DB2;HostCCSID=1252;Network
> Address=SVR1;Network Port=50000;Package
> Collection=db2admin;Default Schema=db2admin;'
> I got error message: Error 7403: Could not locate registry
> entry for OLE DB provider 'DB2OLEDB' OLE DB error trace
> [Non-interface error: Provider not registered]
> Thanks,
> HG|||Yes, I do have DB2 client installed locally.
>--Original Message--
>Do u have DB2 client installed in your machine,
>Thanks
>Hari
>MCDBA
>"HG" <Hansen.gu@.aegoncanada.ca> wrote in message
>news:008401c3ae0b$069335d0$a101280a@.phx.gbl...
>> I have a DB2 database 7.2.
>> Server Host Name = SVR1,
>> Database name = PROD,
>> schema name = db2admin,
>> Port number = 50000)
>> How can I config a linked server to this DB2 database
from
>> SQL. I check the doc find the sample like this:
>> EXEC sp_addlinkedserver
>> @.server='DB2',
>> @.srvproduct='Microsoft OLE DB Provider for DB2',
>> @.catalog='DB2',
>> @.provider='DB2OLEDB',
>> @.provstr='Initial Catalog=PUBS;Data
>> Source=DB2;HostCCSID=1252;Network Address=XYZ;Network
>> Port=50000;Package Collection=admin;Default
Schema=admin;'
>>
>> I have a little bit confuse with the connect string
>> @.provstr, anybody can tell me how to mapping my DB2
>> information to this @.provstr?
>> I try this wouldn't work
>> @.provstr='Initial
>> Catalog=PROD;DataSource=DB2;HostCCSID=1252;Network
>> Address=SVR1;Network Port=50000;Package
>> Collection=db2admin;Default Schema=db2admin;'
>> I got error message: Error 7403: Could not locate
registry
>> entry for OLE DB provider 'DB2OLEDB' OLE DB error trace
>> [Non-interface error: Provider not registered]
>> Thanks,
>> HG
>
>.
>

No comments:

Post a Comment