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 it. 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.
You
will need to 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
Simply
delete the directory. If you have configured a separate log directory for
your Derby database, you must delete this also.
For any other RDBMS, you can 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 you 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 may be impractical due to resource limitations in the RDBMS. In this
case, the only practical way to proceed is drop the tables and recreate them
with the required indices and authorities.
Tip: If you
have enabled WebSphere Application Server to
create the data store tables,
you can simply drop the tables using the DROP TABLE statement.
When the messaging engine is next
started, it will create empty tables to replace them. If you have not enabled WebSphere Application Server to create the data store tables, you must recreate
the tables that you drop before you start the messaging engine.
Tip: You can use the -drop option of the sibDDLGenerator command
to generate DDL to drop the tables.
Optional: If
you have deleted the messaging engine by
removing it from the bus, you can now recreate it.