DB2 的表在删除字段后 表会挂起 需要执行 reorg命令
步骤如下:
通过ssh 登陆到 192.168.1.74 数据库所在服务器
工具: Xshell 5
连接之后:
引用
Connecting to 192.168.1.74:22...
Connection established.
db2 安装的目录在
/opt/ibm/db2/V11.1/
进入bin
cd bin
命令
./db2 list db directory
引用
System Database Directory
Number of entries in the directory = 2
Database 1 entry:
Database alias = MPOS
Database name = MPOS
Local database directory = /home/db2inst1
Database release level = 14.00
Comment =
Directory entry type = Indirect
Catalog database partition number = 0
Alternate server hostname =
Alternate server port number =
Database 2 entry:
Database alias = IBBDKUSR
Database name = IBBDKUSR
Local database directory = /home/db2inst1
Database release level = 14.00
Comment =
Directory entry type = Indirect
Catalog database partition number = 0
Alternate server hostname =
Alternate server port number =
先连接上db2:
./db2 connect to IBBDKUSR user mpos using JYCDB2
引用
Database Connection Information
Database server = DB2/LINUXX8664 11.1.1.1
SQL authorization ID = MPOS
Local database alias = IBBDKUSR
再执行 表整理
./db2 reorg table withholding_test.merchant
引用
[mpos@localhost bin]$ ./db2 reorg table withholding_test.merchant; DB20000I The REORG command completed successfully.