How to access DB2 server by using a SQL Server linked server

Source: Internet
Author: User
Tags connection pooling db2 db2 connect db2 connect to ole

First, you need to install Microsoft OLE DB Provider for DB2

: Http://download.microsoft.com/download/B/B/2/BB22098A-C071-415F-9269-2EB26CEFB562/DB2OLEDB_CN.exe
After installation, the menu has one more item:

Next, run the data Access tool to configure it in detail.

Assume that the configuration information for DB2 is as follows

Accessible Database address: Jdbc:db2://10.18.50.149:50000/bpmdb
User name: Db2admin
Password: db2admin

Describes the character set for the fifth step:

Host CCSID can be learned through the following commands.

DB2 Connect to BPMDB user db2admin using Db2admin
DB2 get DB CFG for BPMDB query result: C:\IBM\BPM\V8.5\DB2\BIN>DB2 connect to BPMDB user db2admin using Db2admin

Database connection Information

Database Server = Db2/nt64 10.1.1
SQL Authorization id = db2admin
Local Database alias = BPMDB


C:\IBM\BPM\V8.5\DB2\BIN>DB2 get db cfg for BPMDB

Database configuration for Database BPMDB

Database configuration Release level = 0X0F00
Database Release level = 0X0F00

Database geography = US
Database code page = 1208
Database Code set = UTF-8
Database country/Region code = 1
Database Grooming order = IDENTITY
Alternate collating order (alt_collate) =
Digital compatibility = OFF PC code page, can be learned by the following actions.

The 12th step of the string is needed.

Provider=db2oledb; User id=db2admin; Password=db2admin;initial Catalog=bpmdb; Network Transport library=tcp; Host ccsid=1208; PC Code page=936; Network address=10.18.50.149; Network port=50000; Package Collection=bpmdb; Process Binary as Character=false; Units of Work=ruw;dbms Platform=db2/mvs;defer Prepare=false; Rowset Cache size=0; Persist Security info=true; Connection pooling=false;derive Parameters=false;

Finally the time to configure the linked server, continue to walk.

Added successfully, can see linked server heathernet

Test Linked server query data

The query is normal, can display the Chinese text field.

Tip: If the 5th step character set is improperly configured, it will cause the Chinese text segment name to not display correctly and will always prompt that the field does not exist.

Msg 7339, Level 16, State 1, line 1th
OLE DB provider ' db2oledb ' for linked server ' heathernet ' returned invalid data for column ' [Heathernet]. [BPMDB]. [Db2admin]. [V_user_mapping]. Position_name '.

The following are the correctly configured query results

At this point, DB2 's linked server is built.

How to access DB2 server by using a SQL Server linked server

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.