通信系统连接db2数据库使用的是配置文件,用的不是db2 编目的方法。
db2inst1@TEST_APP1 $ db2cli validate -dsn TESTDSN
===============================================================================
Client information for the current copy:
===============================================================================
Client Package Type : IBM Data Server Client
Client Version (level/bit): DB2 v10.5.0.0 (s130528/64-bit)
Client Platform : AIX 64BIT
Install/Instance Path : /opt/IBM/db2/V10.5
DB2DSDRIVER_CFG_PATH value: <not-set>
db2dsdriver.cfg Path : /home/db2inst1/sqllib/cfg/db2dsdriver.cfg
DB2CLIINIPATH value : <not-set>
db2cli.ini Path : /home/db2inst1/sqllib/cfg/db2cli.ini
db2diag.log Path : /home/db2inst1/sqllib/db2dump/db2diag.log
===============================================================================
db2dsdriver.cfg schema validation for the entire file:
===============================================================================
Success: The schema validation completed successfully without any errors.
===============================================================================
db2cli.ini validation for data source name "TESTDSN":
===============================================================================
[ Keywords used for the connection ]
Keyword Value
---------------------------------------------------------------------------
TABLETYPE TABLE
AUTOCOMMIT 0
===============================================================================
db2dsdriver.cfg validation for data source name "TESTDSN":
===============================================================================
[WARNING] Database entry for dsn is missing in IBM Data Server Configuration
file.
===============================================================================
[ Parameters used for the connection ]
Keywords Valid For Value
---------------------------------------------------------------------------
DATABASE CLI,.NET,ESQL TEST
HOSTNAME CLI,.NET,ESQL TEST_DB1
PORT CLI,.NET,ESQL 60000
COMMPROTOCOL CLI TCPIP
USERID CLI,.NET userdbs
PASSWORD CLI,.NET *******
===============================================================================
The validation is completed.
===============================================================================
db2inst1@TEST_APP1 $ echo "select count(1) from syscat.tables"|db2cli execsql -dsn testdsn
IBM DATABASE 2 Interactive CLI Sample Program
(C) COPYRIGHT International Business Machines Corp. 1993,1996
All Rights Reserved
Licensed Materials - Property of IBM
US Government Users Restricted Rights - Use, duplication or
disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
> select count(1) from syscat.tables
FetchAll: Columns: 1
1
1103
FetchAll: 1 rows fetched.