DB2 10.5 for Linux, UNIX, and Windows

Removing DB2 instances (Linux and UNIX)

This task explains how to remove some or all of the root instances on your system. Remove DB2® instances only if you are not planning to use your DB2 database products, or if you do not want to upgrade existing instances to a later version of the DB2 database product.

About this task

If you are removing your last DB2 Version 9 copy, you can remove the DB2 instances before you remove your DB2 database product. If you removing a DB2 Version 9 copy, but have other DB2 Version 9 copies, you can run the db2iupdt command from the DB2 copy that you would like to have the DB2 instances associated with.

Once an instance is removed, you can use the DB2 databases owned by the instance if you catalog them under another instance of the same release. Even though you remove the instance, the databases are still intact and can be reused unless the database files are expressly deleted.

Upgrading requires that both the new and old DB2 database versions are still installed. You cannot upgrade an instance if the DB2 copy it is associated with has been removed.

Restrictions

This task does not apply to non-root installations. To remove a non-root instance, you must uninstall your DB2 database product.

Procedure

To remove an instance:

  1. Log in as a user with root user authority.
  2. Optional: If you are certain you no longer need the data in the associated databases, you can remove the database files from the systems or drop the databases before dropping the instance.
  3. Remove the instance by entering the following command:
    DB2DIR/instance/db2idrop InstName
    where DB2DIR is the location you specified during the DB2 database product installation. The default installation path for UNIX is /opt/IBM/db2/V10.5. The default installation path for Linux is /opt/ibm/db2/V10.5.

    The db2idrop command removes the instance entry from the list of instances and removes the INSTHOME/sqllib directory, where INSTHOME is the home directory of the instance and where InstName is the login name of the instance. If you are storing any files in /sqllib directory, these files will be removed by this action. If you still need these files, you must make a copy of them before dropping the instance.

  4. 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.
    Note: This step is optional since the instance owner and the instance owner group might be used for other purposes.