1.1

Table Of Contents
Chapter 15
Exporting and Importing Data with vFabric
SQLFire
You can use either sqlf commands or Apache DdlUtils to import data into SQLFire. SQLFire installs and uses DdlUtils
for sqlf import and export functionality.
Using SQLF Commands to Export and Import Data
The sqlf utility provides several commands that use the DdlUtils 1.1 API to export and import database schemas
and table data. You can use these sqlf commands with SQLFire and other JDBC datasources.
These sqlf commands are used to write existing database information to les:
sqlf write-schema-to-sqlWrites a database schema to a le as SQL DDL statements.
sqlf write-schema-to-xmlWrites a database schema to a schema XML le.
sqlf write-data-to-xmlWrites table data to a data XML le.
sqlf write-data-dtd-to-leWrites a Document Type Denition (DTD) that describes the layout of a data XML
le (created using sqlf write-data-to-xml).
These sqlf commands are used to import database information from les:
sqlf write-schema-to-dbCreates a database schema from a schema XML le.
sqlf write-data-to-dbInserts table data into a schema using one or more data XML les and schema XML
les.
When you migrate a third-party database schema to SQLFire, use sqlf write-schema-to-sql and then modify the
SQL statements to include SQLFire-specic features such as table partitioning and replication. Then use an
interactive sqlf session to execute the script in SQLFire. See run on page 444.
When you migrate a schema from one SQLFire system to another, use sqlf write-schema-to-xml or use sqlf
write-schema-to-sql with the -dump-from-db option to include SQLFire-specic extensions in the DDL
commands.
Note: Databases such as Oracle 11g contain system tables with data types that are incompatible with the
DdlUtils 1.1 API. To export schemas or data from these databases, you must use the -schema-pattern
option with the sqlf command to exclude schemas that contain incompatible data types. See sqlf
write-schema-to-xml.
The sections that follow describe how to use the above sqlf commands to migrate a third-party database to
SQLFire.
97