Imported Upstream version 2.4.4p3
[debian/amanda] / contrib / dbbackup.README
1
2                                 dbbackup
3
4
5 dbbackup is a set of scripts to automate Oracle hot backups using tcl
6 via oratcl.  It is currently used on 24x7 systems on several platforms,
7 including Solaris2.5/2.6 and AIX.  It has been tested and used with both
8 Oracle 7 and Oracle 8.
9
10 I recommend the most stable release of Tcl (currently 8.0p2) and
11 Oratcl 2.5
12
13 In our oracle implementation, we have a single disk '/opt/oracle/backup'
14 who's sole purpose is to hold the database backups.  We point our archive
15 log destination there, so all archived redo logs are in one spot and
16 we run a hot backup nightly to copy all the datafiles and the control
17 file there as well.  Necessarily, the /opt/oracle/backup disk must be
18 big enough to hold all of this.
19
20 We use the Amanda backup system (www.amanda.org) to handle backing up
21 the disk to tape.
22
23
24 Simply put, the ksh script sets up environment for the tcl script, which
25 does the following:
26         - for each tablespace in the database
27                 - identify all datafiles belonging to that tablespace 
28                 - set the tablespace to backup mode
29                 - copy the datafiles to the backup location
30                 - set the tablespace to regular mode
31         - switch the log file so any changes made during backup get archived
32         - back up the control file
33
34 There are no fancy installation scripts as of yet.  Here is a short
35 summary of what is needed.
36
37 1.  Root user creates a system backup account.
38 2.  Oracle DBA runs dbbackup.sql as oracle user "sys" to:
39                 - create a role "backup_role"
40                 - grant minimal system privileges to backup_role (i.e.
41                   manage tablespace)
42                         *NOTE* these are powerful privileges. but necessary
43                 - grant minimal necessary table privileges to backup_role
44                   (i.e. dba_tablespace)
45                 - create the backup user from step 1
46                 - grant backup_role to the backup user
47 3.  configure   - change dbbackup.ksh to find the oracle script "dbhome",
48                   set ORACLE_SID and optionally set the dbbackup
49                   administration area (location of logs and dbbackup.ksh)
50                   and user who will get the E-mail reports.
51                 - change dbbackup.tcl to find the backup destination
52                   (variables df_dest and cf_dest)
53 4.  Root user needs to install dbbackup.ksh.  The dbbackup.tcl script must
54     be installed in $adm/dbbackup.tcl (adm is defined in dbbackup.ksh).
55 5.  Root user needs to add a cron job to trim old archive logs (6 days worth).
56                 'dbbackup.cron' is a sample cron entry
57                 *NOTE* failure to add crontab fills the disk real fast.
58                 *NOTE* our archive logs are [sid]####.dbf  
59 6. Root user needs to configure the backup system to call 'dbbackup.ksh'
60    as the backup user.
61
62
63 Todd M. Helfter
64 Purdue University Computing Center
65 tmh@purdue.edu