edmiRemoteBackupDatabase

EdmiError edmiRemoteBackupDatabase(SdaiServerContext serverContextId,
                                     SdaiOptions        options, 
                                     SdaiString         backupLocation, 
                                     SdaiString         backupName,  
                                     SdaiInteger        numberOfBackupVersions, 
                                     SdaiString         backupStartTime, 
                                     SdaiString         backupIntervalTime, 
                                     SdaiString         passwordOfBackupDatabaseToDelete, 
                                     SdaiSelect         extensionsArgs, 
                                     SdaiInvocationId   *edmiInvocationId); 


This function takes backup of the whole EDMdatabase into a directory. Underlying directories with backup versions are created if more than one backup version is wanted. These backup versions can be restored later with the corresponding edmiRemoteRestoreBackup function. These backup/restore functions require that the EDMdatabase version is the same. This function is legal for superuser only. One EDMserver thread will run as a kind of "backup daemon". The backup daemon can be started on a given date and time and optionally a periodic execution can be specified, i.e., run backup every midnight as an example.The backup will be given a name and be located on a user specified directory and each backup version will be a sub-directory to this one. The default directory will be the database directory. A maximum number of backup versions will be given, and when the max versions is reached, the oldest will be overwritten by the youngest and so on. A backup result file will be written to the backup directory for each backup operation. The database backup files can be optionally compressed.
During backup operation, the EDMdatabase will be fully accessible for read/query request from any clients, but no write transactions will be permitted, i.e., edmiStartModelsWriteTransaction operation will fail with "Illegal operation during database backup operation". EDMI operations like creation/deletion of repositories, models, users/groups and other system resources will be illegal during database backup operations. Hence, these operations will fail in the same way as an edmiStartModelsWriteTransaction operation

The backup file name consists of the following elements:
<BackupLocation>/EDMbackup<dbName><BackupName>/V<nn>/*.bdb
where nn is for number 1 to 99. If number of backup versions is set to zero (0) the "/V<nn>" directory is omitted. <dbName> is the name of the database and "EDMbackup_" is a fixed string prefix.

Arguments


1TypeNameComment
2sdaiStringserverContextIdA superuser context identification, from edmiDefineServerContext
3 options

See description of the available options below.
Multiple options may be selected by combining them with the bitwise OR operator.

4 backupLocationOptionally specify directory for backups, i.e., <databaseLocation> is default
5 backupNameSpecify the name of the backup included in backup file name. The total backup file name is described below.
6 numberOfBackupVersionsSpecify number of backups versions wanted. The backups are handled in a circular list.
7 backupStartTimeSpecify the start time for the backup. yyyy.mm.dd.hh.mm.ss (year.month.day.hour.min.secs). If not given, the backup starts at once.
8 backupIntervallTimeSpecify the time interval between backups, in seconds. If nothing is given, the backup is performed once.
9 passwordOfBackupDatabaseToDeleteOptional password.
10 extensionsArgsFor future extension. Must be NULL
11 edmiInvocationId

Not yet used. When the edmiInvocationId is specified unequal NULL, the actual operation will be asynchronous and a handle (identifier) of the call will be returned in the edmiInvocationId argument.
This handle can be used in later operations for requesting the status (waiting, running, finished ..) and the result of the actual operation.

Return Value


Error rendering macro 'excerpt-include' : User 'null' does not have permission to view the page 'US:_r_EDMInterface'.

 

Options


  

OptionComment
COMPRESS_BACKUPThe backup files are compressed if this option is selected.
CONTINUE_WITH_NEXT_VERSIONThe backup will continue with the next backup version.
DELETE_EXISTING_BACKUPThe existing backup version will be overwritten and deleted.
TERMINATE_ACTIVE_BACKUPThe running backup will be terminated by this backup command.

 

Example


 

 EdmiError rstat;
 SdaiServerContext superContextId;
  
 SdaiOptions options = DELETE_EXISTING_BACKUP | COMPRESS_BACKUP;
 SdaiString backupLocation = "C:/home/backups/";
 SdaiString backupName = "PROJ1";
 SdaiInteger numberOfBackupVersions = 7; /* every day in week */
 SdaiString backupStartTime = "2007.07.01.00.00.00"; /* from July 1st 2007 */
 SdaiInteger backupIntervalTime = 24 * 60 * 60; /* every 24 hours */
 SdaiString databasePassword = NULL;
 . . .
  
 /* Create Server Context */
 rstat = edmiDefineServerContext("SuperContext",
 "superuser", "", "super123",
 "TCP", "9090", "MyServerHost",
 NULL, NULL, NULL, NULL, NULL, &superContextId);
  
 /* Backup the whole database */
 if (rstat = edmiRemoteBackupDatabase(superContextId, options, backupLocation,
 backupName, numberOfBackupVersions, backupStartTime,
 backupIntervalTime, databasePassword, NULL, NULL) {
 printf("\nError %d in edmiRemoteBackupDatabase: %s", rstat,
 edmiGetErrorText(rstat));
 goto error;
 }

 

See also

Filter by label

There are no items with the selected labels at this time.

 

Â