- IBM DB2 9.7 Advanced Administration Cookbook
- Adrian Neagu Robert Pelletier
- 304字
- 2021-08-20 15:33:20
Dropping instances
There could be situations when it is necessary to drop an instance. An instance might be dropped by using the db2idrop command.
Getting ready
In this recipe, we will drop the instance db2inst2
, created previously.
How to do it...
- The command for dropping an instance is
db2idrop
. You have to be userroot
to drop an instance. First, we need to ensure that the instance is not active. If the instance has active connections and it is active, thedb2idrop
command fails. - Stop the instance by force:
[db2inst2@nodedb21 ~]$ db2stop force 07/12/2011 16:38:27 0 0 SQL1064N DB2STOP processing was successful. SQL1064N DB2STOP processing was successful. [db2inst2@nodedb21 ~]$
- As the user
root
, issue the following command to dropdb2inst2:
[root@nodedb21 ~]# /opt/ibm/db2/V9.7/instance/db2idrop db2inst2 DBI1070I Program db2idrop completed successfully.
How it works...
On Linux and Unix, db2idrop
actually deletes the sqllib
directory from the instance owner home. Therefore, it is recommended to save anything you have placed in this directory such as UDFs or external programs.
On Windows, db2idrop
removes the service associated with the instance.
There's more…
As a best practice, before the instance is dropped, it is recommended to save the information related to that instance in a server profile file. In case you plan to recreate the instance and configure it as before, you can simply import the server profile after the instance is created again.
To export the instance profile, use Control Center | Tools | Configuration assistant | Export profile | Customize.
In the Export tab, you have plenty of options to export; choose anything you consider worth being saved.
- C程序設計簡明教程(第二版)
- Docker and Kubernetes for Java Developers
- Python數據分析入門與實戰
- Java入門經典(第6版)
- Java從入門到精通(第4版)
- Python神經網絡項目實戰
- Mastering Python High Performance
- Python機器學習經典實例
- Swift 4從零到精通iOS開發
- Java Web動態網站開發(第2版·微課版)
- 軟技能2:軟件開發者職業生涯指南
- JavaScript語法簡明手冊
- 川哥教你Spring Boot 2實戰
- Access 2016數據庫應用與開發:實戰從入門到精通(視頻教學版)
- LiveCode Mobile Development Hotshot