Class FBNBackupManager

    • Constructor Detail

      • FBNBackupManager

        public FBNBackupManager()
        Create a new instance of FBNBackupManager based on the default GDSType.
      • FBNBackupManager

        public FBNBackupManager​(java.lang.String gdsType)
        Create a new instance of FBNBackupManager based on a given GDSType name.
        Parameters:
        gdsType - type must be PURE_JAVA, EMBEDDED, or NATIVE
      • FBNBackupManager

        public FBNBackupManager​(GDSType gdsType)
        Create a new instance of FBNBackupManager based on a given GDSType.
        Parameters:
        gdsType - type must be PURE_JAVA, EMBEDDED, or NATIVE
    • Method Detail

      • addBackupFile

        public void addBackupFile​(java.lang.String backupFile)
        Description copied from interface: NBackupManager
        Add additional backup files.

        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.

        Specified by:
        addBackupFile in interface NBackupManager
        Parameters:
        backupFile - the location of the backup file.
      • backupDatabase

        public void backupDatabase()
                            throws java.sql.SQLException
        Description copied from interface: NBackupManager
        Perform the backup operation.
        Specified by:
        backupDatabase in interface NBackupManager
        Throws:
        java.sql.SQLException - if a database error occurs during the backup
      • fixupDatabase

        public void fixupDatabase()
                           throws java.sql.SQLException
        Description copied from interface: NBackupManager
        Perform the nbackup fixup operation.

        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.

        Specified by:
        fixupDatabase in interface NBackupManager
        Throws:
        java.sql.SQLException - if a database error occurs during the fixup
      • setBackupLevel

        public void setBackupLevel​(int backupLevel)
        Description copied from interface: NBackupManager
        Sets the backup level (0 = full, 1..n = incremental)
        Specified by:
        setBackupLevel in interface NBackupManager
        Parameters:
        backupLevel - backup level (e.g. 0 = full backup, 1 = level 1 incremental backup based on level 0 backup
      • setBackupGuid

        public void setBackupGuid​(java.lang.String guid)
        Description copied from interface: NBackupManager
        Sets the backup GUID (Firebird 4 and higher only).

        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.

        Specified by:
        setBackupGuid in interface NBackupManager
        Parameters:
        guid - A GUID string of a previous backup, enclosed in braces.
      • setNoDBTriggers

        public void setNoDBTriggers​(boolean noDBTriggers)
        Description copied from interface: NBackupManager
        Sets the option no database triggers when connecting at backup or in-place restore.
        Specified by:
        setNoDBTriggers in interface NBackupManager
        Parameters:
        noDBTriggers - true disable db triggers during backup or in-place restore.
      • setInPlaceRestore

        public void setInPlaceRestore​(boolean inPlaceRestore)
        Description copied from interface: NBackupManager
        Enables in-place restore.
        Specified by:
        setInPlaceRestore in interface NBackupManager
        Parameters:
        inPlaceRestore - true to enable in-place restore
      • setPreserveSequence

        public void setPreserveSequence​(boolean preserveSequence)
        Description copied from interface: NBackupManager
        Enables preserve sequence (for fixup or restore).

        This preserves the existing GUID and replication sequence of the original database (they are reset otherwise).

        Specified by:
        setPreserveSequence in interface NBackupManager
        Parameters:
        preserveSequence - true to enable preserve sequence