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:
- Log in to the DB2 server
as a database administrator.
- Create a directory that has write and
execute permission, for example DB_dir.
- Copy the installation .tar file, IBMPresenceServerDbPackage_7.0.tar, from
the installation medium to the new directory.
- Switch to the new directory.
- Unpack the installation .tar file
using the following command:
tar -xvf IBMPresenceServerDbPackage_7.0.tar
- Switch to the following directory: was_root/installableApps/presence/scripts/dbScripts/presence.
- Verify that the following files exist
in /presence:
- ConfigDB2.sh
- RunConfigDB2.sh
- RunConfigContentIndirectionDB2.sh
- DropDB2Tables.ddl
- DropContentIndirectionDB2Tables.ddl
- 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
- Edit the Presence Server database
preparation script, RunConfigDB2.sh, for your
environment:
- Open RunConfigDB2.sh using a text
editor.
- Locate the line that begins with the following text:
- #Update command line parameters here.
- Update values for each parameter listed:
Parameter |
Description |
Default value |
DBSERVER |
Fully qualified name of the database server 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
- 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.
- Save your changes.
- Clean Presence Server database
tables by running the RunConfigDB2.sh script.
- 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.
- Edit the content indirection database preparation script, RunConfigContentIndirectionDB2.sh
script, for your environment:
- Open RunConfigContentIndirectionDB2.sh using
a text editor.
- Locate the line that begins with the following text:
- #Update command line parameters here.
- Update values as you did in step 9.
- 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.
- Save your changes.
- Clean content indirection database tables by running
the RunConfigContentIndirectionDB2.sh script.
- Optionally, remove the content indirection database:
- Connect to the content indirection database.
- 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.
- 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.
- 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
- Run the following commands:
db2 -tvf DropUsageDbDb2.ddl
db2 connect reset
db2 "terminate"
- Remove the usage records database:
- Connect to the usage records database.
- 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.
- Optional: Remove the SIBus
database:
- Connect to the SIBus database.
- 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.
- 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.
- Stop the cluster.
- Log in to the deployment manager.
- Change (cd) to
the following directory: was_root/installableApps/presence/scripts/dbScripts/SIBus.
- Verify that the file dropDB2SIBusSchemas.sh exists
in the /SIBus directory.
- Run the following command to ensure that the script
will run properly:
- chmod 755 dropDB2SIBusSchemas.sh
- 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.