Skip to main content

DB2 管理

執行 SQL 時顯示開始與結束時間
select 'Begin Time:',char(current date,iso)||' '||char(current time,iso) from sysibm.sysdummy1;
--
--
select 'End Time:',char(current date,iso)||' '||char(current time,iso) from sysibm.sysdummy1; 
快速產生所有資料表的 runstats 腳本
db2 -x "select 'runstats on table',substr(rtrim(tabschema)||'.'||rtrim(tabname),1,35),'with distribution and detailed indexes all allow write access;'from syscat.tables where type = 'T' and tabschema not in ('SYSIBM','ASN')" > runstats_all.sql