Managing Backups database in 4D  Hot PDF Print E-mail
Tag it:
Delicious
Furl it!
Digg
NewsVine
Reddit
YahooMyWeb
Technorati
Articles Reviews 4D Database
Written by Phil Harrison   
Saturday, 13 January 2007
Article Index
Managing Backups database in 4D  Hot
Configuration of Backup Files
Backup Settings
Scheduled Backup Settings
Automatic Backup

Backing up the database consists of generating a copy of the databaseand all its necessary files at a given moment. This copy is placed in one or more backup file(s).

Any backup file can later be opened using 4th Dimension in case of any incidents that damage the current database; the database will then be restored to its previous state (at the time it was copied).



Performing a Backup

Each backup is performed while taking into account the parameters set in the application Preferences.

The Preferences can be used to define every aspect of the backup:

 Files to include in the backup (data / log, structure, user structure and attached files),
 Location of backup files (main backup file and log backup file).
 Management of log file,
 Backup scheduling,
 Backup options: number and rotation of backup sets; handling of active transactions or index operations; handling of failures; segmentation, compression and integrity of backup files,
 Setting automatic restore options.

These parameters are set at default values corresponding to standard use; changing these values is optional. 

Starting a Backup

In 4th Dimension, a backup can be started in three ways:

 Manually, using the Backup... command in the 4th Dimension (User environment) and 4D Server File menu.
 Automatically, using the scheduler that can be set in the application Preferences.
 Programmatically, using the BACKUP command.

The choice will depend on your use of the database and your backup strategy.

4D Server: A backup can be started manually from 4D Client using a method that calls the BACKUP command. The command will be executed, in all cases, on the server.

 

Executing a Backup 

Once the backup is started, 4th Dimension displays a dialog box indicating the progress of the backup.
 

Accessing the DatabaseDuring Backup

During a backup, access to the database is restricted by 4D according to the context.

4D locks any processes related to the types of files included in the backup: if only the structure file is being backed up, access to the structure is not possible but access to the data will be allowed.

Conversely, if only the data file is being backed up, access to the structure is still allowed. In this case, the database access possibilitiesare as follows:

 With the 4th Dimension single-user version, the database is locked for both read and write; all processes are frozen. No actions can be performed.

 With 4D Server, the database is only write locked; client machines can view data. If a client machine sends an add, remove or change request to the server, a window appears asking the user to wait until the end of the backup.

Once the database is saved, the window disappears and the action is performed. To cancel the request in process and not wait for the end of the backup, simply click the Cancel operation button.

However, if the action waiting to be executed comes from a method launched prior to the backup, you should not cancel it because only operations remaining to be performed are cancelled. Also, a partially executed method can cause logical inconsistencies in the database.

Note: When the action waiting to be executed comes from a method and the user clicks the Cancel operation button, 4D Server returns error -9976 (This command cannot be executed because the database backup is in progress).

Encountering ProblemsDuring a Backup

It may happen that a backup is not executed properly. There may be several causes of a failed backup: user interruption, attached file not found, destination disk problems, incomplete transaction, etc.
4th Dimension processes the incident according to the cause.

 User interruption: The Stop button in the progress dialog box allows users to interrupt the backup at any time. In this case, the copying of elements is stopped and an error is generated. You can intercept this error in the On Backup Shutdown database method.

 Attached file not found: When an attached file cannot be found,
4th Dimension performs a partial backup (backup of database files and
accessible attached files) and returns an error.

 Backup impossible (disk is full or write-protected, missing disk, disk failure, incomplete transaction, database not launched at time of scheduled automatic backup, etc.)



Last Updated ( Thursday, 03 January 2008 )
 
< Prev   Next >