|
|
|
|
- Miscellaneous
- Necessary rights
HInfoBackup (Function) In french: HInfoSauvegarde
Available only with this kind of connection
Returns information about one or more backups performed on an HFSQL Client/Server server. The backups have been performed by HBackup (or via the HFSQL Control Center) and they can be restored by HRestoreBackup (or via the HFSQL Control Center).
// Affiche les informations sur les sauvegardes dans un champ Table sEtat is string = HInfoBackup(gcnxConnexion) sLig is string FOR EACH STRING sLig OF sEtat SÉPARÉE BY EOT IF sLig ~="" THEN CONTINUE TableAdd(TABLE_Sauvegardes) nInd is int = TableCount(TABLE_Sauvegardes) TABLE_Sauvegardes.COL_IDSauvegarde[nInd] = ExtractString(sLig, 1) TABLE_Sauvegardes.COL_DateHeure[nInd] = ExtractString(sLig, 2) TABLE_Sauvegardes.COL_Filtre[nInd] = ExtractString(sLig, 3) TABLE_Sauvegardes.COL_Nom[nInd] = ExtractString(sLig, 4) TABLE_Sauvegardes.COL_Description[nInd] = ExtractString(sLig, 5) TABLE_Sauvegardes.COL_Etat[nInd] = ... SWITCH(Val(ExtractString(sLig, 6)) + 1, "En cours", "Effectuée", "Annulée", "Erreur") TABLE_Sauvegardes.COL_PourMille[nInd] = ExtractString(sLig, 7) END Syntax
Information about the backups performed on the server Hide the details
<Result> = HInfoBackup(<Connection>)
<Result>: Character string Description of backups performed on the specified server. This description has the following format:
<Identifiant de la sauvegarde 1> + TAB + <Date de la sauvegarde 1> + TAB + <Fichiers sauvegardés> + TAB + <Chemin de la destination de la sauvegarde 1> + TAB + <Description> + TAB + <Etat> + TAB + <Pour mille> + TAB + <Message d'erreur> + TAB + <Type> + TAB + <Identifiant de la sauvegarde complète> + TAB + <Avec index> + TAB + <Compression> + EOT where:- <Files Saved> is the list of data saved separated by semicolons (";").
<Status> corresponds to an integer (or to an Integer constant) used to find out the backup status:
| | | hBackupCanceled | 2 | Backup canceled | hBackupCompleted | 1 | Backup completed | hBackupError | 3 | Error during backup | hBackupInProgress | 0 | Backup in progress |
- <Per Thousand> corresponds to the rate of backup completion if the backup is in progress (expressed in per thousand).
- <Error Message> is the error message if the backup failed.
- <Type> corresponds to an integer (or to an Integer constant) used to find out the type of backup:
| | | hBackupDifferential | 1 | Differential backup | hBackupFull | 0 | Full backup |
- <Identifier of Full Backup> corresponds to the identifier of the corresponding full backup in case of differential backup.
- <With Index>: Used to find out whether the backup contains the indexes:
- 0 if the backup of indexes was not performed,
- 1 if the backup of indexes was performed.
- <Compression>: Constant corresponding to the backup compression:
- zipFormatNone: the backup is not compressed.
- zipFormatZip: the backup is compressed.
Remark: the separator used between the different descriptions is "EOT" (instead of "CR") because the different description parameters can contain Carriage Return characters (CR). <Connection>: Character string or Connection variable Connection to the server whose backups will be listed. This connection corresponds to:
Information about a specific backup Hide the details
<Result> = HInfoBackup(<Connection> , <Backup identifier>)
<Result>: Character string Description of specified backup on the specified server. This description has the following format:
<Identifiant de la sauvegarde 1> + TAB + <Date de la sauvegarde 1> + TAB + <Fichiers sauvegardés> + TAB + <Chemin de la destination de la sauvegarde 1> + TAB + <Description> + TAB + <Etat> + TAB + <Pour mille> + TAB + <Message d'erreur> + TAB + <Type> + TAB + <Identifiant de la sauvegarde complète> + TAB + <Avec index> + TAB + <Compression> + EOT where:- <Files Saved> is the list of data saved separated by semicolons (";").
<Status> corresponds to an integer (or to an Integer constant) used to find out the backup status:
| | | hBackupCanceled | 2 | Backup canceled | hBackupCompleted | 1 | Backup completed | hBackupError | 3 | Error during backup | hBackupInProgress | 0 | Backup in progress |
- <Per Thousand> corresponds to the rate of backup completion if the backup is in progress (expressed in per thousand).
- <Error Message> is the error message if the backup failed.
<Type> corresponds to an integer (or to an Integer constant) used to find out the type of backup:
| | | hBackupDifferential | 1 | Differential backup | hBackupFull | 0 | Full backup |
- <Identifier of Full Backup> corresponds to the identifier of the corresponding full backup in case of differential backup.
- <With Index>: Used to find out whether the backup contains the indexes:
- 0 if the backup of indexes was not performed,
- 1 if the backup of indexes was performed.
- <Compression>: Constant corresponding to the backup compression:
- zipFormatNone: the backup is not compressed.
- zipFormatZip: the backup is compressed.
Remark: the separator used between the different descriptions is "EOT" (instead of "CR") because the different description parameters can contain Carriage Return characters (CR). <Connection>: Character string or Connection variable Connection to the server that performed the backup. This connection corresponds to: <Backup identifier>: Integer Identifier of backup whose characteristics are requested. This identifier is returned by HBackup. Remarks Miscellaneous - HInfoBackup is used to list the tasks performed or the current tasks. The scheduled tasks that have not been performed are not listed.
- The backups performed by the HFSQL Control Center and the ones performed by programming are listed.
- The dates and times are expressed in universal time (UTC).
Necessary rights To get in formation about a backup, the user or the group must have: - for each database affected by the backup, the rights to perform backups (hRightsBackup constant) or the rights to connect (hRightsConnection or hRightsEncryptedConnection constant).
- for a full server backup, the rights to perform backups (hRightsBackup constant) on the server.
Related Examples:
|
Training (WINDEV): WD Duplication
[ + ] This educational example explains how to duplicate a database on a server. The duplication is performed by programming and it allows you to give a new name to the database. The example is based on the functions for saving and restoring a HFSQL backup.
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|