WebSphere brand IBM WebSphere Presence Server, Version 7.0

Removing the DB2 databases and database tables

The following topics describe how to clean and remove DB2® database tables, and how to remove the databases, when uninstalling IBM® WebSphere® Presence Server Component.

About this task
As part of the installation of the Presence Server product, you created some or all of the following databases:
  • The Presence Server application database: PSDB
  • The Presence Server content indirection database: PSCIDB
  • The Presence Server usage record database: PSURDB
  • The Presence Server data store database: PSSIBUS
Follow these steps to clean and remove the database tables and remove the databases:
  1. Log in to the DB2 server as a database administrator.
  2. Create a directory that has write and execute permission, for example DB_dir.
  3. Copy the installation .tar file, IBMPresenceServerDbPackage_7.0.tar, from the installation medium to the new directory.
  4. Switch to the new directory.
  5. Unpack the installation .tar file using the following command:
    tar -xvf IBMPresenceServerDbPackage_7.0.tar
  6. Switch to the following directory: was_root/installableApps/presence/scripts/dbScripts/presence.
  7. Verify that the following files exist in /presence:
    • ConfigDB2.sh
    • RunConfigDB2.sh
    • RunConfigContentIndirectionDB2.sh
    • DropDB2Tables.ddl
    • DropContentIndirectionDB2Tables.ddl
  8. Run the following commands to ensure that the uninstall scripts will run properly:
    • chmod 755 ConfigDB2.sh
    • chmod 755 RunConfigDB2.sh
    • chmod 755 RunConfigContentIndirectionDB2.sh
  9. Edit the Presence Server database preparation script, RunConfigDB2.sh, for your environment:
    1. Open RunConfigDB2.sh using a text editor.
    2. Locate the line that begins with the following text:
      • #Update command line parameters here.
    3. Update values for each parameter listed:
      Parameter Description Default value
      DBSERVER Fully qualified name of the database server
      • Linux Should match the Linux hostname command value if you are running the script directly on the database server
      <hostname>
      DBPORT Number for the listening port on the database server 50000
      DBNAME Name of the database PSDB
      DBALIAS Alias by which the database is known PSDB
      DBLOCALE Territory code that identifies your DB2locale, for example US or JP US
      DBINSTANCE Name of the database instance db2inst
      DBINSTANCPW Password for the database instance <pw>
      DBUSER User ID for the authorized user (the ID with which you are logged in) db2inst
      DBUSERPW Password for the authorized user <pw>
      DBDIR Directory in which the database files are to be created (should be a directory with write permission) /home/db2inst
      DBCREATE Boolean value specifying whether the database should be recreated FALSE
      For example:
      DBSERVER=dbserver.example.com
      DBPORT=50000
      DBNAME=PSDB
      DBALIAS=PSDB
      DBLOCALE=US
      DBINSTANCE=db2inst
      DBINSTANCPW=inst_pw
      DBUSER=db2inst
      DBUSERPW=user_pw
      DBDIR=/home/db2inst
      DBCREATE=FALSE
    4. Locate the section of the script titled Create Presence Server tables, at the end of the script, and replace the double-quote ("") with the name of the ddl file: DropDB2Tables.ddl.
    5. Save your changes.
    6. Clean Presence Server database tables by running the RunConfigDB2.sh script.
  10. Optionally, remove the Presence Server database by running the following commands:
    db2 "drop database" dbname
    db2 "uncatalog database" aliasname
    db2 "terminate"
    where:
    • dbname is the database name.
    • aliasname is the alias by which the database is known.
  11. Edit the content indirection database preparation script, RunConfigContentIndirectionDB2.sh script, for your environment:
    1. Open RunConfigContentIndirectionDB2.sh using a text editor.
    2. Locate the line that begins with the following text:
      • #Update command line parameters here.
    3. Update values as you did in step 9.
    4. Locate the section of the script titled Create Presence Server tables, at the end of the script, and replace the double-quote ("") with the name of the ddl file: DropContentIndirectionDB2Tables.ddl.
    5. Save your changes.
    6. Clean content indirection database tables by running the RunConfigContentIndirectionDB2.sh script.
  12. Optionally, remove the content indirection database:
    1. Connect to the content indirection database.
    2. Remove the database by running the following commands:
      db2 "drop database" dbname
      db2 "uncatalog database" aliasname
      db2 "terminate"
      where:
      • dbname is the name of the content indirection database, for example PSCIDB.
      • aliasname is the alias by which the content indirection database is known.
  13. Remove the usage records database tables, tablespace, and buffer pool. A DDL file, DropUsageDbDb2, is provided for this task. The DDL file is found in the directory was_root/installableApps/presence/scripts/dbScripts/usageRecords.
    1. Connect to the usage records database by running the following command:
      • db2 connect to database_alias user database_administrator_ID using database_administrator_PW
      Where:
      • database_alias represents the database alias
      • database_administrator_ID represents the administrator user ID
      • database_administrator_PW represents the administrator password
    2. Run the following commands:
      db2 -tvf DropUsageDbDb2.ddl
      db2 connect reset
      db2 "terminate"
  14. Remove the usage records database:
    1. Connect to the usage records database.
    2. Remove the database by running the following commands:
      db2 "drop database" dbname
      db2 "uncatalog database" aliasname
      db2 "terminate"
      where:
      • dbname is the name of the usage records database, for example PSURDB.
      • aliasname is the alias by which the usage records database is known.
  15. Optional: Remove the SIBus database:
    1. Connect to the SIBus database.
    2. Remove the database by running the following commands:
      db2 "drop database" dbname
      db2 "uncatalog database" aliasname
      db2 "terminate"
      where:
      • dbname is the name of the SIBus database, for example PSSIBUS.
      • aliasname is the alias by which the SIBus database is known.
  16. If you did not delete the SIBus database in step 15, delete the database schemas on the deployment manager.
    Note: Failure to delete the SIBus schemas could result in the SIBus not starting properly after an upgrade or a reinstallation.
    1. Stop the cluster.
    2. Log in to the deployment manager.
    3. Change (cd) to the following directory: was_root/installableApps/presence/scripts/dbScripts/SIBus.
    4. Verify that the file dropDB2SIBusSchemas.sh exists in the /SIBus directory.
    5. Run the following command to ensure that the script will run properly:
      • chmod 755 dropDB2SIBusSchemas.sh
    6. Run the script to delete the SIBus schemas:
      ./dropDB2SIBusSchemas.sh java_home jar_name jdbc_jars_dir db_user db_password db_server db_name db_port db_schema_file
      where:
      • java_home is the Java home directory, for example was_root/java/bin.
      • jar_name is the full path to the database JAR file, for example /tmp/DataBase/UpdateConfiguration.jar. (The JAR file is located inside the Presence Server installation .tar file, IBMPresenceServerDbPackage_7.0.tar.)
      • jdbc_jars_dir is the directory that contains JDBC driver JAR files for the database client, for example /opt/db2_jars.
      • db_user is the database user, for example dbAdmin.
      • db_password is the password for the database user.
      • db_server is the name of the database server, for example serv1 or localhost.
      • db_name is the database name, for example PSSIBUS.
      • db_port is the database port, for example 50000.
      • db_schema_file is the full path to the file that contains the SIBus schemas list. By default this file is was_root/logs/presenceServerInstall.log.bus_schemas.



Terms of use
(C) Copyright IBM Corporation 2009. All Rights Reserved.