org.firebirdsql.management

Interface BackupManager

All Superinterfaces:
ServiceManager
Known Implementing Classes:
FBBackupManager

public interface BackupManager
extends ServiceManager

Implements the backup and restore functionality of Firebird Services API.
Authors:
Roman Rokytskyy
Steven Jardine

Field Summary

static int
BACKUP_CONVERT
Backup external files as tables.
static int
BACKUP_EXPAND
No data compression.
static int
BACKUP_IGNORE_CHECKSUMS
Ignore checksums.
static int
BACKUP_IGNORE_LIMBO
Ignore in-limbo transactions.
static int
BACKUP_METADATA_ONLY
Backup metadata only.
static int
BACKUP_NON_TRANSPORTABLE
Use non-transportable backup format.
static int
BACKUP_NO_GARBAGE_COLLECT
Do not collect garbage during backup.
static int
BACKUP_OLD_DESCRIPTIONS
Save old style metadata descriptions.
static int
RESTORE_DEACTIVATE_INDEX
Deactivate indices during restore.
static int
RESTORE_NO_SHADOW
Do not restore shadow database.
static int
RESTORE_NO_VALIDITY
Do not restore validity constraints.
static int
RESTORE_ONE_AT_A_TIME
Commit after completing restore of each table.
static int
RESTORE_USE_ALL_SPACE
Do not reserve 20% on each page for the future versions, useful for read-only databases.

Method Summary

void
addBackupPath(String path)
Add backup file to the list.
void
addBackupPath(String path, int size)
Add the file to the backup of the specified size.
void
addRestorePath(String path, int size)
Add the file to the multi-file database of the specified size for restore operation.
void
backupDatabase()
Perform the backup operation.
void
backupDatabase(int options)
Perform the backup operation.
void
backupMetadata()
Perform the backup operation, metadata only.
void
clearBackupPaths()
Clear the information about backup paths.
void
clearRestorePaths()
Clear the information about restore paths.
void
restoreDatabase()
Perform the restore operation.
void
restoreDatabase(int options)
Perform the restore operation.
void
setBackupPath(String backupPath)
Sets the location of the backup file.
void
setDatabase(String path)
Set the path to the database.
void
setRestorePageBufferCount(int bufferCount)
Set the default number of pages to be buffered (cached) by default in a restored database.
void
setRestorePageSize(int pageSize)
Set the page size that will be used for a restored database.
void
setRestoreReadOnly(boolean readOnly)
Set the read-only attribute on a restored database.
void
setRestoreReplace(boolean replace)
Set the restore operation to create a new database, as opposed to overwriting an existing database.
void
setVerbose(boolean verbose)
Set whether the operations of this BackupManager will result in verbose logging to the configured logger.

Methods inherited from interface org.firebirdsql.management.ServiceManager

getDatabase, getHost, getLogger, getPassword, getPort, getUser, setDatabase, setHost, setLogger, setPassword, setPort, setUser

Field Details

BACKUP_CONVERT

public static final int BACKUP_CONVERT
Backup external files as tables.
Field Value:
64

BACKUP_EXPAND

public static final int BACKUP_EXPAND
No data compression.
Field Value:
128

BACKUP_IGNORE_CHECKSUMS

public static final int BACKUP_IGNORE_CHECKSUMS
Ignore checksums.
Field Value:
1

BACKUP_IGNORE_LIMBO

public static final int BACKUP_IGNORE_LIMBO
Ignore in-limbo transactions.
Field Value:
2

BACKUP_METADATA_ONLY

public static final int BACKUP_METADATA_ONLY
Backup metadata only.
Field Value:
4

BACKUP_NON_TRANSPORTABLE

public static final int BACKUP_NON_TRANSPORTABLE
Use non-transportable backup format.
Field Value:
32

BACKUP_NO_GARBAGE_COLLECT

public static final int BACKUP_NO_GARBAGE_COLLECT
Do not collect garbage during backup.
Field Value:
8

BACKUP_OLD_DESCRIPTIONS

public static final int BACKUP_OLD_DESCRIPTIONS
Save old style metadata descriptions.
Field Value:
16

RESTORE_DEACTIVATE_INDEX

public static final int RESTORE_DEACTIVATE_INDEX
Deactivate indices during restore.
Field Value:
256

RESTORE_NO_SHADOW

public static final int RESTORE_NO_SHADOW
Do not restore shadow database.
Field Value:
512

RESTORE_NO_VALIDITY

public static final int RESTORE_NO_VALIDITY
Do not restore validity constraints.
Field Value:
1024

RESTORE_ONE_AT_A_TIME

public static final int RESTORE_ONE_AT_A_TIME
Commit after completing restore of each table.
Field Value:
2048

RESTORE_USE_ALL_SPACE

public static final int RESTORE_USE_ALL_SPACE
Do not reserve 20% on each page for the future versions, useful for read-only databases.
Field Value:
16384

Method Details

addBackupPath

public void addBackupPath(String path)
Parameters:
path - path to the backup file.

addBackupPath

public void addBackupPath(String path,
                          int size)
Add the file to the backup of the specified size. Firebird allows splitting the backup into multiple files, limiting the size of the backup file. This can be useful for example for creating a backup on CD or DVD.
Parameters:
path - path to the backup file.
size - max size of the file in bytes.

addRestorePath

public void addRestorePath(String path,
                           int size)
Add the file to the multi-file database of the specified size for restore operation.
Parameters:
path - path to the backup file.
size - max size of the database file in pages.

backupDatabase

public void backupDatabase()
            throws SQLException
Perform the backup operation.

backupDatabase

public void backupDatabase(int options)
            throws SQLException
Perform the backup operation.
Parameters:
options - a bitmask combination of the BACKUP_* static final fields for the backup operation

backupMetadata

public void backupMetadata()
            throws SQLException
Perform the backup operation, metadata only.

clearBackupPaths

public void clearBackupPaths()

clearRestorePaths

public void clearRestorePaths()

restoreDatabase

public void restoreDatabase()
            throws SQLException
Perform the restore operation.

restoreDatabase

public void restoreDatabase(int options)
            throws SQLException
Perform the restore operation.
Parameters:
options - A bitmask combination of RESTORE_* static final fields

setBackupPath

public void setBackupPath(String backupPath)
Parameters:
backupPath - the location of the backup file.

setDatabase

public void setDatabase(String path)
Set the path to the database. This method is used both for backup and restore operation.
Specified by:
setDatabase in interface ServiceManager
Parameters:
path - path to the database file.

In case of backup, value specifies the path of the existing database on the server that will be backed up.

In case of restore, value specifies the path of the single-file database where the backup will be restored to.


setRestorePageBufferCount

public void setRestorePageBufferCount(int bufferCount)
Set the default number of pages to be buffered (cached) by default in a restored database.
Parameters:
bufferCount - The page-buffer size to be used, a positive value

setRestorePageSize

public void setRestorePageSize(int pageSize)
Set the page size that will be used for a restored database. The value for pageSize must be one of: 1024, 2048, 4096, or 8192. The default value is 1024.
Parameters:
pageSize - The page size to be used in a restored database, one of 1024, 2048, 4196, 8192

setRestoreReadOnly

public void setRestoreReadOnly(boolean readOnly)
Set the read-only attribute on a restored database.
Parameters:
readOnly - If true, a restored database will be read-only, otherwise it will be read-write.

setRestoreReplace

public void setRestoreReplace(boolean replace)
Set the restore operation to create a new database, as opposed to overwriting an existing database.
Parameters:
replace - If true, the restore operation will attempt to create a new database if it does not exit or overwrite an existing one when it exists, false when restore should fail if database already exist (if it doesn't, a database will be successfully created).

setVerbose

public void setVerbose(boolean verbose)
Set whether the operations of this BackupManager will result in verbose logging to the configured logger.
Parameters:
verbose - If true, operations will be logged verbosely, otherwise they will not be logged verbosely

Copyright B) 2001 David Jencks and other authors. All rights reserved.