public interface NBackupManager extends ServiceManager
Modifier and Type | Method and Description |
---|---|
void |
addBackupFile(java.lang.String backupFile)
Add additional backup files.
|
void |
backupDatabase()
Perform the backup operation.
|
void |
clearBackupFiles()
Clear the information about backup files.
|
void |
fixupDatabase()
Perform the nbackup fixup operation.
|
void |
restoreDatabase()
Perform the restore operation.
|
void |
setBackupFile(java.lang.String backupFile)
Sets the location of the backup file.
|
void |
setBackupGuid(java.lang.String guid)
Sets the backup GUID (Firebird 4 and higher only).
|
void |
setBackupLevel(int level)
Sets the backup level (0 = full, 1..n = incremental)
|
void |
setCleanHistory(boolean cleanHistory)
Enables clean history on backup.
|
void |
setDatabase(java.lang.String path)
Set the path to the database.
|
void |
setInPlaceRestore(boolean inPlaceRestore)
Enables in-place restore.
|
void |
setKeepDays(int days)
Sets the number of days of backup history to keep.
|
void |
setKeepRows(int rows)
Sets the number of rows of backup history to keep (this includes the row created by the backup).
|
void |
setNoDBTriggers(boolean noDBTriggers)
Sets the option no database triggers when connecting at backup or in-place restore.
|
void |
setPreserveSequence(boolean preserveSequence)
Enables preserve sequence (for fixup or restore).
|
getDatabase, getHost, getLogger, getPort, getServerVersion, getWireCryptAsEnum, setHost, setLogger, setPort, setWireCryptAsEnum
getExpectedDb, getServiceName, setExpectedDb, setServiceName
getAuthPlugins, getCharSet, getConnectTimeout, getDbCryptConfig, getEncoding, getParallelWorkers, getPassword, getPortNumber, getProcessId, getProcessName, getRoleName, getServerName, getSocketBufferSize, getSoTimeout, getType, getUser, getWireCrypt, isWireCompression, setAuthPlugins, setCharSet, setConnectTimeout, setDbCryptConfig, setEncoding, setParallelWorkers, setPassword, setPortNumber, setProcessId, setProcessName, setRoleName, setServerName, setSocketBufferSize, setSoTimeout, setType, setUser, setWireCompression, setWireCrypt
connectionPropertyValues, getBooleanProperty, getBooleanProperty, getIntProperty, getIntProperty, getProperty, getProperty, setBooleanProperty, setIntProperty, setProperty
void setBackupFile(java.lang.String backupFile)
Warning: this method behaves identical to addBackupFile(String)
.
backupFile
- the location of the backup file.void addBackupFile(java.lang.String backupFile)
Specifying multiple backup files is only valid for restore, for backup only the first file is used.
Use clearBackupFiles()
to clear earlier backup files.
backupFile
- the location of the backup file.void clearBackupFiles()
addBackupFile(String)
method.void setDatabase(java.lang.String path)
setDatabase
in interface ServiceManager
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 database where the backup will be restored to.
void backupDatabase() throws java.sql.SQLException
java.sql.SQLException
- if a database error occurs during the backupvoid restoreDatabase() throws java.sql.SQLException
Set setPreserveSequence(boolean)
to preserve the original database GUID and replication sequence.
java.sql.SQLException
- if a database error occurs during the restorevoid fixupDatabase() throws java.sql.SQLException
A fixup will switch a locked database to 'normal' state without merging the delta, so this is a potentially
destructive action. The normal use-case of this option is to unlock a copy of a database file where the source
database file was locked with nbackup -L
or ALTER DATABASE BEGIN BACKUP
.
Set setPreserveSequence(boolean)
to preserve the original database GUID and replication sequence.
java.sql.SQLException
- if a database error occurs during the fixupvoid setBackupLevel(int level)
level
- backup level (e.g. 0 = full backup, 1 = level 1 incremental backup based on level 0 backupvoid setBackupGuid(java.lang.String guid)
The backup GUID is the GUID of a previous backup of the (source) database. This is used by Firebird to backup the pages modified since that backup.
This setting is mutually exclusive with setBackupLevel(int)
, but this is only checked server-side.
guid
- A GUID string of a previous backup, enclosed in braces.void setNoDBTriggers(boolean noDBTriggers)
noDBTriggers
- true
disable db triggers during backup or in-place restore.void setInPlaceRestore(boolean inPlaceRestore)
inPlaceRestore
- true
to enable in-place restorevoid setPreserveSequence(boolean preserveSequence)
This preserves the existing GUID and replication sequence of the original database (they are reset otherwise).
preserveSequence
- true
to enable preserve sequencevoid setCleanHistory(boolean cleanHistory)
The backup will fail if setKeepDays(int)
or setKeepRows(int)
has not been called.
cleanHistory
- true
to enable clean historyvoid setKeepDays(int days)
Server-side, this option is mutually exclusive with setKeepRows(int)
, this is not enforced by the Java
code.
This option only has effect when setCleanHistory(true)
has been called.
days
- number of days to keep history when cleaning, or -1
to clear current valuesetCleanHistory(boolean)
,
setKeepRows(int)
void setKeepRows(int rows)
Server-side, this option is mutually exclusive with setKeepDays(int)
, this is not enforced by the Java
code.
This option only has effect when setCleanHistory(true)
has been called.
rows
- number of rows to keep history when cleaning, or -1
to clear current valuesetCleanHistory(boolean)
,
setKeepDays(int)
Copyright © 2001-2024 Jaybird (Firebird JDBC) team. All rights reserved.