The following article mainly describes how to uninstall AIX from a DB2 database. I found a document on how to uninstall AIX from a DB2 database on a website, the following is a detailed description of the article, hoping to help you in this regard.
If you have successfully installed db2 and configured it in/. profile, the installation may fail again and you need to restore the/. profile configuration. You must have the root permission to uninstall the DB2 database.
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 using The database currently using when you delete The database, you must stop The database before deleting it.
Db2stop force (force stop)
Db2start)
Db2 drop db db_name (delete database)
2. delete an instance
Su-db2inst1 (switch to instance user)
Db2inst1 stop (stop the management service, and db2inst1 is the 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 There are applications that are still running that are using the specified instance.) When you delete the instance, stop the instance and then delete 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 (DB2 database uninstallation)
Cd/opt/IBM/db2 (if there is no file in db2, It is uninstalled successfully)
Cd/opt
Rm-rf IBM (Force Delete IBM folder)
4. delete a user
Su-root
Smit user (delete the user as prompted)
Cd/home
Rm-rf db2inst1 (delete the user's home directory)
So far, the DB2 database has been uninstalled successfully. Pay attention to the user permissions during the uninstallation process.