小笔记

1、
自动生成批处理文件

建文本文件:temp.sql

select 'runstats on table DB2.' || tabname || ' with distribution and detailed indexes all;' from syscat.tables where tabschema='DB2' and type='T';

db2 –tf temp.sql>runstats.sql

2、虚表
SELECT current date FROM (values 1) as a; --(values 1) as a 为虚表,相当于orcle的dual

3、查错误号
db2cmd-->db2 ? sql:(-433)错误号

4、重启
db2 force application all
db2stop
db2stop force

猜你喜欢

转载自kelivenlin.iteye.com/blog/1504144