Current Issue


Table of contents

CD-ROM

Sys Admin and The Perl Journal CD-ROM version 12.0

Version 12.0 delivers every issue of Sys Admin from 1992 through 2006 and every
issue of The Perl Journal from 1996-2002 in one convenient CD-ROM!

Order now!

Sys Admin Magazine > Archives > 2001 > May 2001

Oracle Backup for UNIX Administrators

Bill Mansfield

Database backup and recovery requires both database administration and systems administration skills. Sometimes backups are neglected, are not done in a way that allows recovery, take too long, or become too disruptive. This article is intended to provide systems administrators with enough background to find out whether they're getting good backups for their databases, and if not, provide a starting point for getting them in the future.

The Korn shell scripts discussed here are typically executed as the Oracle user. They need to have the authority to read the various tables, and must have access to read the database files. The database should be up when you start. Oracle version 8.x is assumed. You'll need to add the usual code to set ORACLE_HOME and ORACLE_SID, do logging, check return codes, maintain multiple versions, protect passwords, etc.

Cold (Offline) Backups

In many ways, a cold backup is the simplest solution. Bring the database down, copy the database and control files, and bring the database back up. Then use your regular backup software to send the files to tape for safekeeping. You don't even need archive log files. But, first the script must ask the database what the necessary files are:

BACKUPDIR=<backup destination>   # directory where the saved files go

# get the files to back up, and shut down the database
svrmgrl <<! > /dev/null
connect internal
set termout off
spool /tmp/ctlfiles;
select name from v\$controlfile;
spool off;
spool /tmp/dbfiles;
select name from v\$datafile;
spool off;
shutdown immediate
exit;
!

# Copy the data files. 

				  



MarketPlace

Build IT Knowledge with Current & Trusted Content
Helps Employees Develop & Hone New Technical Programming Skills. Sign Up & Get Full Access.

Six Sigma Certification
100% Online-Six Sigma Certificate from Villanova - Find Out More Now.

Learn Embedded Linux, $349
Hands-on kit teaches fundamentals of embedded Linux development on real target hardware. ARM9 SBC.

Workflow Enabled Help Desk & IT Service Management
Automate service desk activities and integrate processes across IT. Learn more here.

Wanna see your ad here?