FairCom Corporation
 
FairCom Start PageFairCom ProductsDownloadsDeveloper SupportSales InformationFairCom CustomersFairCom Company InformationContact FairCom

Home bulletgrey.gif eNewsletter bulletgrey.gif Volume 26 bulletgrey.gif c-tree Server Dynamic Backup Protection


Must-Have Protection With c-tree Server Dynamic Backups

Data backups are critical to ensure data integrity as part of disaster recovery and business continuity planning. The c-tree Server makes it easy to accomplish this! Simple setup scripts, easy to archive backup files, and online backups provide a level of advanced protection and peace of mind. Rest easy knowing your data is secured.

The dynamic dump backup feature is also included with the c-treeSQL Server! As all database files created with the c-treeSQL Server are created under transaction processing control the dynamic dump backup is a perfect solution to secure your c-treeSQL database files while they remain online.

This backup feature is available in the c-tree Server and c-treeSQL Server however, not in our standalone models. Contact FairCom today to find out all the ways c-tree Server technology can benefit your data handling needs!

The c-tree Server Dynamic Dump Feature

The c-tree Server dynamic dump feature provides a safe, secure method of backing up data while the Server is operational. An administrator can schedule a dump of specific files, which may be all files necessary for recovery or a subset of them. The dump runs while the Server is carrying on normal activity and processing transactions and is transparent to users.

The Server performs the dump at the first opportunity on or after the scheduled time. When beginning a scheduled dump, the c-tree Server temporarily stops new transactions from beginning and starts the actual dump as soon as all active transactions are complete (or after aborting transactions that do not complete during a pre-set delay period). After the dump begins, there are no restrictions on transactions.

Note: The dynamic dump and recovery processes are intended primarily for files under transaction processing control. Non-transaction controlled files can be dumped with certain restrictions. Review the chapter "Maintaining Database Integrity" in the c-tree Server Administrator's Guide for complete details.

Scripting 1-2-3

The c-tree Server dynamic dump feature relies on a simple plain text file script. This script directs the time, location, and frequency that the backup should occur. Set it once, and the server can continue to make unattended data backups as long as it remains operational.

Here is a simple sample script:

!TIME   23:00:00
!DAY    Sun
!DUMP   SYSTEM.BAK
!DELAY  600
!FREQ   168
!FILES  
*.dat
*.idx
FAIRCOM.FCS
!END

This script schedules a weekly dump, at 11:00 PM on Sunday nights. This backs up all data and index files in the server working directory and includes the FAIRCOM.FCS user and group security information file. The system will wait until 11:10 PM (that is, 600 seconds delay, after the starting time of 11:00 PM) for all active transactions to complete. Then it will abort any transactions still active and begin the actual backup. Remember, the server continues normal operation once the backup process begins. The dump data will be saved in the file named SYSTEM.BAK.

By default, the c-tree Server segments the backup file into one gigabyte (GB) segments to ensure proper operation on all platforms. This can be modified with the !EXT_SIZE keyword. Many other options are available to manage your backup files. Complete details are found in the chapter "Maintaining Database Integrity" in the c-tree Server Administrator's Guide.

How to Submit the Dynamic Dump Script

There are two ways to submit a script to the server for processing.

  • The easiest way to submit a backup dump script to the c-tree Server is in the configuration file, ctsrvr.cfg. Use the following configuration keyword to specify the script file on server startup:
DUMP mybackup.scr

Note: If the DUMP keyword is used, the file containing the dynamic dump script must be in the same directory as the c-tree Server. The c-tree Server will look for this file only in its own directory and, if it does not find it, the c-tree Server will terminate immediately with error FNOP_ERR (12, file not found).

  • You can submit a backup dump script to the c-tree Server at any time using ctdump, the Dynamic Dump utility.
ctdump [adminuser adminpass] dumpscript [servername]

where

  • adminuser: ADMIN group User ID
  • adminpass: Administrator password
  • dumpscript: Name of the Dynamic Dump script file. A path relative to the server's working directory may be included.
  • servername: Optional Server name.

    The following demonstrates example usage of this utility:

ctdump ADMIN ADMIN mybackup.scr FAIRCOMS

Advantages of Transaction Processing Controlled Files

The safest way to perform a complete backup of data and index files while the c-tree Server remains running is to ensure that all your files are under transaction control. This way all data and index files remain completely synchronized, and updates to the files can continue during a dynamic dump. Some developers choose not to implement transaction control for one reason or another. For instance, developers migrating from the c-tree Plus Standalone Multi-user model, FPUTFGET, to the c-tree Server may choose to use the c-tree Server in an FPUTFGET-like manner. It is possible to back up data files that are not under transaction control while the c-tree Server remains running.

Although it is possible to define a non-transaction controlled file within a dynamic dump backup script, there is no protection against updates to this file. In other words, it is possible for the file to be updated during the dynamic dump. Updating a file controlled by transaction processing is okay, because the dump restore process can use the transaction logs to restore to a consistent state. However, if files NOT under transaction control are updated while they are being backed up, they cannot be backed up in a consistent state.

The keyword !PROTECT, without an argument, when added to a dynamic dump script file causes the non-transaction files to be dumped cleanly by suspending any updates while each file is dumped. At this point, the associated index files for a data file are not guaranteed to be consistent with the data file because the files are not dumped at the same time. Updates are only suspended while the data file is being backed up and normal operation is automatically resumed once the file has been backed up.

This technique ensures the data file is backed up in a consistent state. The restore process for a non-transaction control file MUST include a subsequent index rebuild. Because protection is for data files only, under most situations, non-transaction-controlled indices are not worth backing up since they rebuilt in the event of a restore.

Stopping a Dynamic Dump in Process

The dynamic dump runs as an internal client thread within the c-tree Server process. To stop a dynamic dump in process, simply execute the c-tree Server Administration utility, ctadmn, and list active clients. The dynamic dump will appear with the COMM PROTOCOL displayed as DYNAMIC DUMP. Note the client number and use the "kill clients" option to terminate the process. This allows a backup procedure to be canceled after it has been submitted to the c-tree Server.

Restoring From a Dynamic Dump

Should the c-tree Server fail for some reason (for example, a power failure), the server will restore all files under transaction control to a consistent state through automatic recovery when it is restarted.

In the event of a catastrophic system failure (for example, a hard drive failure) that renders the transaction logs or the actual data files unreadable, it will be necessary to use a dynamic dump file to restore data to a consistent, well defined state. This is known as a dynamic dump recovery. Should you need to restore files from a c-tree Server backup, you use the Dynamic Dump Recovery utility, ctrdmp.

The ctrdmp utility provides dynamic dump recovery. This utility is itself a c-treeACE Server (a bound server) so there are a few important points to observe before running it:

  1. Be sure the particular c-treeACE Server undergoing a recovery is not running when ctrdmp starts, since two c-treeACE Servers operating simultaneously interfere with each other.
  2. Because it is a c-treeACE Server, ctrdmp generates temporary versions of all system files associated with a c-treeACE Server (i.e., files with the extension ".FCS," as described above). Therefore, the dynamic dump file and the ctrdmp utility should be moved to a directory other than the working directory where the c-treeACE Server undergoing recovery resides. This is so the system files created by the recovery program will not overwrite working c-treeACE Server files. The temporary files are automatically deleted when recovery completes successfully unless !FORWARD_ROLL is in the recovery script. In that case, the S*.FCS files are renamed to S*.FCA and kept in the directory.

After taking these preliminary steps, do the following to recover a dynamic dump:

  1. Start ctrdmp the same way as any normal program in the environment.
  2. When prompted, enter the name of the dynamic dump script file to be used for the recovery.

    Note: The same script file used to perform the dump can be used to restore the dump. If a forward dump is planned, include the !FORWARD_ROLL keyword.

The dump recovery begins automatically and produces a series of messages reporting the progress of the recovery:

  • Each recovered, i.e., recreated, file will be listed as it is completed.
  • After all specified files have been recovered, a message is output indicating the recovery log, i.e., the transaction log, is being checked and recovered files were restored back to their state as of a given time, that is, the time the dynamic dump started.
  • A message indicating the dump recovery process finished successfully.

Gotchas!

A common mistake some users make is to copy, or otherwise externally back up data or index files while the c-tree Server is running. Anytime a data or index file is open by the c-tree Server, there is potential for updated data to remain in the c-tree Server's in-memory cache. Therefore, there is no guarantee that you have a consistent state of your data on disk. Additionally, the c-tree Server marks these opened data and/or index files as having been updated and not written to disk in the file header. When these files are restored, this flag is detected by the c-tree Server on file open and error FCRP_ERR (14, file corrupt) is typically returned.

Be safe! You should always either bring down the c-tree Server in a normal controlled manner before attempting such a copy, or use the c-tree Server dynamic dump backup feature and allow the dump to finish before you move or copy the backup dump file to ensure consistent data is retained.

Advanced Options

Many other advanced options are available with the c-tree Server Dynamic Dump backup feature. These include system rollbacks and system roll forwards. You can also dump transaction logs for extremely advanced administrators. Again, refer to the chapter "Maintaining Database Integrity" in the c-tree Server Administrator's Guide for details regarding all of these utilities and options.

For over fifteen years National Public Radio has controlled and managed its entire satellite network radio broadcasts with an application built by Chesapeake Computer Group with FairCom's database technology. This system controls audio routing switchers, makes contact closures for tape recording machine starts and On-Air and Warning lights, controls transmitter parameters, digital audio storage systems and other devices required to operate its broadcasting network.

FairCom's technology provides the performance and stability required to capture and process the data used to operate and control an international satellite communications system. An application such as this requires absolute assurance that its database will provide the accuracy, data integrity, stability and performance required by the most demanding mission-critical embedded technology. In addition, FairCom's portability and scalability has allowed the NPR broadcast network to expand and move into the full international position it occupies today, providing radio network programming to every US military facility and many other international organizations world wide.

(481KB PDF)

FairCom Start PageSite MapContact FairComThe FairCom Privacy Policy
Copyright 2009 FairCom Corporation. All rights reserved.