hot backups question for DBA's
Date: 6 Mar 2001 23:04:04 -0600
Message-ID: <3aa5c095$0$63729$45beb828_at_newscene.com>
Greetings.
This is my first post to this newsgroup. Please excuse the length. My question is somewhat involved and takes some time to explain.
I am currently acting as the database administrator for a small company. I've been developing applications in Oracle for several years, but this is my first job as a DBA. I've been asked to develop a hot backup script but it fails every test, so I'd like to get some input from the DBA gurus out there.
The script appears below this message. It assumes that the database is already in archive log mode. Basically, all it does is put each tablespace into backup mode and copy the datafiles to another disk (yes, they want the backups to go to a spare disk) along with the archived redo logs, the control file and the initialization parameter file.
I'm using the Oracle 8i DBA handbook as a guide for this task, but the
database is Oracle 8 (I don't think that makes a difference). The book
provides a script for performing these backups and my script is mostly
a copy of that one.
One thing I find interesting is that the book makes no mention of the
need to backup the online redo logs, just the archived ones. Why are
the redo logs not necessary? Since they are the ones to which Oracle
is writing and the archived logs are only created when an old redo log
is about to be overwritten, it would seem logical that the current redo
logs are far more important for recent recoveries than the archived logs.
Right? Wrong? Do I need to backup the current online redo logs as
Anyway, here's the script. Any help from anyone who has done this or
knows how to do it would be greatly appreciated. Thanks.
$ORACLE_HOME/bin/svrmgrl <<E1
alter tablespace system begin backup;
alter tablespace temp begin backup;
alter tablespace tools begin backup;
alter tablespace rbs begin backup;
alter tablespace spdata begin backup;
alter tablespace spindex begin backup;
# backup the control file
'/u01/exports/sp/SPcontrolfile.bck';
# Stop archive logging for the next step
archive log stop
connect internal as sysdba
!cp /u01/oradata/sp/system01.dbf /backup
alter tablespace system end backup;
!cp /u01/oradata/sp/temp01.dbf /backup
alter tablespace temp end backup;
!cp /u01/oradata/sp/tools01.dbf /backup
alter tablespace tools end backup;
!cp /u02/oradata/sp/rbs.dbf /backup
alter tablespace rbs end backup;
!cp /u03/oradata/sp/spdata.dbf /backup
alter tablespace spdata end backup;
!cp /u04/oradata/sp/spindex.dbf /backup
alter tablespace spindex end backup;
alter database backup controlfile to
!cp /u01/exports/sp/SPcontrolfile.bck /backup
E1
# backup the archived redo log files
cp /u01/archive/sp/* /backup
# restart archive logging
$ORACLE_HOME/bin/svrmgrl <<E2
connect internal as sysdba
archive log start;
exit
E2
# backup the initsp.ora file
cp $ORACLE_HOME/dbs/initsp.ora /backup
Received on Wed Mar 07 2001 - 06:04:04 CET