db2look -d <database> -e -t <schema>.<table_name> -o tmp.sql db2 describe table SYSIBMADM.ENV_INST_INFO Altter column size ALTER TABLE ${schema}.${table} ALTER COLUMN ${column} SET DATA TYPE VARCHAR(128);Merge(http://publib.boulder.ibm.com/infocenter/db2luw/v9/topic/com.ibm.db2.udb.admin.doc/doc/r0010873.htm)
SELECT * FROM SYSIBMADM.APPLICATIONS with ur;
SELECT * FROM SYSIBMADM.ENV_INST_INFO with ur;
SELECT t.status, t.access_mode, t.TBSPACEID, t.TBSPACE, t.INDEX_TBSPACE, t.* FROM syscat.tables t WHERE tabschema='${table_schema}' AND tabname = '${table_name}' WITH UR
SELECT 'set integrity for '||tabschema||'.'||tabname||' immediate checked ;' FROM syscat.tables WHERE tabschema='${table_schema}' and not (status='N' and access_mode='F');select t.status, t.access_mode FROM syscat.tables t WHERE t.TABNAME = ${table_name} with ur
SELECT VARCHAR_FORMAT(TIMESTAMP_ISO(current date - 1 days ), 'YYYY-MM-DD') || ' 00:00:00' FROM SYSIBMADM.ENV_INST_INFO SELECT VARCHAR_FORMAT(TIMESTAMP_ISO(current timestamp - 2 days ), 'YYYY-MM-DD') || ' 00:00:00' FROM SYSIBMADM.ENV_INST_INFO values current timestamp select date(current timestamp) FROM SYSIBMADM.ENV_INST_INFO with ur
module load ibmdb2/db2ts
db2ts update table statistics -dbname ${database} -schema ${table_sckema} -name ${table_name} -mailto ${mail_group} html
Check Re-org table status
select *
from sysibmadm.snaptab_reorg r
where r.TABNAME = ${table_name}
order by r.REORG_START desc
with ur node
db2 list database directory
db2 list node directory sql
Get snapshot
attach to ${database}
shell
get snapshot for application agentid 24568 數據庫
module load ibmdb2/client/9.5.7 |
db2 attach to ${database_name} Note : Not alias |
db2 get snapshot for application agentid 24568 |
db2 "CALL SET_ROUTINE_OPTS(GET_ROUTINE_OPTS() || ' ISOLATION UR')" db2 -td@ -vf maxamount.db2