Tell if Continuous Backup of Logfiles is Running

For many applications, it is wise to have the added security of continuous backup of logfiles to tape. If you're running a database with logging, it is very important to stay on top of freeing up logfiles. The best way to do this is to have tbtape -s running as much as possible. Even if you are using mirrored devices to hold your chunks, you need to think in terms of avoiding a single point of exposure to failure. This means running archives to tape regularly and it means backing up your logfiles to tape regularly. It also means physically separating the tapes from the computer. All of the redundancy and fault tolerance in the world won't save you if your computer room catches fire and everything in it burns.

If you have two tape devices available, it is possible to have continuous backup of logfiles running at all times. Note that I said possible, not recommended. Even with large tape backup devices, it is risky to backup your logfiles until the device fills. If you have a catastrophic tape error, it is possible that you could destroy hundreds of logs if you have a very large tape drive and had been running the logfile backup for a while. Why take the chance? Tape is cheap.

If you have only one tape drive available, you're forced to be conservative. You have to shut down continuous backup of logfiles to run your database archives. When you complete your archives, you have to put a log tape in the tape drive and restart the logging. This more or less forces you to swap log tapes at least once a day as a part of the archive/log cycle. Even if you have two tape drives, this is a good habit to get into. Plan on swapping out your log tapes at least daily, maybe more often if you have a very busy database. This also cuts down your exposure to massive data loss due to a bad tape. Once logfile data has been backed up to tape, it's lost to you. You can't undo it without restoring the database and re-applying logfiles. If you have backed up some logfiles to tape and find that the backup is questionable, do an archive immediately. It's the only way that you can ensure recovery.

If you are starting and stopping logfile backup or alternating archiving and logfile backup, you have the danger of human error. Someone may forget to start the logfile backup. Another point of exposure is errors on your tape device. If your tape device goes offline while continuous backup of logfiles is running, you will not always get notification in your online logfile. Here's where a script comes in handy to check to see if logging is still on. This script is called logging.

INFORMIX 94> cat logging

#/bin/csh
ps -efa | grep "tbtape -c" | grep -v grep > /dev/null
if ($status == 0) then
set CONTINUOUS = "ON"
else
set CONTINUOUS = "OFF"
endif
echo $CONTINUOUS

The logging script is run with no parameters and returns either ON or OFF. You'll see it in the status dashboard script later. Closely kin to this is the archiving script that tells you whether or not an archive is running.

INFORMIX 95> cat archiving
#!/bin/csh
ps -efa | grep "tbtape -s" | grep -v grep > /dev/null
if ($status == 0) then
set ARCHIVING == "ON"
else
set ARCHIVING == "OFF"
endif
echo $ARCHIVING

You'll find this script called in the status program also, in conjunction with the peek_arc script.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.42.168