If you have successfully installed DB2 /. profile configuration, the installation may fail again, and /. profile configuration to restore. You must have the root permission to uninstall DB2. 1. delete a database
Su-db2inst1 (here db2inst1 is an instance user) db2 list db directory (View All Database lists) db2 connect to db_name (connect to database) db2 drop db db_name (delete database)
Note: If you are prompted that The database is in use (The database is currently using) When you delete The database, you must stop The database before deleting it.
Db2stop force (force stop) db2start (start) db2 drop db db_name (delete database)
2. delete an instance
Su-db2inst1 (switch to instance user) db2inst1 stop (stop management service, db2inst1 is Instance name) su-root (switch to root user) cd/opt/IBM/db2/V9.5/instance (switch to the instance directory ). /dasdrop db2inst1 (delete Management Service ). /db2idrop db2inst1 (delete instance)
Note: If you are prompted that the instance is running when you delete the instance (There are applications that are still running that are using the specified instance.), stop the instance before deleting it.
Su-db2inst1 (switch to instance user)./db2stop (stop instance) su-root cd/opt/IBM/db2/V9.5/instance./db2idrop db2inst1
3. Uninstall DB2
Cd/opt/IBM/db2/V9.5/install (switch to the installation directory ). /db2_deinstall-a (unmount) cd/opt/IBM/db2 (if there is no file in db2, The unmount is successful) cd/opt rm-rf IBM (Force Delete the IBM folder)
4. delete a user
Su-root smit user (then delete the relevant user as prompted) cd/home rm-rf db2inst1 (delete the user's home directory)
So far, DB2 has been uninstalled successfully. Pay attention to the user permissions during the uninstallation process.