cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
365
Views
0
Helpful
0
Comments
cdnadmin
Level 11
Level 11
This document was generated from CDN thread

Created by: James Maudlin on 20-05-2011 09:46:45 AM
<h1>
Oracle DB Backup

</h1>

The database backup is a very critical operation with lots of options
available (such as full vs incremental, logical vs physical) and lots of
different technologies and 3rd party tools.

The choice of the tools/technologies/type of backup  will largely
depend on the customers' requirements/practises/infrastructure/DB sizes
which are unknown at this point.

With somany unknowns, it is safe to propose RMAN backups to the customers.

It is a good practice to have atleast once a week full backup and a daily incremental backups for the rest of the 6 days.
 
 

A compact RMAN backup script for full backup:

1) Login to oracle OS user on UNIX

2) Please make sure the necessary environment variables such as ORACLE_HOME, ORACLE_SID, PATH, LD_LIBRARY_PATH are set

3) Use the following script for backing up the oracle database:
<h3>
3.1) Full backup script</h3>

$ORACLE_HOME/bin/rman target / << EOF1



CROSSCHECK ARCHIVELOG ALL;



BACKUP DEVICE TYPE DISK TAG = 'WEEKLY_SPFILE' FORMAT 'weekly_spfile_%d_t%t_s%s_p%p' SPFILE;



backup incremental level=0 tag = 'WEEKLY_DB_FULL level 0 backup' database format 'dbhot_%d_t%t_s%s_p%p.rman';



sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';



backup archivelog all delete input format 'arc_%d_t%t_s%s_p%p.rman';



BACKUP AS COPY DEVICE TYPE DISK TAG = 'WEEKLY_CONTROLFILE' FORMAT 'weekly_controlfile_%d_t%t_s%s_p%p' CURRENT CONTROLFILE;

quit;



EOF1




<h3>
3.2) Incremental backup script</h3>

$ORACLE_HOME/bin/rman target / << EOF1



CROSSCHECK ARCHIVELOG ALL;



BACKUP DEVICE TYPE DISK TAG = 'DAILY_SPFILE' FORMAT 'daily_spfile_%d_t%t_s%s_p%p' SPFILE;



backup incremental level=1 tag = 'DAILY_DB_INCR level 1 backup' database format 'dbhot_%d_t%t_s%s_p%p.rman';



sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';



backup archivelog all delete input format 'arc_%d_t%t_s%s_p%p.rman';




BACKUP AS COPY DEVICE TYPE DISK TAG = 'DAILY_CONTROLFILE' FORMAT 'daily_controlfile_%d_t%t_s%s_p%p' CURRENT CONTROLFILE;

quit;



EOF1




<h1>
Oracle DB recovery:

</h1>



The Oracle DB recovery will largely depend on the type of failure.
Also, the recovery is a very standard oracle DBA task and following are
some good references which can be used for the same.

1) <<Charles/Basheer to include steps for stopping all of the application services>>

2) Oracle® Database Backup and Recovery Advanced User's Guide 10g Release 2 (10.2)

http://download.oracle.com/docs/cd/B19306_01/backup.102/b14191/toc.htm

3) Oracle® Database Backup and Recovery Quick Start Guide 10g Release 2 (10.2)

http://download.oracle.com/docs/cd/B19306_01/backup.102/b14193/toc.htm

4) <<Charles/Basheer to include steps for starting all of the application services>>
 
<h1>
Points to ponder:

</h1>
<ol>
<li>
The scripts presented above are just for reference/guidance only. The
respective teams have to carryout necessary modifications to the RMAN
configurations/scripts based on their requirements</li>
<li>
The scripts backup all the schemas present in that database and so are complete DB backups, not a particular schema.</li>
<li>
This script is coded for a disk backup. For tape backups, necessary changes have to be carried out to the scripts</li>
<li>
For disk backups, these scripts have to be modified to incorporate the exact backup location</li>
<li>
The respective teams have to thoroughly test the given backup/recovery
scripts/procedures before using them for production purposes.</li>
<li>
The schedule of once a week full backup and an incremental backup on
rest of the 6 days is a generic recommendation and the customers have to
re-evaluate and modify these recommendations according to their
specific needs/requirements.</li>
<li>
These backup scripts are tested against enterprise edition of oracle 64 bit 10g (10.2.0.4) and 11g (11.2.0.1.0) only</li>
</ol>

Subject: RE: Oracle DB Backup and Recovery
Replied by: Ben Sunderland on 13-02-2012 10:09:07 PM
Hi James / ALL,

Do you have any info on how to set up the scripts on the RDBMS node ?
I enabled archive logging, then placed the scripts from the guide on the server, then I tried calling these from cron :-


Put new cronjob here:-
/etc/cron.d/oracle_backups.cron

contents of oracle_backups.cron :

# inc back up of Oracle (all schemas)
# runs everyday at 11pm except sunday
00 23 * * 1-6 oracle /ben/orabackupinc.sh
# Full back up of Oracle (all schemas)
# runs sunday at 11pm
00 23 * * 0 oracle /ben/orabackupfull.sh

The contents of /ben/orabackup*.sh are exactly as per the guide and above.

But my cron logs have note moved for months, neither have my archive logs .



Now that RDBMS is a virtual appliance, is it still the customers responsibility to implement backups ?
Given the OS is now a Cisco QUad OS, I think we need recommendations on the setup beyond the scripts.

Cheers
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links