Removes a DB2 instance that was created by db2icrt and the instance entry from the list of instances.
The preparation and details to removing an instance using the command line are:
->Stop all applications that are currently using the instance.
->Stop the Command Line Processor by running db2 terminate commands in each DB2 command window.
->Stop the instance by running the db2stop command.
->Backing up the files in the INSTHOME/sqllib directory
->Not Mandatory but you can save the database manager configuration file, db2systm, the db2nodes.cfg file,
To Remove the Db2 Instance —
1) Login to the server as root or any user under which db2 was installed
2) Execute the db2idrop command within DB2DIR/instance/ ie “db2idrop InstName “ where InstName is the name of the instance being dropped.
This command removes the instance entry from the list of instances and removes the instance directory.
3) Optionally, as a user with root authority, remove the instance owner’s user ID and group , Do not remove these if you are planning to re-create the instance.
[root@mercury instance]# cd /opt/ibm/db2/V9.1/instance [root@mercury instance]# ./db2ilist [root@mercury instance]# ./db2idrop db2inst1 [root@mercury instance]# ./db2ilist |
5) The db2idrop command removes the instance entry from the list of instances and removes the
sqllib subdirectory under the instance owner’s home directory.
6) This Removes the DB2 Instance