Oracle Database Backup
Curtis Preston
See Sidebar 1
See Sidebar 2
Trying to back up today's databases is like trying to
catch a charging
rhino with a butterfly net. Real world databases have
become screaming
behemoths that are very difficult to capture (back up),
and standard
UNIX utilities are like butterfly nets. If you try to
use these
utilities for the job, not only will you not capture
the data -- you'll
break your arm! This article is my attempt to build
a better rhino trap.
It uses many advanced shell scripting features, so you
may find it
useful even if you do not have Oracle.
Hot or Cold Backups?
One of the first decisions a database administrator
must make is whether
to perform "cold" or "hot" backups.
A cold backup involves:
1. Shutting down the instance
2. Backing up its filesystems or raw devices
3. Starting up the instance
Here are the steps to perform a hot backup. (Note that
a hot backup
requires much more knowledge of Oracle's internal structure,
so a basic
definition of helpful terms is given in the sidebar
"Definitions.")
First, you must determine the name of each tablespace
in the instance
and the files that are within it. Then, for each tablespace,
you:
1. Put that tablespace in backup mode;
2. Backup that tablespace's files or raw partitions (using cp, tar, dd, etc.);
3. Take that tablespace out of backup mode.
Once all tablespaces are done:
1. Switch redolog files; and
2. Backup the control file.
It is much easier to perform cold backups, so why do
hot backups at all?
Simply stated, they increase your backup window, or
the time in which
you are allowed to perform backups. Because cold backups
require a
shutdown of the database, your users will probably allow
only a very
small backup window.
|