Use these steps to uninstall DB2 V9.7 on UNIX or Linux systems.
To uninstall DB2 V9.7 on UNIX and Linux, complete these steps:
Log in with a user ID or name that has DB2 admin authority and is in the db2iadm1 group.
Source your DB2 profile, as follows:where HOME is the home directory of the instance you want to use.
At a Bourne or Korn shell, type . HOME/sqllib/db2profile.
At a C shell, type source HOME/sqllib/db2cshrc.
Run db2 drop db ibmcdb. The following message is displayed:
DB20000I The DROP DATABASE command completed successfully.
Run db2 drop db tpcdb. The following message is displayed:
DB20000I The DROP DATABASE command completed successfully.
Run db2stop force. Run these commands:
# su - db2inst1 $ db2stop force $ db2 terminate
The following messages are displayed:
SQL1064N DB2STOP processing was successful. SQL1064N DB2STOP processing was successful.
Run db2 terminate. The message is displayed: DB20000I The TERMINATE command completed successfully.
Run the following command:
cd /opt/ibm/db2/V9.7/instance
Run ./db2idrop . The following messages are displayed:
db2inst1, today is Thu Apr 17 13:53:54 PDT 2008. Your last login was 0 Apr 17 12 db2inst1, today is Thu Apr 17 13:53:55 PDT 2008. Your last login was 0 Apr 17 13 DBI1070I Program db2idrop completed successfully.
Switch to dasusr1 by typing the following command: su dasusr1.
Run the following commands:
# su - dasusr1 $ db2admin stop
Run ./db2admin stop. The following message is displayed: SQL4407W The DB2 Administration Server was stopped successfully.
Run exit.
Enter the following command:
cd /opt/ibm/db2/V9.7/instance
Run ./dasdrop. The following messages are displayed:
SQL4410W The DB2 Administration Server is not active. DBI1070I Program dasdrop completed successfully.
Log in as a user with root authority.
Enter the following command:
cd /opt/ibm/db2/V9.7/install
Run ./db2_deinstall -a. The following message is displayed:
DBI1016I Program db2_deinstall is performing uninstallation. Please wait. The execution completed successfully.
Log in as a user with root authority.
Run the following commands:
# userdel -r db2inst1 # userdel -r dasusr1 # userdel -r db2fenc1 # groupdel dasadm1 # groupdel db2iadm1 # groupdel db2fadm1
Log in as a user with root authority.
Run rm -r /opt/ibm/db2.
http://www-01.ibm.com/support/knowledgecenter/SSNE44_4.2.0/com.ibm.tpc_V42.doc/fqz0_t_uninstalling_db2_unix_linux.html
转载于:https://blog.51cto.com/wangjun51/1585245