Each database store that appears in the stores.conf file includes a configuration parameter pointing to a database. The EMS Schema Export Tool creates and exports database tables for the database stores that are configured there. Database administrators can use the Schema Export Tool to selectively export and tune schemas to suit your database and messaging system.
The Schema Export Tool is a JAR file, tibemsd_util.jar, located in the same directory as
tibemsd. Command line options, described in
Table 15, determine whether database tables are created or dropped, and whether they are printed to the console, saved to a file, or exported to the database.
When it is invoked, the Schema Export Tool accepts the tibemsd.conf file and reviews the database store parameters, then parses the
stores.conf file. Depending on the options specified when it was invoked, the Schema Export Tool will create, drop, or update the database tables for the stores of type
dbstore that are configured in the
stores.conf file.
The tool can perform the selected actions on all database stores, or only on specific stores. The Schema Export Tool can also print the database tables it creates to the console, or export them either to the database or to a specified file.
The Schema Export Tool is invoked from the command line. The tool can be invoked from its directory, or by giving the absolute path to the
tibems_util.jar file. For example:
|
|
|
The absolute path to the tibemsd.conf file. For example, on a UNIX system:
|
|
Export the schema to a file named store-name.ddl.log, where store-name is the name of the database store. If multiple database stores are configured in stores.conf, then one file is created for each database store.
If neither exporttofile nor export option is included, the schema export tool prints the schema to the console.
If both -eporttofile and -export are included, the Schema Export Tool exports the database schema to both locations.
|
|
If neither export nor exporttofile option is included, the schema export tool prints the schema to the console.
If both -eport and -exporttofile are included, the Schema Export Tool exports the database schema to both locations.
|
-store storename=create|update|drop
|
Create, update, or drop the schema for one or more specific stores that are named in the stores configuration file.
If you choose the create option for a schema that already exists, the Schema Export Tool recreates the schema.
Note that create prints the schema to screen but does not deploy it. You must use export or exporttofile in order to implement the schema.
|
|
Create all the stores found in the stores configuration file. Note that this option drops any existing configurations when creating the new stores.
|
|
|
|
|
|
|
In this example, the Schema Export Tool creates and exports database schemas for all the stores found in the
stores.conf that is set in the specified
tibemsd-mssqlserver.conf file:
In this example the Schema Export Tool creates and exports the database schema for the store
mystore1, but drops the schema associated with
mystore2 and exports the change:
java –jar /opt/tibco/ems/
5.1/bin/tibemsd_util.jar –tibemsdconf /opt/tibco/ems/
5.1/samples/config/tibemsd.conf -store mystore1=create -store mystore2=drop -export