Check the backup consistency without restoring the database.
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)
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 |
This function tests the backup (specified with a
file_name
and alabel
) 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.)
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:
|
MCO_E_DISK_SEEK | Failure to set the position in the backup file |
{ 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); }