Code Block | ||||
---|---|---|---|---|
| ||||
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
...
1 | Type | Name | Comment |
2 | sdaiString | serverContextId | A superuser context identification, from edmiDefineServerContext |
3 | options | See description of the available options below. | |
4 | backupLocation | Optionally specify directory for backups, i.e., <databaseLocation> is default | |
5 | backupName | Specify the name of the backup included in backup file name. The total backup file name is described below. | |
6 | numberOfBackupVersions | Specify number of backups versions wanted. The backups are handled in a circular list. | |
7 | backupStartTime | Specify 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 | backupIntervallTime | Specify the time interval between backups, in seconds. If nothing is given, the backup is performed once. | |
9 | passwordOfBackupDatabaseToDelete | Optional password. | |
10 | extensionsArgs | For 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. |
...
Return Value
...
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|
Options
...
Option | Comment |
COMPRESS_BACKUP | The backup files are compressed if this option is selected. |
CONTINUE_WITH_NEXT_VERSION | The backup will continue with the next backup version. |
DELETE_EXISTING_BACKUP | The existing backup version will be overwritten and deleted. |
TERMINATE_ACTIVE_BACKUP | The running backup will be terminated by this backup command. |
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.
Returns:
A completion code of datatype EdmiError is the returned function value. The completion code has the following values:
Completion code = 0 : Operation successfully performed.
Completion code != 0: Error in operation. Completion code is an _EDMinterface_ error code. Use edmiGetErrorText to get the error text corresponding to the error code.
EXAMPLE
EdmiError rstat;
SdaiServerContext superContextId;
SdaiOptions options =
Example
...
Code Block | ||
---|---|---|
| ||
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 (Content by label) | ||||||
---|---|---|---|---|---|---|
|
. . .