Home > Articles > Data > DB2

This chapter is from the book

This chapter is from the book

Removing DB2 Instances

You can optionally remove some or all the DB2 Version 8 instances on your system. Once an instance is removed, all the DB2 databases owned by the instance, if any, will not be usable unless you recatalog them with a new instance. Remove DB2 instances only if you are not planning to use DB2 Version 8 products or if you do not want to migrate existing instances to a later version of DB2. To remove an instance, perform the following steps:

  • Log in as a user with root authority.

  • Back up files in the INSTHOME/sqllib directory, if needed, where INSTHOME is the home directory of the instance owner. You might want to save the database manager configuration file, db2systm, the db2nodes.cfg file (if you installed DB2 UDB Enterprise-Extended Edition), or the user-defined function or fenced stored procedure applications in INSTHOME/sqllib/function, where INSTHOME is the home directory of the instance owner. You can also export instance configuration information with the db2cfexp command.

  • Remove the instance by entering the following command:

    DB2DIR/instance/db2idrop InstName
    

    where DB2DIR = /opt/IBM/db2/V8.1, and where InstName is the instance name.

  • Optionally, as a user with root authority, remove the instance owner's userid and group (if used only for that instance). Do not remove these if you are planning to re-create the instance. This step is optional since the instance owner and instance owner group may be used for other purposes.

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.

  • + Share This
  • 🔖 Save To Your Account