Specifics of the Backup Process in eXtremeDB/rt
The backup mechanism in eXtremeDB/rt differs from that in the standard eXtremeDB library. In eXtremeDB/rt, when using persistent storage, an additional device is required to store metadata for incremental (online) backup operations.
Additionally, the
mco_db_params_tstructure has been modified as follows:
- The
backup_map_filenameparameter has been removed.- A new assignment type,
MCO_MEMORY_ASSIGN_INCR_BACKUP_META, has been added to theassignmentfield. This indicates that the device is used to store incremental backup metadata for a persistent database. The device type can be either a file or flash memory.The following example shows how to initialize a persistent database with incremental online backup enabled over a file system:
n_dev = 4; dev[0].type = MCO_MEMORY_CONV; dev[0].assignment = MCO_MEMORY_ASSIGN_DATABASE; dev[0].size = DATABASE_SEGMENT_SIZE; dev[0].dev.conv.ptr = (char*)malloc(DATABASE_SEGMENT_SIZE); dev[1].type = MCO_MEMORY_CONV; dev[1].assignment = MCO_MEMORY_ASSIGN_CACHE; dev[1].size = CACHE_SEGMENT_SIZE; dev[1].dev.conv.ptr = (char*)malloc(CACHE_SEGMENT_SIZE); dev[2].type = MCO_MEMORY_FILE; dev[2].assignment = MCO_MEMORY_ASSIGN_PERSISTENT; sprintf(dev[2].dev.file.name, FILE_PREFIX "%s.db0", dbName); dev[2].dev.file.flags = MCO_FILE_OPEN_NO_FSYNC | MCO_FILE_OPEN_TRUNCATE; dev[3].type = MCO_MEMORY_FILE; dev[3].assignment = MCO_MEMORY_ASSIGN_INCR_BACKUP_META; sprintf(dev[3].dev.file.name, FILE_PREFIX "%s.bm", dbName); mco_db_params_init(&db_params); db_params.mode_mask |= MCO_DB_INCREMENTAL_BACKUP_ENABLED | MCO_DB_INCREMENTAL_BACKUP_PROCESSING; db_params.backup_map_size = 1 * 1024 * 1024; /* Customize parameters according to application requirements */ db_params.mem_page_size = MEMORY_PAGE_SIZE; db_params.disk_page_size = DISK_PAGE_SIZE; db_params.disk_max_database_size = MAX_DATABASE_SIZE; rc = mco_db_open_dev(dbName, schema_get_dictionary(), dev, n_dev, &db_params);
For detailed information on database backup and restore in eXtremeDB, refer to the Database Backup and Restore section in the User Guide.