Uninstalling DB2 on UNIX or Linux

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:

  1. Log in with a user ID or name that has DB2 admin authority and is in the db2iadm1 group.

  2. 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.

Drop all databases from the DB2 instance db2inst1:
  1. Run db2 drop db ibmcdb. The following message is displayed:

    DB20000I  The DROP DATABASE command completed successfully.
  2. Run db2 drop db tpcdb. The following message is displayed:

    DB20000I  The DROP DATABASE command completed successfully.
Drop the DB2 instance db2inst1.Note: Steps a and b are performed using the db2inst1 user. Steps c and d are performed using the root user. Do not source the db2profile for step 4.
  1. 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.
  2. Run db2 terminate. The message is displayed: DB20000I The TERMINATE command completed successfully.

  3. Run the following command:

    cd /opt/ibm/db2/V9.7/instance
  4. 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.
Stop and drop the DB2 administration server. You must stop the DB2 administration server (DAS) before you remove your DB2 product.
  1. Switch to dasusr1 by typing the following command: su dasusr1.

  2. Run the following commands:

    # su - dasusr1
    $ db2admin stop
  3. Run ./db2admin stop. The following message is displayed: SQL4407W The DB2 Administration Server was stopped successfully.

  4. Run exit.

Remove the DB2 administration server. You must remove the DB2 administration server (DAS) before you remove your DB2 product.
  1. Enter the following command:

    cd /opt/ibm/db2/V9.7/instance
  2. Run ./dasdrop. The following messages are displayed:

    SQL4410W The DB2 Administration Server is not active.
    DBI1070I Program dasdrop completed successfully.
Uninstall DB2. Use the db2_deinstall command to remove DB2 products or DB2 components. The db2_deinstall command removes all DB2 products from your system.
  1. Log in as a user with root authority.

  2. Enter the following command:

    cd /opt/ibm/db2/V9.7/install
  3. Run ./db2_deinstall -a. The following message is displayed:

    DBI1016I Program db2_deinstall is performing uninstallation.
    Please wait.
    The execution completed successfully.
Delete DB2 users and groups.
  1. Log in as a user with root authority.

  2. Run the following commands:

    # userdel -r db2inst1
    # userdel -r dasusr1
    # userdel -r db2fenc1
    # groupdel dasadm1
    # groupdel db2iadm1
    # groupdel db2fadm1
Remove the DB2 directory.
  1. Log in as a user with root authority.

  2. Run rm -r /opt/ibm/db2.

Remove any DB2 definitions from /etc/services.

http://www-01.ibm.com/support/knowledgecenter/SSNE44_4.2.0/com.ibm.tpc_V42.doc/fqz0_t_uninstalling_db2_unix_linux.html


你可能感兴趣的:(IBM,db2,uninstall, )