现象:
TESTDB1:/#>
su - db2inst3
$
db2 call “GET_DBSIZE_INFO(?,?,?,0)”
ksh: 0403-057 Syntax error: `(' is not expected.
$
exit
TESTDB1:/#>
exit
解决方法:
TESTDB1:/#>
su - db2inst3
$
db2 list db directory
System Database Directory
Number of entries in the directory = 1
Database 1 entry:
Database alias = TEST
Database name = TEST
Local database directory = /db2data/TEST
Database release level = d.00
Comment =
Directory entry type = Indirect
Catalog database partition number = 0
Alternate server hostname =
Alternate server port number =
$
db2 "call GET_DBSIZE_INFO(?,?,?,0)"
SQL1024N A database connection does not exist. SQLSTATE=08003
$
db2 connect to TEST ----------------问题就在于统计数据库的时候,应该首先连接数据库,不要被细节打败!
Database Connection Information
Database server = DB2/AIX64 9.7.7
SQL authorization ID = DB2INST3
Local database alias = TEST
$
db2 "call GET_DBSIZE_INFO(?,?,?,0)"
Value of output parameters
--------------------------
Parameter Name : SNAPSHOTTIMESTAMP
Parameter Value : 2014-05-22-16.02.28.993761
Parameter Name : DATABASESIZE
--------------数据库已使用大小
Parameter Value : 515252224
Parameter Name : DATABASECAPACITY
--------------数据库总容量
Parameter Value : 10114924544
Return Status = 0
$
阅读(9197) | 评论(0) | 转发(0) |