輸入。 用來指定統計值選項的位元遮罩欄位。 有效值 (定義在db2ApiDf標頭檔中,位於include目錄) 如下: DB2RUNSTATS_ALL_COLUMNS 收集表格或統計視圖所有直欄的統計資料。 此選項可與直欄、直欄配送、直欄群組或索引結構清單一起指定。 如果您想要收集表格或視圖的所有直欄的統計資料,但想要提供特定直欄的統計資料...
例如,如果您使用EXCLUDING XML COLUMNS子句,並且同時使用ON COLUMNS子句指定 XML 類型直欄或使用ON ALL COLUMNS子句,則在統計資料收集期間會忽略所有 XML 類型直欄。 若為Db2V9.7 Fix Pack 1 以及更新版本,當您指定此參數時,不會收集 XML 類型直欄的配送統計資料。
db2 runstats on table db2inst1.staff with distribution and detailed indexes all 5 (可选)上面命令完成后可以重复第二步,检查REORG的结果,如果需要,可以再次执行REORG和RUNSTATS命令。 6 BIND或REBIND RUNSTATS命令运行后,应对数据库中的PACKAGE进行重新联编,简单地,可以使用db2rbind命令来完成。 db2rbind命令的语法...
[db2inst1@xifenfei ~]$ db2"runstats on table db2inst1.t_02xff for indexes all" DB20000I The RUNSTATScommandcompleted successfully. [db2inst1@xifenfei ~]$ db2"select STATS_TIME from syscat.tables where tabname in('T_01XFF','T_02XFF')" STATS_TIME --- 2012-04-28-23.43.23.904759 ...
RUNSTATS ON TABLE db2admin.department FOR INDEXES db2admin.INX1, db2admin.INX2, db2admin.INX3 示例8:只收集所有索引上的目录统计信息 RUNSTATS ON TABLE db2admin.department FOR INDEXES ALL 如果创建新的索引,而在最后一次执行 RUNSTATS 以后还未修改相应的表,那么您可以只收集索引上的目录统计信息。在创建...
The recommendation would be to collect statistics on all tables when the table is at its normal operational volume. The options included on the RUNSTATS command would be the same as the options used for non-VOLATILE tables (i.e. include index, distribution, and column group stats as required...
DB2 Catalog Tables Updated by RUNSTATS The actual DB2 Catalog tables and statistics that get updated by RUNSTATS vary depending on the RUNSTATS options specified, primarily the UPDATE option. There are three options that can be specified on the UPDATE parameter: ALL ” Accumulates and updates a...
echo "[${cur_time}] runstats on all tables of database ${db_name} ..." sleep 1 db2 -x "select lower(ltrim(rtrim(tabschema)))||'.'||lower(ltrim(rtrim(tabname))) from syscat.tables where type in ('T','S') order by 1 with ur" > ${table_list_file} ...
runstats命令只能针对单表执行。命令格式:db2 runstats on table schema.tabname runstats选项默认为allow write access,DB2在runstats的表上加IN锁,可以读取和修改表数据。指定allow read access会在runstats的表上加S锁,只能读取数据,无法修改。 runstats统计结果存在系统表中,syscat.tables保存表统计信息,syscat.indexes...
RUNSTATS ON TABLE db2admin.department WITH DISTRIBUTION AND INDEXES ALL UPDATE PROFILE 示例25:根据前面已注册的统计信息配置文件来查询 RUNSTATS 选项 SELECT STATISTICS_PROFILE FROM SYSIBM.SYSTABLES WHERE NAME = ‘DEPARTMENT‘ AND CREATOR = ‘DB2ADMIN‘ ...