mco_backup_verify

Check the backup consistency without restoring the database.

For an overview see page Incremental Online Backup in C

Prototype

 
    void	mco_backup_verify(	/*IN*/ mco_db_h con,
                    /*IN*/ char const* file_name,
                    /*IN*/ char const* label,
                    /*IN*/ char const* cipher,
                    /*IN*/ char* err_buf,
                    /*IN-OUT*/ unsigned int * err_buf_sz)
 

Arguments

con A database connection used to verify the backup
file_name The name of the backup file to verify
label The backup's label to verify
cipher An optional cipher to decrypt the backup
err_buf A buffer for error description
err_buf_sz On input this specifies the size of err_buf. On return it contains the number of characters written into the buffer. If err_buf_sz is null the routine returns MCO_E_ILLEGAL_PARAM

Description

This function tests the backup (specified with a file_name and a label) for validity by reading the backup one record at a time and then checks the CRC of all of the records. In other words it performs the same operations as the restore operation but without modifying the existing database. (See the Incremental Backup and Restore page for further details.)

Return Codes

MCO_S_OK The restore was successful
MCO_E_DISK_OPEN Could not open the backup file
MCO_E_ILLEGAL_PARAM

One of the following error conditions:

  • Incremental backups in the backup file are out of order
  • The label was not found in the backup file
  • The backup cipher key was not given
MCO_E_DISK_SEEK Failure to set the position in the backup file

Example

     
    {
        mco_db_h con;
        MCO_RET rc;
        char * filename = “backup.bak”;
        char * label = “a label”;
 
        /* connect to a database */
        rc = mco_db_connect( db_name, &con );
 
        /* restore the database */
        rc = mco_backup_verify( con, filename, label, 0, 0);
    }
     

Files

Header file:
mco.h
Source file:
mcoabst.c
Library:
libmcolib.a