linux下unstalling db2

由于enterprise版本又到期了,又不想改系统日期,所以重装。

参考:
http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp


1 Optional: Drop all databases. You can drop databases using the Control Center (on Linux platforms only) or the drop database command. Database files remain intact on your file systems when you drop an instance without dropping databases first.
因为已经到期,数据库无法启动,就drop不了了。

2 Stop the DB2 Administration Server.

#. Log in as the DB2 administration server owner.
#. Stop the DB2 administration server by entering the db2admin stop command.

没有das,跳过

3.Removing the DB2 administration server
# Log in as a user with root user authority.
# Stop the DB2 administration server.
# Remove the DB2 administration server by entering the following command:
[code="sql"]

--注意使用root运行
# /opt/ibm/db2/V9.7/instance/dasdrop
DBI1104E The Administration Server cannot be dropped.

Explanation:

An attempt to drop the Administration Server failed. The system detects
that the Administration Server does not exist.

User response:

No action required.


DBI1079I Output is saved in the log file /tmp/dasdrop.log.28479.

Explanation:

All processed and failed operations have been saved into this log file.

User response:

Do not modify this file in any way. This file is for IBM Technical
Support reference.
--因为没有,所以删除失败,继续
[/code]

4.Stopping DB2 instances
# Log in as a user with root user authority.
# To obtain a list of the names of all DB2 instances associated with your current DB2 copy, enter the following command:
[code="sql"]
# /opt/ibm/db2/V9.7/bin/db2ilist
db2inst1
[/code]
# Log out.
# Log back in as the owner of the instance you want to stop.
# Run the start up script if it is not included in .profile.

[db2inst1@localhost ~]$ sqllib/db2profile


# You might want to save the database manager configuration file, db2systm, the db2nodes.cfg file, or user defined function or fenced stored procedure applications in INSTHOME/sqllib/function.
# Stop the DB2 database manager by entering the db2stop force command.
# Confirm that the instance is stopped by entering the db2 terminate command.
# Repeat these steps for each instance.

[db2inst1@localhost ~]$ db2stop force --强制关闭数据库
SQL1032N No start database manager command was issued.
[db2inst1@localhost ~]$ db2 terminate --断开连接
DB20000I The TERMINATE command completed successfully.


5.Remove DB2 instances.
# Log in as a user with root user authority.
# Remove the instance by entering the following command:
[code="sql"]
# /opt/ibm/db2/V9.7/instance/db2idrop db2inst1
DBI1070I Program db2idrop completed successfully.
[/code]

# Optional: As a user with root user authority, remove the instance owner's user ID and group (if used only for that instance). Do not remove these if you are planning to re-create the instance.

Remove the database files from the systems or drop the databases before dropping the instance if you no longer need the databases. After dropping the instance the database files remain intact.

This step is optional since the instance owner and the instance owner group may be used for other purposes.
因为待会重装,所以不删这些

6.Remove DB2 products.

#. Log in as user with root user authority.
#. Access the path where the DB2 database products are located. To locate the path of the DB2 database product to remove, see Listing DB2 products installed on your system.
#. Run the db2_deinstall -a command from the DB2DIR/install directory or the doce_deinstall -a command from the DB2DIR/doc/install directory, where DB2DIR is the location that you specified when you installed your DB2 database product.
[code="sql"]
# /opt/ibm/db2/V9.7/install/db2_deinstall -a
DBI1016I Program db2_deinstall is performing uninstallation. Please
wait.


The execution completed successfully.

For more information see the DB2 uninstallation log at
"/tmp/db2_deinstall.log.1833".
--运行成功
# du -sh *
8.0K ibm
--这时/opt下的ibm已经剩下8k了
[/code]

到此,db2删除完成
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值