These functions are deprecated. The use of backup_online () is preferred for database backups. Performing a backup with the destination file /dev/null is a good way of verifying a database's physical integrity.
All backup files, whether complete (created with backup) or partial (created with backup_prepare and backup_row of selected rows), begin with the complete schema that was effective at the time of the backup.
Backup and log files contain assumptions about the schema and row layout of the database. Hence it is not possible to use these for transferring data between databases. Attempt to do so will result in unpredictable results. Thus a log or backup may only be replayed on the same database, an empty database or a copy of the database which has had no schema changed since it was made. Also, when replaying a backup file onto an empty database, the +replay-crash-dump switch should be given on the executable command line.
This function requires dba privileges.
backup_prepare initiates the backup. This must be the first statement to execute in its transaction. The rest of the transaction will be a read only snapshot view of the state as of the last checkpoint. Checkpointing is disabled until backup_close is called.
backup_row writes the row given as parameter into the backup file that was associated to the current transaction by a prior backup_prepare. The row must be obtained obtained by selecting the pseudo column _ROW from any table.
The backup_flush function will insert a transaction boundary into the backup log. All rows backed up between two backup_flush calls will be replayed as a single transaction by replay. Having long intervals between backup_flush calls will cause significant memory consumption at replay time for undo logs.
The backup_close function terminates the backup and closes the file. The transaction remains a read only snapshot of the last checkpoint but checkpoints are now re-enabled. The transaction should be committed or rolled back after backup_close.