- 查看表空间
db2pd -d dbname -tablespaces
db2pd -d dbname -tab | grep -p HWM
select *from sysibmadm.snaptbsp_part
db2 list tablespaces show detail
- 降表空间高水位及释放磁盘资源
db2 alter tablespace tab_space_name lower high water mark
db2 alter tablespace tab_space_name reduce max
- load pending 表处理
db2 load from /dev/null of del terminate into tablename nonrecoverable
- 增加分区
db2 alter table tabname add partition part_id starting('2020-01-02') ending(2020-01-02)
- 分区分离
db2 alter table tablename detach partition part_id into temp_table
- 外键处理(set Integrity Pending)
set integrity for tablename immediate checked
- 表分析
db2 runstats on table tablename
- 查看数据库表
select * from syscat.tables
- 查看分区信息
select * from syscat.datapartitions where Tabschema='schema_name' and tabname='table_name'
- 备份库
db2 backup db dbname online to /directory compress include logs;