DB2 的表在删除字段后 表会挂起 需要执行 reorg命令

本文介绍在DB2数据库中删除表字段后如何通过执行reorg命令来整理表结构,确保数据库性能不受影响。文章详细记录了使用Xshell5通过SSH登录服务器,并在命令行下完成整个操作流程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

DB2 的表在删除字段后 表会挂起 需要执行 reorg命令

步骤如下:

通过ssh 登陆到 192.168.1.74 数据库所在服务器

工具: Xshell 5
连接之后:
[quote]

Connecting to 192.168.1.74:22...
Connection established.

[/quote]

db2 安装的目录在

/opt/ibm/db2/V11.1/

进入bin
cd bin

命令
./db2 list db directory

[quote]

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 =


[/quote]
先连接上db2:
./db2 connect to IBBDKUSR user mpos using JYCDB2

[quote]


Database Connection Information

Database server = DB2/LINUXX8664 11.1.1.1
SQL authorization ID = MPOS
Local database alias = IBBDKUSR


[/quote]

再执行 表整理
./db2 reorg table withholding_test.merchant


[quote]

[mpos@localhost bin]$ ./db2 reorg table withholding_test.merchant;
DB20000I The REORG command completed successfully.


[/quote]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值