dbbackup user guide

1. Overview
     dbbackup is a utility program to perform online backups for
     Oracle databases.  There are three files included in the package:
       - dbbackup.pl
       - dbbackup.sh
       - dbbackup_default.cfg

2. Program file details
     dbbackup.sh:  dbbackup's main script.  Takes two arguments that are
                   required:  oracle_sid & config file.  The Oracle sid is
                   used to identify the db to backup.  The config file contains
                   backup and arch information about the database, such as 
                   where to backup the db files and ora config files.

     dbbackup.pl:  dbbackup.sh passes the following args to dbbackup.pl: sid &
                   config file.  This file parses the config file contents
                   and determines which tablespace(s)/datafile(s) to exclude,
                   what to name the backup controlfile, where to find the 
                   tns_admin files (tnsnames.ora, sqlnet.ora, listener.ora) and
                   init.ora, the location to store backup files, and the 
                   retention period for archive logs.

     dbbackup.cfg: Config file read by dbbackup.sh and dbbackup.pl.  Copy the
                   config file and change the file name to dbbackup_<sid>.cfg.
                   See below for valid parameters and values.  Double quotes 
                   are optional.

                   USER = system_user
                     system_user (all files in dbbackup should only be
                     accessed by user oracle or a member of ORA_DBA/dba).

		  BASE_BU_DIR = /base/backup/dir/path ex: /nas/nas0/oracle_backup/hidprd/hot
		     Hot backup directory location.  Should have a daily 
		     directory under it.

		   BASE_COLD_BU_DIR = /base/cold/backup/dir/path ex: /nas/nas0/oracle_backup/hidprd/cold
		     Cold backup directory location.  Should have a weekly, 
		     and a monthly directory under it.

                   BACKUP_DIR = /dir/path
                     Location to store the hot backup controlfiles (including 
                     create controlfile script), datafiles, tns_admin files,
                     init.ora, and the restore script for recovering the 
                     backup.

		   BACKUP_COLD_DIR = /cold/backup/dir/path  ex: /nas/nas0/oracle_backup/hidprd/cold/temp
		     Location to store the cold backup controlfiles (including 
                     create controlfile script), datafiles, tns_admin files,
                     init.ora, and the restore script for recovering the 
                     backup.  Should have an arch directory under it.

                   ARCH_BU_DIR = /dir/path
                     Location to store the backup archive logs.  This 
                     directory will have the all the same files as the 
                     database's arch dir plus one day older of retention
                     period.  For example:  If ARCH_RETENTION_DAYS = 2, then
                     dbbackup will purge archive logs older than two days 
                     in the database arch dir at the time of backup.  The 
                     archive backup dir will contain archive logs upto 
                     3 days at the time of backup.

                   ARCH_RETENTION_DAYS = int
                     See ARCH_BU_DIR

                   PROG_DIR = /dir/path
                     Path location to dbbackup.pl.  No quotes allowed.

                   EXCL_TS = list_of_tablespaces 
                     List of tablespaces to exclude from database.  These
                     are typically read-only tablespaces since they only
                     need to be backed up once.  The paratheses are optional,
                     but commas are required.

                   EXCL_DF = list_of_datafiles
                     List of datafiles to exclude from database.  These
                     are typically read-only datafiles since they only
                     need to be backed up once.  The paratheses are optional,
                     but commas are required.

                   CTL_B_NAME = file_name
                     File name for the backup binary controlfile.
                     Default:  control.ctl

                   CTL_T_NAME = file_name
                     File name for the backup create controlfile script.
                     Default:  createCTL.sql

                   TNS_ADMIN = /dir/path
                     Path location of the tns admin files.  This is
                     typically $ORACLE_HOME/network/admin.
                     For example, /home/oracle/Ora92/network/admin

                   INIT_ORA = /file/path
                     File location of the database's init.ora
                     For example, /home/oracle/db/init.ora

3. Execution details
   - How to start dbbackup?
       1. Usage:  dbbackup.sh <sid> <config>
       2. If a dbbackup is currently running for the sid, then this 
          execution will abort.

4. Directory structure - 
 	/backup/dir/
		    hot/
			temp/
			daily/
				Mon/
				Tue/
				Wed/
				Thu/
				Fri/
				Sat/
				Sun/
		   cold/
			weekly/
				one/
				two/
				three/
				four/
			monthly/
				Jan/
				Feb/
				Mar/
				Apr/
				May/
				Jun/
				Jul/
				Aug/
				Sep/
				Oct/
				Nov/
				Dec/

5. System Requirements
   - Oracle DB Installed
   - A running Oracle DB is required in order to establish a connection
   - Perl 5.8
   - DBI 1.35
   - DBD-Oracle 1.14
   - Oracle Env variables
     1. ORACLE_BASE
     2. ORACLE_HOME
   - A crontab entry is required (as user oracle) if automation is desired.
     1. Crontab entry syntax

        mi hr dd mo wkday {command}

        Example:
          09 14 * * * /home/oracle/dbbackup/dbbackup.sh test /home/oracle/dbbackup_test.cfg
