Mastering backups and recovery is perhaps one of the most important areas of database administration. However, the maintenance of restorable copies can, in many cases, be very difficult ” especially on systems that have to do a lot of INSERT and UPDATE operations. In general, you can make four mistakes when working with a database server:
Full Backup Versus Incremental BackupMany companies rely on redundant storage systems; they are a good choice for protecting your data, but they are not enough. Backup does not mean buying a lot of additional and expensive hardware. Real backup starts in the brain of every person involved in the process of data processing and backup. Everybody has to take care of data security and documentation to guarantee a fully working IT environment. Most backup systems available on the net support two types of backups:
Starting Backups Using cronOn Unix systems, backups are usually started by cron, a daemon used to execute scheduled commands. cron is flexible and easy-to-configure software. Also called "Vixie Cron" because the most important implementation of the cron daemon is provided by Paul Vixie, this implementation is currently used by all major Linux distributors . If you want to add a job to your cron, you can do this by typing crontab -e in your favorite Unix shell. cron starts the default editor of your system, which in many cases, is ed. ed is a line-oriented text editor some of you might know from ancient Unix times. On some systems, the default editor is vi, and one of the most powerful and widespread editors on Unix systems. If you don't want to use ed or vi to configure cron, you set the environment variables $EDITOR or $VISUAL to your favorite editors. This can be done with the following command (for Bourne Shell users): export EDITOR=vim export VISUAL=vim vim is a text editor that is upward-compatible to vi. On Linux systems, vi is usually an alias for vim. vim has some nice advantages over vi, such as syntax highlighting. You can use cron to define all times when you want to start a backup. Check out your man pages for a complete reference on cron and crontab . Here is an example of an entry in crontab: 0 3 * * * /full_path_to_script/myscript.pl myscript.pl is started at 3 o'clock every day. Every entry in crontab consists of six fields. The first five fields are used to define the times the program in field six has to be started by cron. The first field defines the minute to start the programm, field two defines the hour , field three is responsible for the day of the month, field four defines the month, and field five can be used to restrict the day of the week the process has to be started. A field might contain an ordinary value or an asterisk ( * ), which indicates that the process is always started. You can see in the example that the script is started every day at three o'clock ”this means every day of the month, every month, and every day of the week, but only at three o'clock and zero minutes. Backup HardwareA lot of backup hardware is available. Whether you need to back up a few files or an entire mainframe, the hardware industry provides nearly everything you can imagine to back up your data. The dinosaurs in the backup business are tapes. Some of you might already have dealt with DDSx tapes or IBM tapes, such as 3480 or 3490. Most people feel a insecure when working with streamers, because tapes have to be accessed differently than CDs, for instance. Unix systems offer a powerful set of commands to handle tapes, but for many users, it's difficult to get used to these tools. Some companies offer jukeboxes, which are cartridges that contain multiple tapes (for example, 6 tapes). You don't have to change tapes every day, and can use cron to make this happen automatically. If you have to use multiple tapes to back up your data, you can also use robots. Some very powerful solutions are currently available to manage dozens of backup tapes automatically. Robots are commonly used mainframe environments to avoid changing tapes manually. Backup servers are, in many cases, the most comfortable way to back up data. Backup servers are sometimes also cheaper than expensive streamer hardware. A backup server is nothing else than a machine used to receive copied data. Recovery from a backup server is usually easy because you merely copy the data over the network back to the machine that has crashed ”this can usually be done quickly. |