Backup and Restore |
![]() ![]() ![]() |
QM does not provide any special backup and restore utilities but relies instead on use of standard operating system level backup tools. This section sets out some points to consider in planning a backup strategy. Hopefully, you have already thought of these...
Backup Tools
Although it would be possible to use the ACCOUNT.SAVE command to create a backup of a QM account, it is recommended that operating system level tools are used for this purpose. The account transfer tools and T.xxx commands do, however, have the advantage that they can be used to merge data with existing files.
Because individual records in hashed files cannot be accessed from outside of QM, operating system level backup tools can only save and restore an entire file. The T.DUMP command can take a select list specifying the records to be saved.
Live Backup
Sometimes there is no alternative to backing up a system while users are logged in. As mentioned above, simply copying the database files while they are being updated will almost certainly lead to inconsistent data, perhaps with structural problems that make restore impossible.
QM provides the ability to suspend database updates by use of qm -suspend from the operating system command prompt. When this mode is in effect, applications will pause at any attempt to modify a file until updates are enabled using qm -resume.
Rather than pausing the database for the duration of a full backup, various mechanisms are available to minimise the time for which updates are suspended. If using mirrored disks, it would be possible to suspend updates, break the mirror, resume updates, backup the offline half of the mirrored data and then reconnect the mirror to catch up with changes during the backup.
Some environments provide snapshot backup systems where updates can be suspended, the snapshot initiated and updates resumed. The actual backup process performed by the snapshot will handle the complexities of database updates that occur during the backup.
Regardless of the technique used, beware that suspending updates will ensure structural integrity of the saved files but will not ensure business level data integrity as the suspension may occur part way through a series of related updates. Use of transaction programming techniques will help as the suspension will occur on committal of the transaction but it is still possible that a business level transaction is formed from multiple database transactions. |