Backup & Recovery Backup and Recovery Strategies on Windows

Download Report

Transcript Backup & Recovery Backup and Recovery Strategies on Windows

Backup & Recovery
Backup and Recovery Strategies on Windows Server
2003
Objectives



At the end of this module the student will
understand the following tasks and
concepts.
Understand the difference between offline and on-line backups.
Understand how to backup RAC
databases
Understand how to do backups in
Windows.
Off-Line Backup



Best Solution
System is Quiescent
Backup is complete
Off-Line Backup


Oracle is shut down
Backup files




Data
Log
Control
Parameter
Off-Line Backup

Complete Backup

Does not require ARCHIVELOG mode



Can only recover complete database unless
running in ARCHIVELOG mode
If not ARCHIVELOG mode can only recover
backed up database
Tablespace Backup


Requires ARCHIVELOG mode for recovery
Can backup and recover on tablespace basis
ARCHIVELOG Mode

Automatically copies redo log files to
archive log files



Copies after a log switch.
Copies to archive log destination + generated
file name.
Uses archive log files for recovery
On-Line Backup



Writes to the data files are stopped
All changed blocks are redirected to the
redo logs
Process



Mark tablespace as under backup
Use OS facility to backup data files
Mark tablespace as done with backup
On-Line Backup

Streamlined version of on-line backup




Place all tablespaces in backup at once with
“Alter database begin backup”
Backup all files with an OS command
End the backup with “Alter database end
backup”
Requires a fast method for backing up files,
or the redo logs will fill rapidly
Types of Backup





Database backups
Tablespace backups
Datafile backups
Control file backups
Archive log file backups
Database Backups

Entire database is backed up






Data files
Redo Log files
Control files
Parameter files
Provides consistent picture of the database
Best type of backup (if possible)
Tablespace Backups

Backup of a single tablespace




ALTER TABLESPACE tsname BEGIN
BACKUP
Backup datafiles used by the tablespace
ALTER TABLESPACE tsname END BACKUP
Provides for recovery of a single
tablespace
Datafile Backups




Backup of a single datafile
Same files as with full and tablespace
backup
Useful if a datafile is damaged
Reduces recovery time
Control File Backups



Backup of a control file
Should be done whenever the schema
changes
ALTER DATABASE BACKUP
CONTROLFILE TO ‘filename’
Archive Log Backups




Archive log files should be backed up
immediately upon creation
This can be automated
Save recent archive log files in accessible
area
Be prepared to immediately restore them
RMAN Backup







Managed by Oracle
GUI or script interfaces
Backups catalogued in a repository
Can be off-line or on-line backups
Does not use “backup tablespace” method for on-line
backups
Can be integrated with vendor backup software and
hardware
RMAN must be used to backup 10g ASM databases
OCOPY Backups

OCOPY utility is a command-line tool that
can make the following types of backups:




Backups when Oracle database is shut down
(cold backups)
Backups of a tablespace that is offline when
the database is open
Backups of a tablespace that is online when
the database is open
OCOPY can back up only to disk and can
perform only local backups.
OCOPY and Raw Files


The OCOPY utility is particularly useful
for backing up raw files.
In the following example, \\.\G is a raw
data file that is being backed up to a
normal file system on C:\
OCOPY "\\.G:" C:\backup\datafile12.bak
Third-Party Vendor Backup



Interfaces with Oracle Backup and
Recovery Wizards
Requires vendor-supplied Media
management Layer (MML) to back up to
tape.
May use OS backup methods or RMAN
RAC Database Backups


RAC database backups are essentially the
same as single instance backups
Backup from one node


Exception: you must back up all threads of
archive log files (all nodes)
Restore to one node

Apply archive logs from all nodes as
requested
Review






If you have the luxury of time, what is the best method
to use for backups?
Name three types of Oracle backup
What command can you use to backup a database
implemented on RAW disks?
What can you use to backup a database implemented
on ASM disk groups?
What is the syntax to backup a controlfile?
What do you have to remember to backup for RAC
databases?
Summary





Off-line backup
On-line backup
RMAN backups
RAC backups
Backups under Windows