文档库 最新最全的文档下载
当前位置:文档库 › How to configure ODBC DSN in Client to access DB2 for Windows

How to configure ODBC DSN in Client to access DB2 for Windows

How to configure ODBC DSN in Client to access DB2 for Windows
How to configure ODBC DSN in Client to access DB2 for Windows

How to configure ODBC DSN in Client to access remote DB2 for Windows

MA Gen feng

(Guangdong Unitoll Services incorporated, Guangzhou 510300)

Abstract This article introduces how to configure ODBC DSN in Client to access remote DB2 for windows in detail. Then I give a sample how to access remote

DB2 database with ODBC by DB Query Analyzer expediently.

It’s also applicable to configure ODBC DSN to access remote DB2 for other OS such as Aix, Linux, Solaris and so on.

Key words ODBC; DB Query Analyzer; DB2

1Get port number of DB2 instance

We should get port number of DB2 instance at first. Please run db2 command line process, then input ‘DB2 get dbm cfg |find "SVCENAME" ’to get the SVCENAME db2c_DB2 of DB2 TCP/IP.

Figure 1 Get the SVCENAME db2c_DB2 of DB2 TCP/IP

Click on Start -> Run and type drivers to locate the directory c:\winnt\system32\drivers in

windows 2000 or c:\windows\system32\drivers in Windows XP or Win7 and so on. Then open the sub directory etc and open the file services. This is shown in Figure 2.

Figure 2 Locate and open file services

Then you’ll see the port number of db2c_DB2 is 50000 .

2Configure ODBC DSN in Client

Open the DB2 configuration Assistant first and then start to configure ODBC DSN as it’s shown from Figure 3 to Figure 11.

Figure 3 Configure ODBC DSN with DB2 configuration Assistant

Figure 4 Configure ODBC DSN with DB2 configuration Assistant

Figure 5 Configure ODBC DSN with DB2 configuration Assistant

Figure 6 Configure ODBC DSN with DB2 configuration Assistant

Figure 7 Configure ODBC DSN with DB2 configuration Assistant

Figure 8 Configure ODBC DSN with DB2 configuration Assistant

In the drop-down list box ,select OS to configure ODBC DSN to access remote DB2 for

other OS such as Windows, Aix, Linux, Solaris and so on.

Figure 9 Configure ODBC DSN with DB2 configuration Assistant

Figure 10 Configure ODBC DSN with DB2 configuration Assistant

Figure 11 Configure ODBC DSN with DB2 configuration Assistant

Finally, Click button ‘Finish’ to end the process.

3Access DB2 database with DB Query Analyzer

DB Query Analyzer is presented by Master Gen feng, Ma from Chinese Mainland. It has English version named ‘DB Query Analyzer’ and Simplified Chinese version named ‘万能数据库查询分析器(DB 查询分析器)’.

DB Query Analyzer is one of the few excellent Client Tools in the world for its’ powerful function, friendly interface, easy operation and applicability to every production of RDBMS.

It lets you query ODBC data sources, author SQL scripts and queries, return query results to a grid or free-form text or a file, retrieve ODBC driver information, execute multiple SQL scripts or stored procedures simultaneously, and more.

In the New products & Tools reviews of programmer second issue of 2007, DB Query Analyzer had been strongly recommended.

Now the Simplified Chinese version of DB Query Analyzer is the top 50 database application software in the famous software website https://www.wendangku.net/doc/e11507653.html,/download_order/sub_550.html . In most case it lies the top 20 and it has been download more than 92,000 times.

Download and install DB Query Analyzer. Then run it and input the DSN ’MGF_DB1’,UserName and Password.

Figure 12 Run DB Query Analzyer

Figure 13 Object View in DB Query Analyzer and fast SQL Script program

Remarks :

Please uninstall the former version first, then install the latest version.

相关文档