160 likes | 165 Views
Learn about the different physical backup techniques in Oracle, such as cold backup and hot backup, as well as the use of Recovery Manager (RMAN) for efficient and secure backups. Discover how to implement hot backup and ensure data recovery in case of database crashes.
E N D
Back up & Recovery Strategies in Oracle Database SRUTHI NAGULAVANCHA CIS 764, FALL 2008 Department of Computing and Information Sciences (CIS) Kansas State University -1-
Outline • Introduction • Types of Physical backup • Cold backup • Recovery techniques • Hot backup • RMAN ( Recovery Manager) • RMAN advantages • References -2-
Physical Backup There are basically three types of Physical backup techniques used in oracle: • Cold Backup (offline) • Hot Backup and (online) • RMAN Backup -3-
Cold Backup • The Basic difference between hot backup and cold backup is that database is shutdown while taking the cold backup. • While taking this type of backup usually the following 3 files are backed up to tape drive : 1) Control files 2) Redo log files 3) Data files -4-
Control File • Every oracle database has a control file containing the operating system filenames of all other files that constitute the database. • This is an important file which contains consistency information that is used during recovery such as • Database name • Names of database data files and archived redo log files • Checkpoint , a record indicating the point in the redo log where all database changes prior to this point have been saved -5-
Data files • Every Oracle database has one or more Physical data files which are divided into smaller units called data blocks. • The data of logical database structures, such as tables and indexes, is physically located in the blocks of the data files allocated for a database. -6-
Redo Log files • Redo log files are very crucial for recovery .These record all changes made in data files. • Before Oracle changes data in a data file it writes these changes to the redo log. -7-
Recovery There are two methods in recovery : • Simple Restore • Restore and Recovery Example : suppose let there be a scenario where on a Tuesday morning at 11:00 am, the database crashed and we need to get this data back. Simple Restore : If the database is running in No Archive log mode then in this case all we can do is to perform a “Simple Restore” from our mondays night tape backup. -8-
Recovery But the simple restore scenario is not an industry option since we are loosing lot of data, which happened during Tuesday morning(8 am to 11 am) Restore and Recover : But if the database is in Archive log mode then we can first restore from mondays night backup and then recover the database by applying Tuesdays Archiving files on top of it. Thus there is no loss of data. -9-
Implementation of Hot Backup Hot Backup is used to Backup database even while database is up and running. The recovery techniques are similar to cold backup. Steps to implement Hot backup : • The database must be in Archive log mode • Sql > ALTER TABLESPACE user_data BEGIN BACKUP; • At Operating system level, we have to take backup of all files belonging to this tablespace • ALTER TABLESPACE user_data END BACKUP; -10-
RMAN (Recovery Manager) • RMAN is a tool which manages the process of creating backups and also manages the process of restoring and recovering • RMAN was introduced in Oracle 8 and it has become simpler with newer versions and easier than user managed backups RMAN utilities : • The target database to be backed up • The RMAN client, which interprets backup and recovery commands • A recovery catalog database is a separate database schema used to record RMAN activity against one or more target databases. • Media Management software, required for RMAN to interface with backup devices such as tape drives. -11-
RMAN Client RMAN Architecture Target Database -12- Target Database RMAN Catalog Schema Target Database Auxiliary Database Catalog Database
Steps for RMAN Backup • Install and configure Media Management software • Link MML to Oracle • Create catalog • Register target database in the catalog • Backup the database -13-
Why use RMAN ? • No extra costs….. Its available free • Proper Security • Faster backups and restores compared to backups without RMAN • It contains detail of the backups taken etc in its central repository facility for testing validity of backups. There are also commands like crosscheck to check the status of backup -14-
References • http://www.oracle.com/technology/deploy/availability/htdocs/BR_Overview.htm • http://www.orafaq.com/wiki/Oracle_database_Backup_and_Recovery_FAQ • Oracle Database 10g: The Complete Reference (Osborne ORACLE Press Series) -15-
THANK YOU Questions?