DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL0443N Routine "SYSPROC.SNAPSHOT_TBS_CFG"(specific name "SNAPSHOT_TBS_CFG") has returned an error SQLSTATE with diagnostic text "SQL1611". SQLSTATE=38553
附脚本如下:
#!/bin/ksh
#
# before running this script ,the "bufferpool" monitor switch
# must be turned on by :
# db2_all "db2 update monitor switches using bufferpool on"
#
echo "Start at : $SNAP_TS"
db2 -tp-<<EOF
insert into cnc.sys_tbstat_log(snap_ts,partition_num,tbs_name,tbs_used_size,tbs_total_size)
select timestamp('$SNAP_TS'),0,tablespace_name as tbs_name,page_size * used_pages/1024/1024 as tbs_used_size,total_pages * page_size/1024/1024 as tbs_total_size
from table(snapshot_tbs_cfg('mydb',0)) as tbs
where tablespace_type = 0
union
select timestamp('$SNAP_TS'),1,tablespace_name as tbs_name,page_size * used_pages/1024/1024 as tbs_used_size,total_pages * page_size/1024/1024 as tbs_total_size
from table(snapshot_tbs_cfg('mydb',1)) as tbs
where tablespace_type = 0
union
select timestamp('$SNAP_TS'),2,tablespace_name as tbs_name,page_size * used_pages/1024/1024 as tbs_used_size,total_pages * page_size/1024/1024 as tbs_total_size
from table(snapshot_tbs_cfg('mydb',2)) as tbs
where tablespace_type = 0
union
select timestamp('$SNAP_TS'),3,tablespace_name as tbs_name,page_size * used_pages/1024/1024 as tbs_used_size,total_pages * page_size/1024/1024 as tbs_total_size
from table(snapshot_tbs_cfg('mydb',3)) as tbs
where tablespace_type = 0
;
EOF作者: mahongwei 时间: 2006-05-10 10:59
是没有数据返回吧, 系统函数没有取得数据,可能是系统问题作者: whiterain 时间: 2006-05-10 12:53
我知道了,和你这个cnc.sys_tbstat_log的结构有关系,是不是类型不一致,db2钟的数据类型不会自己转化作者: llouis 时间: 2006-05-10 14:38
应该不是数据类型的问题,否则怎么会有时成功,有时失败呢?!作者: llouis 时间: 2006-05-11 17:03 标题: Final answer to this question 根据IBM 800的回复及自己亲自做的一些试验,得出以下结论:
for PARTITION_NO in 0 1 2 3
do
export DB2NODE=$PARTITION_NO
db2 -v terminate
db2 -v connect to cncdb
db2 -tvp-<<EOF
insert into cnc.sys_tbstat_log(snap_ts,partition_num,tbs_name,tbs_used_size,tbs_total_size)
select timestamp('$SNAP_TS'),$PARTITION_NO,tablespace_name as tbs_name,page_size * used_pages/1024/1024 as tbs_used_size,total_pages * page_size/1024/1024 as tbs_total_size
from table(snapshot_tbs_cfg('cncdb',$PARTITION_NO)) as tbs
where tablespace_type = 0;
EOF