Database Maintenance Tools for FirstSQL/J
FirstSQL/J Version 2.0 includes two utilities for maintaining physical
databases -- Maint and MaintGui. Both utilities provide capability to:
- copy a physical database,
- backup a physical database, including online backup,
- restore a physical database from backup,
- build a new physical database, and
- modify database settings.
A 3rd utility - Build, supports building a new physical database.
For complete description of the Maint utilities and subscreens see the documentation.
Physical databases are normally stored in a sub-directory on the local
file system. The Maint utilities also support databases stored in zip or
jar files, which can be maintained over the network using ftp or http.
This section has 4 sub-sections:
- Maint Concepts
- MaintGui Utility Maint Utility - command line equivelent of MaintGUIBuild Utility
build new database, command-line interface
Maint Concepts
Physical Database
A FirstSQL/J physical database is a sub-directory containing the
components of the physical database:
- system catalog (definition_schema)
- user catalogs
- header file for controlling physical database
- roll back & roll forward journals
Under each user catalog are a set of user schemas. Each schema contains
user tables, views, classes, indexes, privileges.

FirstSQL/J Database Structure
The contents of the sub-directory are controlled by the ORDBMS and should
contain no other files.
Each physical database has the following settings,
- Mode:
- Active -- full writeable database.
- Standby -- readonly database dynamically mirroring an active
database, standing by for online recovery from active database failure.
- Replica -- readonly database dynamically mirroring an active
database, only used for offline recovery.
- Backup -- readonly database that is a snapshot of an active
database, for offline restore.
- Readonly -- readonly database that can never be written.
- Id: unique number assigned to active database, mirrored in standby,
replica, backup.
- Gen: generation number, incremented for each run where updates were
made.
- Copy: Standby, Replica, Backup database use the Copy # from their
parent incremented by 1.
- Journal Path: for online backup, specifies the directory for storage
of the roll forward journal. If an empty string, the physical database
directory is used.
Backup and Restore
An Active physical database is backed up by copying its contents to a
backup location. An Active physical database is restored by replacing its
contents from the backup location.
Backup can be either offline or online. In both cases, a snapshot of the
Active database is first backed up. In offline backup, restore simply
copies the snapshot replacing any modifications since the backup.
In online backup, the ORDBMS writes modification information to the roll
forward journal. In this case, restore replaces the Active database with
the backup snapshot and then uses the journal to roll forward
modifications made since the backup.
Standby and Replica Modes
Standby and Replica databases are only supported in the Enterprise server.
Both types of physical databases provide online mirroring of an Active
database. Each Standby or Replica must have a separate server process
running in order to maintain the Active database. These servers must be
started before the Active server.
An Active server can only have one secondary mirroring server, either
Standby and Replica, but these can be 'daisy-chained'. A Standby server
can be mirrored by another Standby server or a Replica server, a Replica
server mirrored by another Replica server, and so on.
Maint Resources
The Maint Utilities keep a persistent list of current databases.
The utilities display this list at program start.
The database list is used for convenient viewing and selection of
databases for performing maintenance.
Maint provides functions for adding and dropping databases from the list.
For auditing purposes, the Maint Utilities append lines to a log file --
maint.log.
The log file records each Maint run and each copy operation.
Each entry is timestamped.
Maint adds entries to the end of the file so the log file always grows
in size.
This utility provides a GUI for maintaining physical databases. The main
screen shows the current database list and contains a set of buttons for
operations on databases. It also contains an area for viewing the current
selected database. The selected database is changed by picking from the
database list or by entering the URL for a database.
MaintGui provides full functionality in maintaining physical databases:
- Viewing Database Information
- Copying a Database
- Building a new Database
- Change Database Settings
- Database List Maintenance
The MaintGui Main Screen is the central control point for Maint
operations.
The Main Screen provides capabilities for viewing information about
physical databases and options for copying, backing up, restoring,
building databases and for modifying settings for a database.

The Main Screen divides into 2 major portions.
The top half is a scrollable display for the current database list.
The Copy, Backup and Restore Sub-Screens share the top half with
the Main Screen.
The bottom half has an area for viewing the selected database,
on the left. On the right, it has a column of option buttons.
The scrollable display in the top half of the Main Screen shows
the contents of the current list of databases.
The Maint Utilities keep the database list in persistent
storage.
Copy/Backup/Restore Sub-Screens
Copy operations are performed with sub-screens off the Main
Screen.
These sub-screens replace the bottom half of the Main
Screen and retain the top half with the scrollable database
list.
There are 3 sub-screens --
,
Copy, Backup, Restore buttons on the
Main Screen.
Each sub-screen has the same general format -- 2 database
display areas on the left and right.
Normally, the left database is the source for the
operation and the right database is the target,
however the target is on the left and the source is on
the right in the Restore Sub-Screen and when From
is selected on the Copy Sub-Screen.
Before a copy can proceed, a source and target database
must be selected.
Options above each display area allow this selection.
To select from the database list, first highlight the
database in the scrollable list, then press the
"Pick Current from List" button.
For databases not in the list, press "Enter URL"
to enter the URL for the database.
The target database for the copy does not need to exist.
Maint will create any needed subdirectories for the
target database.
All three sub-screens provide an Override check box at
the top of the sub-screen.
Maint validates both the source and target database before
proceeding with a copy.
The Override option allows the operator to override certain
validations.
When the Override option is checked, errors that can be
overridden bring up an Override Dialog where the operator
can confirm whether the copy can continue.
When the Override option is not checked, these errors will
abort the copy.
The Copy and Backup Sub-Screens provide
additional options.
The Copy Sub-Screen supports a variety of copy operations.
It is used to copy Active, Standby, Replica and Readonly
databases and to restore an Active database from a Standby
or Replica database.
The Copy Sub-Screen can also be used for offline backup and
restore.
The Copy Sub-Screen provides 2 additional options:
- To or From -- specifies the mode of the copy.
- Type Drop-Down Choice -- select the type of the database on
the right-hand side:
- Image -- copy an Active or Readonly database to
an Active
- Standby -- copy an Active or Standby database to
a Standby or copy an Active database from a Standby
- Replica -- copy an Active, Standby or Replica database
to a Replica or
copy an Active database from a Replica
- Backup -- offline backup (to)
or restore (from) of an Active database
- Readonly -- copy an Active database to a Readonly
If no Type selection is made, defaults are used.
The following copy operations are possible if To is selected:
Copy To
|
Description
|
active -> image
|
create a new Active database that is the image of the source
|
active -> standby
|
create a Standby database for dynamic mirroring and online recovery
|
active -> replica
|
create a Replica database for dynamic mirroring
|
active -> backup
|
make an offline Backup
|
standby -> standby
|
create a Standby database for dynamic mirroring and online recovery
|
standby -> replica
|
create a Replica database for dynamic mirroring
|
replica -> replica
|
create a Replica database for dynamic mirroring
|
active -> readonly
|
create a Readonly database
|
readonly -> image
|
create an Active database from a Readonly database
|
The following copy operations are possible if From is selected:
Copy From
|
Description
|
active <- standby
|
restore Active from Standby
|
active <- replica
|
restore Active from Replica
|
active <- backup
|
restore Active from offline Backup
|
The Backup Sub-Screen performs online and offline
backups.
It includes the Online checkbox for selecting
online or offline backup.
The source (Active) database is always on the left.
The target (Backup) database is always on the right.
The Restore Sub-Screen restores online and offline
backups.
It automatically selects online or offline mode based on
information in the Active database and the Backup Database.
The target (Active) database is always on the left.
The source (Backup) database is always on the right.
The Build button on the Main Screen brings up the
Build Dialog, for creating a new physical database.
It provides for entry of the directory path for the new
database and for entry of the logical catalogs for the
database.
The build path must be entered as a file system path,
not as a URL as in other parts of Maint.
Build expects the entered path to reference an
empty directory or one that doesn't exist
(it will be created as needed).
When the build directory already contains files,
the build is not performed unless Override is selected.
Checking the Override checkbox requests operator override
when the directory is not empty.
One or more names for logical catalogs can be entered
in the Build Dialog, but at least one must be defined for
a database.
The catalog names entered define the list of logical
catalogs for the database.
The first in the list is the primary (default)
catalog.
Build creates a basic database containing the system
schema -- definition_schema, the logical catalogs
specified and a single user - adm.
The associated adm schema is placed in the primary
catalog.
The adm user has privileges to create other users.
The new database is an Active database.
This utility provides a command-line interface for maintaining physical
databases. The Maint utility prompts for single line commands.
Each command begins with a keyword and requests a specific database
operation. Maint can also be run in batch mode using an input file.
The Build utility is a command-line application for creating a new
FirstSQL/J Physical Database. Build creates a basic physical database
containing no user tables and a single user - 'adm'. Any number of user
catalogs may be created in the new database.
Copyright 2002 FFE Software,
Inc. All rights reserved
worldwide
|