db2表空間常用命令

2021-09-19 14:28:40 字數 1057 閱讀 6714

建立表空間

create large tablespace my_tb_32k

pagesize 32k

managed by database

using(file '/home/db2inst1/tbs/my_tb_32k' 1048756k)

extensize 32

bufferpool bp32k

overhead 7.5

transferrate 0.06

刪除表空間

drop tablespace my_tb_32k
檢視表空間使用情況

db2pd -d dbname -tablespaces

db2 list tablespaces show detail

db2 list tablespace containers for 4 show detail

設定表空間自動擴充套件

db2 alter tablespace zx_data_32k autoresize yes
手工擴擴充套件表空間有3種方法:

--擴充套件容器50g

db2 "alter tablespace tablespace_name extend (file '/data1/ts2/con0' 50g,file '/data1/ts2/con1' 50g)"

--2增加容器,不過會rebalance,影響系統效能

db2 "alter tablespace tablespacename add (file '/data1/ts2/con2' 50g)"

--通過alter tablespace begin new stripe set 選項,該選項不rebalance,不會對系統效能造成影響,但它會造成資料偏移。

db2 "alter tablespace tablespace_name begin new stripe set (file '/data1/ts2/con3' 10g)"

DB2常用命令

常用操作 db2 list db directory db2 connect to user using db2ilist 顯示當前例項名 db2 list tables 顯示當前例項下的所有表 db2 list tablespaces 顯示表空間 db2pd db tablespaces 檢視表空...

DB2常用命令

1 db2 list node directory 2 db2 list node directory show detail 3 db2 catalog tcpip node wsii remote 9.181.139.155 server 50000 4 db2 catalog database...

DB2常用命令

例項 clp 命令描述 db2start 啟動資料庫管理器例項。db2stop 停止資料庫管理器例項。get dbm cfg 返回資料庫管理器配置設定。get dbm cfg show detail 顯示資料庫管理器引數的當前值和延遲值 從 v8 起 1update dbm cfg using 將資...