AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Administrar bases de datos / HFSQL / Funciones HFSQL Client/Server
  • Rights required to perform a backup
  • Characteristics of the backup
  • Backup performed from the HFSQL Control Center
  • Scheduled backups
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Backs up the contents of an HFSQL server: all server databases, one or more databases, one or more data files.. This backup can be performed while one or more databases are being used.
The backup performed will correspond to the state of the database at the start of the backup: the backed-up database is consistent. Certain operations are prohibited during the backup: deleting data files and databases, updating stored procedures.
The backup can be described using a variable of type hBackupDescription. In this case, you have the ability to define:
  • a stored procedure to run BEFORE the backup. This procedure can cancel the backup if necessary.
  • a stored procedure to run AFTER the backup.
To restore this backup, use <Connection variable>.RestoreBackup.
To delete this backup physically, use <Connection variable>.DeleteBackup.
Ejemplo
MyConnection is Connection

Backup_Doc is hBackupDescription
Backup_Doc.Description = "Doc Backup"
Backup_Doc.WithIndex = True
Backup_Doc.Destination = "Doc/Backup"
Backup_Doc.Source = "Doc/*"
Backup_Doc.ProcedureBefore = "mydatabase:DocCol.Check" 
Backup_Doc.ProcedureAfter = "mydatabase:DocCol.CheckBackup"
MyConnection.Backup(Backup_Doc)
gctConnection is Connection

// Back up the wdaccounts database in the "Backup" directory
IF gcnxConnexion.Backup("wdaccounts/*", "wdaccounts/Backup", True, "Backup " + DateSys()) = 0 THEN
Error(HErrorInfo(hErrFullDetails))
END
Sintaxis

Sintaxis que utiliza el tipo hBackupDescription (con llamada a procedimientos almacenados) Ocultar los detalles

<Result> = <Connection>.Backup(<Definition of the backup>)
<Result>: Entero
  • Identifier of backup,
  • 0 if an error occurs. HErrorInfo is used to identify the error.
The <Variable Connection>.Backup function is not blocking: it launches the backup and gives control back to the application.
Note If a stored procedure is executed before saving and returns False then the save is cancelled.
<Connection>: Variable de tipo Connection
Name of the Connection variable describing the server connection that will be backed up.
<Definition of the backup>: Variable de tipo hBackupDescription
Name of the hBackupDescription variable that contains the description of the backup to perform. This type of variable can also be used to define a stored procedure to be executed before saving and a stored procedure to be executed after saving.

Sintaxis conservada por motivos de compatibilidad con la versión 12 Ocultar los detalles

<Result> = <Connection>.Backup(<Data to back up> , <Backup destination> [, <Backup of indexes> [, <Description> [, <Progress Bar>]]])
<Result>: Entero
  • Identifier of backup,
  • 0 if an error occurs. HErrorInfo is used to identify the error.
The <Variable Connection>.Backup function is not blocking: it launches the backup and gives control back to the application.
<Connection>: Variable de tipo Connection
Name of the Connection variable describing the server connection that will be backed up.
<Data to back up>: Cadena de caracteres
Filter used to describe the information to back up. The possible values are as follows:
*Backs up all server databases, logs and system databases (users, groups, rights).
Database name/*Backup the entire database: data files, bindings, stored procedures, triggers.
Database name/Name file 1Backs up the <Name file 1> data file of the <Database name> database.
Name database 1/Name file 1 + TAB + Name database 2/Name file 2 + ...List of elements to back up. The separator can be the tabulation (TAB) or the semicolon (";").
SystemBacks up the system databases (users, groups, rights).
<Backup destination>: Cadena de caracteres
Name and destination of the backup. The backup will be preformed on the server, in a location defined by this name. If this name corresponds to a relative path, the backup will be placed in the "Backup" subdirectory of the HFSQL server. To specify:
  • the directory of the Manta service, use the "%%EXE%%" character string.
  • the year, use the "%%YEAR%%" character string (2008 for example).
  • the month on 2 digits, use the "%%MONTH%%" character string (03 for example).
  • the day, use the "%%DAY%%" character string.
  • the hour, use the "%%HOUR%%" character string.
  • the minutes, use the "%%MINUTE%%" character string.
<Backup of indexes>: Booleano opcional
  • True (default) to back up the indexes,
  • False not to back them up. Not saving the indexes reduces the size of the backups. However, rebuilding the indexes will increase the restore time.
<Description>: Cadena de caracteres opcional
Description of the backup.
<Progress Bar>: Nombre de control opcional
Name of the Progress Bar control in the window. This control is used to view the progress of the initialization step of the backup (and not the progress of the backup). This option is available in WINDEV only.
Observaciones

Rights required to perform a backup

To perform a backup, the user or the group must have the rights to perform backups (hRightsBackup constant). These rights apply to the servers and to the databases.
To find out whether a user or a group has sufficient rights, use <Connection variable>.InfoServerRights or <Connection variable>.InfoDatabaseRights.
To modify the rights granted to a user or group of users, use <Connection variable>.ModifyServerRights or <Connection variable>.ModifyDatabaseRights.
Novedad versión 2025
Warning If the backup concerns anonymized fields, it is possible to manage the backup mode for these fields. In this case, additional rights may be required. For more details, see the hBackupDescription variable type help.

Characteristics of the backup

The backup performed will correspond to the status of the database at the beginning of backup.
During the backup, you are not allowed to:
  • delete the data files and the databases,
  • update the stored procedures.

Backup performed from the HFSQL Control Center

A backup can be performed from the HFSQL Control Center. This backup is available in the "Backups" tab of the server description ("New backup" button).

Scheduled backups

You have the ability to schedule the backups performed on the server:
  • via the scheduled tasks managed by WLanguage (<Connection variable>.AddTask).
  • via the HFSQL Control Center ("Scheduled Tasks" tab of the server description).
Componente: wd300hf.dll
Versión mínima requerida
  • Versión 25
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 17/06/2024

Señalar un error o enviar una sugerencia | Ayuda local