public class FBNBackupManager extends FBServiceManager implements NBackupManager
BUFFER_SIZE
Constructor and Description |
---|
FBNBackupManager()
Create a new instance of
FBNBackupManager based on the default GDSType. |
FBNBackupManager(GDSType gdsType)
Create a new instance of
FBNBackupManager based on a given GDSType. |
FBNBackupManager(java.lang.String gdsType)
Create a new instance of
FBNBackupManager based on a given GDSType name. |
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 backupLevel)
Sets the backup level (0 = full, 1..n = incremental)
|
void |
setCleanHistory(boolean cleanHistory)
Enables clean history on backup.
|
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).
|
attachDatabase, attachServiceManager, connectionPropertyValues, createRequestBuffer, executeServicesOperation, executeServicesOperation, getAuthPlugins, getBooleanProperty, getCharSet, getDatabase, getDbCryptConfig, getExpectedDb, getHost, getIntProperty, getLogger, getPassword, getPort, getPortNumber, getProperty, getServerName, getServerVersion, getServiceName, getUser, getWireCrypt, getWireCryptAsEnum, isWireCompression, queueService, setAuthPlugins, setBooleanProperty, setCharSet, setDatabase, setDbCryptConfig, setExpectedDb, setHost, setIntProperty, setLogger, setPassword, setPort, setPortNumber, setProperty, setServerName, setServiceName, setType, setUser, setWireCompression, setWireCryptAsEnum
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setDatabase
getDatabase, getHost, getLogger, getPort, getServerVersion, getWireCryptAsEnum, setHost, setLogger, setPort, setWireCryptAsEnum
getExpectedDb, getServiceName, setExpectedDb, setServiceName
getAuthPlugins, getCharSet, getConnectTimeout, getDbCryptConfig, getEncoding, getPassword, getPortNumber, getProcessId, getProcessName, getRoleName, getServerName, getSocketBufferSize, getSoTimeout, getType, getUser, getWireCrypt, isWireCompression, setAuthPlugins, setCharSet, setConnectTimeout, setDbCryptConfig, setEncoding, setPassword, setPortNumber, setProcessId, setProcessName, setRoleName, setServerName, setSocketBufferSize, setSoTimeout, setType, setUser, setWireCompression, setWireCrypt
connectionPropertyValues, getBooleanProperty, getBooleanProperty, getIntProperty, getIntProperty, getProperty, getProperty, setBooleanProperty, setIntProperty, setProperty
public FBNBackupManager()
FBNBackupManager
based on the default GDSType.public FBNBackupManager(java.lang.String gdsType)
FBNBackupManager
based on a given GDSType name.gdsType
- type must be PURE_JAVA, EMBEDDED, or NATIVEpublic FBNBackupManager(GDSType gdsType)
FBNBackupManager
based on a given GDSType.gdsType
- type must be PURE_JAVA, EMBEDDED, or NATIVEpublic void setBackupFile(java.lang.String backupFile)
NBackupManager
Warning: this method behaves identical to NBackupManager.addBackupFile(String)
.
setBackupFile
in interface NBackupManager
backupFile
- the location of the backup file.public void addBackupFile(java.lang.String backupFile)
NBackupManager
Specifying multiple backup files is only valid for restore, for backup only the first file is used.
Use NBackupManager.clearBackupFiles()
to clear earlier backup files.
addBackupFile
in interface NBackupManager
backupFile
- the location of the backup file.public void clearBackupFiles()
NBackupManager
NBackupManager.addBackupFile(String)
method.clearBackupFiles
in interface NBackupManager
public void backupDatabase() throws java.sql.SQLException
NBackupManager
backupDatabase
in interface NBackupManager
java.sql.SQLException
- if a database error occurs during the backuppublic void restoreDatabase() throws java.sql.SQLException
NBackupManager
Set NBackupManager.setPreserveSequence(boolean)
to preserve the original database GUID and replication sequence.
restoreDatabase
in interface NBackupManager
java.sql.SQLException
- if a database error occurs during the restoreNBackupManager.restoreDatabase()
public void fixupDatabase() throws java.sql.SQLException
NBackupManager
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 NBackupManager.setPreserveSequence(boolean)
to preserve the original database GUID and replication sequence.
fixupDatabase
in interface NBackupManager
java.sql.SQLException
- if a database error occurs during the fixuppublic void setBackupLevel(int backupLevel)
NBackupManager
setBackupLevel
in interface NBackupManager
backupLevel
- backup level (e.g. 0 = full backup, 1 = level 1 incremental backup based on level 0 backuppublic void setBackupGuid(java.lang.String guid)
NBackupManager
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 NBackupManager.setBackupLevel(int)
, but this is only checked server-side.
setBackupGuid
in interface NBackupManager
guid
- A GUID string of a previous backup, enclosed in braces.public void setNoDBTriggers(boolean noDBTriggers)
NBackupManager
setNoDBTriggers
in interface NBackupManager
noDBTriggers
- true
disable db triggers during backup or in-place restore.public void setInPlaceRestore(boolean inPlaceRestore)
NBackupManager
setInPlaceRestore
in interface NBackupManager
inPlaceRestore
- true
to enable in-place restorepublic void setPreserveSequence(boolean preserveSequence)
NBackupManager
This preserves the existing GUID and replication sequence of the original database (they are reset otherwise).
setPreserveSequence
in interface NBackupManager
preserveSequence
- true
to enable preserve sequencepublic void setCleanHistory(boolean cleanHistory)
NBackupManager
The backup will fail if NBackupManager.setKeepDays(int)
or NBackupManager.setKeepRows(int)
has not been called.
setCleanHistory
in interface NBackupManager
cleanHistory
- true
to enable clean historypublic void setKeepDays(int days)
NBackupManager
Server-side, this option is mutually exclusive with NBackupManager.setKeepRows(int)
, this is not enforced by the Java
code.
This option only has effect when setCleanHistory(true)
has been called.
setKeepDays
in interface NBackupManager
days
- number of days to keep history when cleaning, or -1
to clear current valueNBackupManager.setCleanHistory(boolean)
,
NBackupManager.setKeepRows(int)
public void setKeepRows(int rows)
NBackupManager
Server-side, this option is mutually exclusive with NBackupManager.setKeepDays(int)
, this is not enforced by the Java
code.
This option only has effect when setCleanHistory(true)
has been called.
setKeepRows
in interface NBackupManager
rows
- number of rows to keep history when cleaning, or -1
to clear current valueNBackupManager.setCleanHistory(boolean)
,
NBackupManager.setKeepDays(int)
Copyright © 2001-2023 Jaybird (Firebird JDBC) team. All rights reserved.