Save the cache to persistent media.
MCO_RET mco_disk_save_cache( /*IN*/ mco_db_h db, /*IN*/ char const* file_path );
db — The database handle that was established by mco_db_connect().file_path — The path to the file where the cache image will be saved.This function saves the Disk Manager cache to persistent media.
MCO_S_OK — Cache image successfully saved.MCO_E_DISK_OPEN — Error opening/creating file on persistent storage device.MCO_E_DISK_WRITE — Error writing to persistent storage device.MCO_E_DISK_CLOSE — Error closing persistent storage device.
const char * dbname = "SimpleDb";
int main(int argc, char* argv[])
{
mco_db_h db;
MCO_RET rc;
mco_device_t dev[4];
mco_db_params_t db_params;
char * file_path = "c:\\temp\\backup\\cache.sav";
...
rc = mco_db_open_dev( dbname, simple_get_dictionary(), dev, 4, &db_params );
if ( MCO_S_OK != rc )
{
rc = mco_db_connect( dbname, &db );
...
rc = mco_disk_save_cache( db, file_path);
...
}
}