FrontBase logo

FrontBase Documentation

FrontBase logo

Backtrack:
  Welcome!
    4. Administering a FrontBase Server
      4.9. Backup and Restore
Updated: 20-Nov-2000
prevnext
Table of Contents

4.9.1. Exporting Schema and Content Data

FrontBase allows you to export a complete database to flat files. The SQL statement has the following syntax:

WRITE ALL OUTPUT('<output-directory>' [,'YES']);

All generated files will be saved in the specified <output-directory> The file <output-directory>/schema.sql contains SQL statements necessary to recreate the database. If 'YES' argument is supplied, a file for each base table will be generated as well. Each base table file holds the content data (rows) for the table. The <output-directory>/schema.sql file will include the necessary import statements.

Note that it is important to capitalize 'YES' if that option is used. This should be corrected in a future version of FrontBase.

A flat file holding the content data for a given table has the following lay-out:

Line 1: <schema name>.<table name>
Line 2: Column count
Line 3: <column #> <column name>,"~"
Line 4: ...
Line n: <column #> <column name>,"~\n"
-- n-2 == column count
Line n+1: <row data>
Line n+2: -"-

Example:

A database with a single user, FB, and a single table , T0, exported as:

WRITE ALL * OUTPUT('/tmp/db5', 'YES');

/tmp/db5/schema.sql:

CREATE USER "FB";
CREATE SCHEMA "FB" AUTHORIZATION "FB";
CREATE TABLE "T0" (
"C0" INTEGER, "C1" INTEGER);

COMMIT;

SET SESSION AUTHORIZATION "FB";
INSERT INTO "FB"."T0" FROM 'FrontBase' INPUT('/tmp/db5/2_13');
COMMIT;

/tmp/db5/2_13:

FB.T0
2
  1 "C0","~"
  2 "C1","~\n"
1~2~
3~4~


If you have feedback or questions on this document, please send e-mail to doc-feedback@frontbase.com. Please reference the section number and topic. Thanks!!

©2000 FrontBase, Inc. All rights reserved.