If you are using an embedded Derby database,
as the default data store does, the easiest way to empty the data
store is to delete the files which the database uses. This deletes
the database. When the messaging engine is next started, it will create
an empty database to replace the one that was deleted. This
procedure is safe only if the database contains just the tables for
the messaging engine's data store. If you are using the same database
for application data, you must instead empty the data store's tables
as described below. Important: Ensure that the application
server is also stopped. If you stop the messaging engine but not the
application server, it will not be possible to delete the files.
Find
the database's data directory in your file system. The name of the
directory which contains the files used by the database is the same
as the name of the database in the configuration of the JDBC data
source used by the messaging engine's data store. By default, this
is
${USER_INSTALL_ROOT}/profiles/dmgr/databases/com.ibm.ws.sib/messagingEngineName
Delete
the directory. If you have configured a separate log directory for
your Derby database, delete this also.
For any other RDBMS, empty the data store's tables using
the administration tools of your RDBMS. You have a choice between
removing all data from the tables, or dropping and recreating the
tables. Most RDBMS support the TRUNCATE TABLE statement
which removes all data from the tables. This is the recommended way
of emptying the data store tables because it leaves the tables and
their authorizations intact. If your RDBMS does not support the TRUNCATE
TABLE statement (for example, DB2® does
not), you can use the DELETE statement to delete
all of the rows from all of the tables. If the tables contain a lot
of data, this procedure might be impractical due to resource limitations
in the RDBMS. In this case, drop the tables and recreate them with
the required indices and authorities.
Tip: If you enabled WebSphere Application Server to create the data
store tables, you can drop the tables using the DROP TABLE statement.
When the messaging engine is next started, it will create empty tables
to replace the ones that were dropped. If you did not enable WebSphere Application Server to create the data
store tables, recreate the tables that you dropped before you start
the messaging engine.
Tip: You can use the -drop option
of the sibDDLGenerator command to generate DDL script
to drop the tables.
Optional: If
you deleted the messaging engine by removing it from the bus, you
can now recreate it.