apache > db
Apache DB Project
 
Font size:      

Creating and Preparing the Database for Read-Only Use

Creating and Preparing the Database for Read-Only Use

To create databases for use on read-only media:

  1. Create and populate the database on read-write media.
  2. Commit all transactions and shut down Derby in the prescribed manner (see Shutting Down Derby or an Individual Database).

    If you do not shut down Derby in the prescribed manner, Derby will need to perform recovery the next time the system boots. Derby cannot perform recovery on read-only media.

  3. Delete the tmp directory if one was created within your database directory. If you include this directory, Derby will attempt to delete it and will return errors when attempting to boot a database on read-only media.
  4. For the read-only database, set the property derby.storage.tempDirectory to a writable location. Derby needs to write to temporary files for large sorts required by such SQL statements as ORDER BY, UNION, DISTINCT, and GROUP BY. For more information about this property, see "derby.storage.tempDirectory" in Tuning Derby. For example:
    derby.storage.tempDirectory=c:/temp/mytemp
    

    Be sure to set this property such that it is deployed with the database. For more information, see Embedded Systems and Properties.

  5. Configure the database to send error messages to a writable file or to an output stream. For information, see the derby.stream.xxx properties in Tuning Derby.
    derby.stream.error.file=c:/temp/mylog.LOG
    

    Be sure to set this property such that it is deployed with the database. For more information, see Embedded Systems and Properties.


Previous Page
Next Page
Table of Contents
Index