How to configure ODBC DSN in Client to access remote 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

 

 

 

    

1       Get 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:winntsystem32drivers in windows 2000 or c:windowssystem32drivers 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 .

 

 

 

 

2       Configure 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.

 

 

 

 

3       Access 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 http://xiazai.zol.com.cn/download_order/sub_550.html . In most case it lies the top 20 and it has been download more than 94,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 

 

 

 


DB Query Analyzer 5.03 download URL: 

http://xiazai.zol.com.cn/detail/43/420901.shtml

http://www.unitedpowersoft.com/UpFile/DBQueryAnalyzer_English_503.rar

  


DB Query Analyzer Simplified Chinese version 5.03  download URL:

http://xiazai.zol.com.cn/detail/27/264455.shtml

 

 

 

 

Remarks :

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

 DB Query Analyzer

 

 

 

My blog is http://blog.csdn.net/magenfeng

http://blog.sina.com.cn/magenfeng

         http://user.qzone.qq.com/630414817




原文地址:https://www.cnblogs.com/wuyida/p/6300750.html