WAS v8.5 > Reference > Command-line utilities

wsschema command

The schema tool can be used to view the database schema in XML form or match an XML schema to an existing database.

The wsschema tool can reflect on the current database schema, optionally translating it into an XML representation for further manipulation. The schema tool can take an XML schema definition, calculate the differences between the XML and the existing database schema, and apply the necessary changes to make the databases correspond to the XML schema. The XML format used by the schema tool is abstract from the differences in SQL dialects used by different vendors. The tool also automatically adapts its SQL to meet foreign dependencies, thus the schema tool is useful as a general way to manipulate the schemas.


Syntax

The command syntax is as follows:

Issue the command from the bin subdirectory of the profile_root directory.


Parameters

The wsschema tool accepts the standard set of command-line arguments defined by the configuration framework along with the following:


Usage

The wsschema tool is used to obtain an XML file that describes the schema of the database. To generate an XML schema file:

Messages and errors are logged to the dmgr console as specified by the configuration.


Examples

Add the necessary schema components to the database to match the given XML document without dropping any data:

Repeat the same action as the previous example, this time not changing the database but instead writing any planned changes to a SQL script:

Write an SQL script that recreates the current database:

Refresh the schema and delete all the contents of all the tables that OpenJPA knows about:

Drop the current database:

Write an XML representation of the current schema to the file schema.xml:


Additional information

For more information read the JDBC information in the Apache OpenJPA documentation.


Reference:

Apache OpenJPA User's Guide


+

Search Tips   |   Advanced Search