DB2 Version 9.7 for Linux, UNIX, and Windows
Uninstalling > Uninstalling your DB2 product (Linux and UNIX) >

Removing DB2 instances (Linux and UNIX)

This task explains how to remove some or all of the root instances on your system.

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

If you are removing your last DB2 Version 9 copy, you can remove the DB2 instances before you remove your DB2 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.

Remove DB2 instances only if you are not planning to use your DB2 products, or if you do not want to upgrade existing instances to a later version of the DB2 product. Upgrading requires that both the new and old DB2 versions are still installed. You cannot upgrade an instance if the DB2 copy it is associated with has been removed.

To remove an instance:

  1. Log in as a user with root 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 installation. The default installation path for UNIX® is /opt/IBM/db2/V9.7. The default installation path for Linux® is /opt/ibm/db2/V9.7.

    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 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.
[ Top of Page | Previous Page | Next Page | Contents ]