By emptying the data store of a messaging engine, you can
discard persistent operating information without deleting the messaging
engine.
About this task
Persistent operating information for a messaging engine is
stored as persistent messages and associated information about message
delivery and transmission. To discard this information without deleting
the messaging engine and its destinations from the
WebSphere® Application Server configuration, you empty
the messaging engine data store.
CAUTION:
- When you empty the data store, all of the persistent messages
that were held are lost and any destinations that you created continue
to exist.
- Be very careful to completely empty the data store. You get unpredictable
behavior if the data store is only partially emptied.
Procedure
- Ensure that the messaging engine and application server
are stopped.
- Empty the data store. There are several ways to achieve
this:
- If you are using the embedded Derby database
(as the default data store does) and the database contains just the
tables for the messaging engine data store, delete the files that
the database uses. This deletes the database. When the
messaging engine is next started, it creates an empty database to
replace it.
Important: If you are using the same database
for application data, you must instead empty the data store tables
as described for any other RDBMS in a subsequent step.
- Find the database data directory in your file system. The name
of the directory that 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 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 too. If you find that you cannot
delete the files, confirm that the application server is also stopped
(if you stop the messaging engine but not the application server,
you cannot delete the files).
- If you are using the Derby Network Server database,
use a similar procedure but also stop Derby Network Server before
you delete the files. You must restart Derby Network Server
before starting the messaging engine.The USER_INSTALL_ROOT for WebSphere Application Server Network Deployment is usually changed when
installing WebSphere Application Server (base). You
might not find your data store in ${USER_INSTALL_ROOT}/profiles/dmgr but
in ${USER_INSTALL_ROOT}/profiles/profileName,
where profileName is the name
you gave at installation.
- If you are using any other RDBMS, empty the data store
tables by using the administration tools of your RDBMS. You
can either remove all data from the tables, or drop and recreate the
tables.
Most RDBMS support the TRUNCATE TABLE statement
that removes all data from the tables. This is the preferred 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. However, if the tables contain
a lot of data, this might not be practical because of resource limitations
in the RDBMS. In this case, 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 drop the tables by using the DROP
TABLE statement. When the messaging engine is next started,
it creates empty tables to replace them. If you have not enabled WebSphere Application Server (base) 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.
- Start the messaging engine and the application server.