-
rman concepts - clarification
After spending the last few hours reading through Oracle 8i - Recovery Managers User guide and reference as well as various backup scripts for 8i on Windows, I'm a bit confused on some points.
1. 6 days a week we need a hot backup as the system needs to be up 24/7. I have a quick script that I tested last night that uses the following command:
run {
allocate channel ch3 type Disk;
backup full database
include current controlfile
format 'h:\backup\%d_datafile_%s_%p.bak'
tag 'rem3_datafile_daily';
}
and it worked as advertisted.
However, most of the scripts that I've seen that have been written by other people don't use "backup full database" but instead use the command "alter tablespace tablespace_name begin backup"
and then issue the run command and backup the tablespaces.
Which is better?
Additionally in looking at page 5-4 of the Rman users guide, it specifically states "Do not issue ALTER DATABASE BEGIN BACKUP before making an online backup. Why do some of the hotbackup scripts I see issue this command?
The second question I have is that in the backup command syntax it states :
Mount or open the target database. RMAN allows you to make an inconsistent
backup if the database is in ARCHIVELOG mode, but you must apply redo logs
to make the backups consistent for use in restore operations.
I believe I've read elsewhere in the rman manual that you shouldn't backup your redo logs as it would cause database corruption.
I'm trying to understand this quickly as we need the backup solution fast, but I'm a bit confused. Any and all help is much appreciated.
Mark Nelson
-
Here is the advantage of Rman backups. You do not need to put your tablespaces in backup mode.
For the hot backups that you are referening you have put tablespace in backup mode before you physically copy files to tape/alternate disk. Most of third party hot backup tools , they invoke Rman indirectly.
Note: No need use backup mode for tablespaces on Rman scripts
Raghu
-
Thanks raghud. I was just re-reading the Recovery Manager Concepts and found the answer to why you would alter tablespace begin backup on page 1-57.
So in essence, using
run {
allocate channel ch3 type Disk;
backup full database
include current controlfile
format 'h:\backup\%d_datafile_%s_%p.bak'
tag 'rem3_datafile_daily';
}
on an open database is okay, its just considered an inconsistent backup?
I'm now hunting down how the redo logs come into play if I use this method of backup. Yes I am also backing up the archive logs using rman as well.
-
There's two ways to do hot backups; scripted or via RMAN. A scripted backup is an OS script that takes tablespaces offline, copies their files via an OS command, and puts the tablespaces back online. An RMAN backup does not need to put the tablespaces in backup mode.
You don't directly backup your redo log files. Typically in a hot-backup scenario, you would archive all your log files as the first step in your backup. At the end of your backup you would backup all your archived redo log files and maybe purge them from your system. This will allow you to recover to any point in time.
As an aside, if you are just starting with a backup/recovery planning make sure you TEST, TEST, TEST and DOCUMENT, DOCUMENT, DOCUMENT your RECOVERY. Many people make the mistake of backing up their database only to find out when the s$&t hits the fan that they don't know how to recover or they are missing a critical piece. The minimum recovery scenario you should have documented (IMHO) is a recovery through your last archived redo log file.
Jeff Hunter
-
Thank you for the reply.
I'm curious about the statement that I would, as the first step, archive all the log files. Wouldn't I want to backup the full database, then issue the command
alter system archive log all
after backuping up the full database and just before backuping up the archive logs?
My thinking is that while the database is backing up the redo logs are collection data that would then be archived off with the alter system command just before backing up the archive logs.
Thanks again!
Mark
PS I'll have a test server that I can test the backups on so that will help with the disaster recovery documentation and testing
Last edited by marknel; 08-11-2004 at 04:18 PM.
-
As marist89 explained, you do not need to worry about log files in hot backup mode. The moment you issue command, backup mode on TS, Oracle writes the required blocks to data files .. All you need is taking the backup off all datafiles corosponding tablespaces and archived log files for the DB.
I think we are mixing cold backups with hot
Raghu
-
Originally posted by marknel
My thinking is that while the database is backing up the redo logs are collection data that would then be archived off with the alter system command just before backing up the archive logs.
Yes, I meant to say the LAST thing I do is...
Jeff Hunter
-
Okay I think I got. Sorry for being slow on this but its been a long day.
using rman directly and using the
backup full database while the database is open takes a full, inconsistant database backup.
After the full database backup, issue alter system archive log all and then backup the archive logs
*note I am already backing up the control files from 3 different locations and backing the control file up to trace as well*
This *should* cover the hotbackups.
Cold backsup are going to be done once a week by shutting down the database and letting the backup software archive it off to robot.
If I'm off on any of this, please correct me. I've changed some code and I'm going to step away for the night and come back to it tomorrow with a fresh head.
Thanks again for the input!
-
Originally posted by marknel
Cold backsup are going to be done once a week by shutting down the database and letting the backup software archive it off to robot.
cold backups are a waste of time as a regular backup and hurt the performance of your database.
Jeff Hunter
-
Page 9-40 of the 9i RMAN user guide will make what Marist is saying clearer..look it up before refining your scripts !
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|