SlideShare a Scribd company logo
Oracle Backup and Recovery
Created By: Saurabh Kulkarni
www.yogijicreations.com
Index
 Backup and Need of it
 Different types of backup
 Hot vs cold
 Full vs incremental
 Physical vs logical
 User Managed backup
 RMAN
 Database recovery
 User managed
 RMAN based
 Flashback Recovery
www.yogijicreations.com
Backup
 What do we mean by database
backup ?
 The process of periodically taking a copy of the database and
log file (and possibly programs) onto offline storage media.
A backup is a copy of data.
www.yogijicreations.com
Need of taking backup
 Instance Failures
 instance shuts down without synchronizing all the
database files to the same system change number (SCN)
 A few causes for instance failure:
 A power outage
 A server hardware failure
 Failure of an Oracle background process
 Emergency shutdown procedures (intentional power outage
or SHUTDOWN ABORT)
 Solution :STARTUP Database and let
Oracle automatically perform instance
recovery using the online redo logs and
undo data in the undo tablespace.
www.yogijicreations.com
Need of taking backup
 User Error Failures
 Inadvertently delete or modify data in
tables or drop an index.
 the DROP TABLE command worked fine,
but you really didn’t want to drop that
table!
www.yogijicreations.com
 Media Failures
 The loss of one or more database files
(Datafiles, Control files, redo log files)
 The database file can be lost or
corrupted for a number of reasons:
 Failure of a disk drive
 Failure of a disk controller
 Inadvertent deletion or corruption of a
database file
www.yogijicreations.com
Different types of backup
techniques
 Hot or On-line Backups
 backup of one or more database files
while the database is open
 Inconsistent !!!
 Mismatch in SCN
SCN ( System change Number):
A stamp that defines a committed version of a database at a point
in time.
Oracle assigns every committed transaction a unique SCN.
www.yogijicreations.com
Different types of backup
techniques
 In 24 X 7 environment
 Database should be in ARCHIVELOG
mode
www.yogijicreations.com
Different types of backup
techniques
 Cold /offline Backup
 Backing up the database when it is
closed (shutdown state).
 Consistent
 No need of recovery because the data is
already consistent.
www.yogijicreations.com
Different types of backup
techniques
 Whole database backups
 Tablespace Backups
 Datafile Backups
www.yogijicreations.com
Different types of backup
techniques
 Full Backup
 Incremental Backup
 Differential Incremental Backup
 Cumulative Incremental Backup
www.yogijicreations.com
Differential Incremental Backup
 Backup all the blocks that have changed between level 0 and
level 1
www.yogijicreations.com
Cumulative Incremental Backup
 Backup all the blocks till the level 1.
www.yogijicreations.com
User-Managed Backups
 The basic user-managed backup strategy is to make periodic
backups of datafiles and archived logs with operating system
commands.
 Logical or physical.
 Physical: Backup of physical file structure (datafiles, control
files..)
 Logical: backups of logical objects such as tables, views…
 Export / Import utility is used to take logical backup and
restore it back.
www.yogijicreations.com
Basic Backup Methodology
 Identify the datafiles, control files, and archived redo logs to be
backed up by querying dynamic performance views or data
dictionary tables
 Use an operating system command such as the
UNIX cp command to back up datafiles and archived redo logs
 Use a SQL statement to back up the control file
 Use an operating system command such as the
UNIX cp command to back up configuration files
www.yogijicreations.com
Basic Backup Methodology
www.yogijicreations.com
www.yogijicreations.com
The RMAN
 Oracle provided utility for backing-up,
restoring and recovering Oracle Databases
 Doesn't require a separate installation.
 Off-line and on-line database backups.
 Can not write directly to tape.
 3rd-party tools (like Veritas, Omiback) can
integrate with RMAN to handle tape library
management.
 Only compatible with Oracle release 8.0 or
higher
www.yogijicreations.com
www.yogijicreations.com
RMAN features
 Compress backups of datafiles so that only those data
blocks that have been written to are included in a
backup
 Store frequently executed backup and recovery
operations in scripts.
 Perform incremental backups
 Create a duplicate production database for testing
purpose
 printable message log of all backup and recovery
operations.
 Recovery catalog automates both restore and
recovery operations
 Perform crosschecks
www.yogijicreations.com
RMAN Backup Concepts
 Server-managed backup
 Can back up entire database, all
datafiles in a tablespace, selected
datafiles, control files, archived redo
log files
www.yogijicreations.com
www.yogijicreations.com
RMAN: Backup techniques
 Image File
Archived
Log file
Datafile
3
Copy of datafile 3
Copy of archived log
Datafile
3
Archived
Log file
Control
file
Control
file
Copy of control file
www.yogijicreations.com
RMAN: Backup techniques
 Backup Set
Backup
set 1
Backup
set 2
Backup
set 3
Datafile
1
Datafile
2
Datafile
3
Datafile
4
Control
file
Datafile
4
Control
file
Datafile
1
Datafile
2
Datafile
3
www.yogijicreations.com
Backup Set
 Usually contain more than one file.
 Can be written to a disk or tape.
 Required to extract files for restoration
 Can be incremental or full.
 Do not include never-used blocks.
www.yogijicreations.com
Backup Piece
 A backup piece is a file in a backup set.
 A backup piece can contain blocks from
more than one datafile.
Backup set 1 (Logical)
Piece 2 (file)Piece 1 (file)
Datafile
1
Datafile
4
Datafile
5
www.yogijicreations.com
RMAN commands
 BACKUP Back up database files, archive logs,
backups, or copies.
 CATALOG Add information about files to the
repository. (10g+)
 CHANGE Update the status of a backup in the RMAN
repository.
 CONFIGURE Persistent RMAN settings.
 CONNECT Connect to a recovery catalog or auxiliary
database
 CROSSCHECK Check whether backup items still exist.
 DELETE Delete backups from disk or tape EXIT Exit
the RMAN console
 LIST List backups and copies
www.yogijicreations.com
RMAN Commands
 RECOVER Apply redo logs or incremental backups to a restored
backup set (or copy) in order to update it to a specified time.
 REPORT Report backup status: database, files, backups
 RESTORE Restore files from an RMAN backup (or copy)
 RUN Some RMAN commands are only valid inside a RUN block.
 SET Settings for the current RMAN session.
 SHOW Display the current configuration
 SHUTDOWN Shutdown the database SQL Execute a PL/SQL
procedure or SQL statement(not SELECT)
 STARTUP Startup the database
 ADVISE FAILURE Display repair options (11g Data Recovery
Advisor)
 REPAIR FAILURE Repair database failures (11g Data Recovery
Advisor)
www.yogijicreations.com
Backing up database using RMAN
 Command: Backup
 During an RMAN backup, the Oracle
database server reads the datafiles, not an
operating system utility.
 The server reads each block and
determines whether the block is
inconsistent.
 If the block is inconsistent, then Oracle re-
reads the block until it gets a consistent
picture of the data.
www.yogijicreations.com
Backing up database using RMAN
Logical name assigned to a backup set or image copy
month_full_backup week_full_backup Wednesday_1_backup
Datafile
3
Datafile
4
Backup set
Datafiles
1,3
Datafiles
2,4
Backup set
Datafile
1
Backup set
www.yogijicreations.com
RMAN Control File Autobackups
 CONFIGURE CONTROLFILE AUTOBACKUP
 When enabled, RMAN automatically
performs a control file autobackup
after BACKUP or COPY commands
www.yogijicreations.com
Archived Redo Log Backups
 Archived redo logs are essential for
recovering an inconsistent backup.
 BACKUP ARCHIVELOG
www.yogijicreations.com
RMAN Dynamic Views
 V$ARCHIVED_LOG
 V$BACKUP_CORRUPTION
 V$COPY_CORRUPTION
 V$BACKUP_DATAFILE
 V$BACKUP_REDOLOG
 V$BACKUP_SET
 V$BACKUP_PIECE
www.yogijicreations.com
Database Recovery
 Difference between restoring and
recovering?
 Restoring: copying backup files from
secondary storage (backup media) to
disk.
 Recovering: process of applying redo
logs to the database to roll it forward.
www.yogijicreations.com
www.yogijicreations.com
Preparing to recover (user
managed recovery)
 Remain calm and do not panic
 Restore database files to their
respective locations
 Recover the database to the point of
failure using Online redo log files.
(Roll forward)
 Roll back to the last consistent state.
www.yogijicreations.com
Restoring Backups of the Damaged
or Missing Files
 Determine which datafiles to recover
 SELECT * FROM V$RECOVER_FILE;
www.yogijicreations.com
Restoring Backups of the Damaged
or Missing Files
 Query V$DATAFILE and V$TABLESPACE to obtain filenames
and tablespace names for datafiles requiring recovery.
 Incase of media failure, indicate the new locations of datafiles
files to the control file.
 If the database is open, then take the tablespaces containing
the inaccessible datafiles offline.
 ALTER TABLESPACE users OFFLINE IMMEDIATE;
 Copy backups of the damaged datafiles to their default location
 % cp /disk2/backup/tbs_24.bak /disk1/oracle/dbs/tbs_24.f
 Recover the affected tablespace.
 RECOVER TABLESPACE users
 Bring the recovered tablespace online
 ALTER TABLESPACE users ONLINE
www.yogijicreations.com
Re-Creating Datafiles When
Backups Are Unavailable
 All archived log files written after the creation of the original
datafile must be available
 The control file contains the name of the damaged file
 Create a new, empty datafile to replace a damaged
datafile that has no corresponding backup.
 ALTER DATABASE CREATE DATAFILE '/disk1/users1.f' AS
'/disk2/users1.f';
 Perform media recovery on the empty datafile.
 ALTER DATABASE CREATE DATAFILE '/disk1/users1.f' AS
'/disk2/users1.f';
www.yogijicreations.com
Recovery of Database when Control
files are lost
 Find the location of the datafiles and log
files.
 Create a new control file based on above
information
 CREATE CONTROLFILE REUSE DATABASE "ORCL10G" RESETLOGS
LOGFILE
GROUP 1 'K:ORCL10GLOGREDO01.LOG' SIZE 50M,
GROUP 2 'K:ORCL10GLOGREDO02.LOG' SIZE 50M,
DATAFILE
'K:ORCL10GDATASYSTEM01.DBF',
'K:ORCL10GDATAUNDOTBS01.DBF',
'K:ORCL10GDATASYSAUX01.DBF‘;
 Open the database with resetlogs option.
 alter database open resetlogs;
www.yogijicreations.com
RMAN Recovery Techniques
 Enhanced RMAN Features
 Automated File Creation During Recovery
 Simplified Recovery Through Resetlogs
 Change-Aware Incremental Backups
 Automated Disk-Based Backup and
Recovery
 RMAN Database Dropping and
Deregistration
www.yogijicreations.com
Automated File Creation During
Recovery
 This feature enhances RMAN recovery
by automatically creating and
recovering datafiles that have never
been backed up.
 Archive log files are still required
www.yogijicreations.com
Automated File Creation During
Recovery
data file
#1
data file
#2
Missing
data file
#3
Control fle
RMAN
Archive log files
www.yogijicreations.com
Importance of Redo log files
 The online redo logs are a set of two or more files that record
all changes made to Oracle datafiles and control files.
 Whenever a change is made to the database, the Oracle
database server writes the data and generates a redo record in
the redo buffer.
www.yogijicreations.com
Recovery using Flashback Functions
 Flashback is an Oracle
database facility to quickly move an
entire database or a table back to a
prior state for recovery purposes.
 Flashback was first introduced
with Oracle 9i with Oracle's Flashback
Query feature.
www.yogijicreations.com
FRA ( Flashback Recovery area)
 storage area (directory on disk
or ASM diskgroup) that enables
database Flash Backup and Recovery
operations.
 first introduced with Oracle 10g.
 Related parameters:
 db_recovery_file_dest
 db_recovery_file_dest_size
 db_flashback_retention_target
www.yogijicreations.com
Flashback Query ( 9i Feature)
 Allows users to see a consistent view
of the database as it was at a point in
the past.
 In Oracle 10g, we can now retrieve all versions of the rows
that exist or ever existed between the time the query was
issued and a point back in time.
www.yogijicreations.com
Flashback Database
 Faster than traditional point-in-time recovery.
 Traditional recovery method: Backups and Redo logs
 Flashback Database is implemented using a new type
of log file called the Flashback Database log.
 Oracle database server periodically logs before
images of data blocks in the Flashback Database logs.
 The data block images are used to quickly back out
changes to the database during Flashback Database.
 RVWR: similar to the LGWR (log writer) process.
 writes Flashback Database data to the Flashback
Database logs.
www.yogijicreations.com
www.yogijicreations.com
Enabling Flashback Database
 Make sure the database is in archive mode.
 Configure the recovery area by setting the two
parameters:
 DB_RECOVERY_FILE_DEST
 DB_RECOVERY_FILE_DEST_SIZE
 Open the database in MOUNT EXCLUSIVE mode and
turn on the flashback feature:
SQL> STARTUP MOUNT EXCLUSIVE;
SQL> ALTER DATABASE FLASHBACK ON;
 Set the Flashback Database retention target:
 DB_FLASHBACK_RETENTION_TARGET
www.yogijicreations.com
Flashback Drop
 DROP command permanently
removed objects from the database…
 In Oracle 10g, a DROP command
places the object in the recycle bin.
 You can restore the object from the
recycle bin at any time.
 Flashback table emp to before drop;
 drop table emp PURGE;
www.yogijicreations.com
Recycle Bin
 A recycle bin contains all the dropped
database objects until,
 Permanently drop them with the PURGE
command.
 Recover the dropped objects with the
FLASHBACK TABLE command.
 There is no room in the tablespace for
new rows or updates to existing rows.
 The tablespace needs to be extended.
www.yogijicreations.com
Flashback Table
 Flashback Table allows you to recover a
table or tables to a specific point in time
without restoring a backup.
 When you use the Flashback Table feature
to restore a table to a specific point in time,
all associated objects, such as, indexes,
constraints, and triggers will be restored.
 FLASHBACK TABLE emp TO SCN 76230;
www.yogijicreations.com
Flashback Transaction Query
 It provides a way for you to view
changes made to the database at the
transaction level.
 It allows you to diagnose problems in
your database and perform analysis
and audit transactions
www.yogijicreations.com
Questions ?
www.yogijicreations.com
For queries: info@yogijicreations.com

More Related Content

What's hot

What to Expect From Oracle database 19c
What to Expect From Oracle database 19cWhat to Expect From Oracle database 19c
What to Expect From Oracle database 19c
Maria Colgan
 
Why oracle data guard new features in oracle 18c, 19c
Why oracle data guard new features in oracle 18c, 19cWhy oracle data guard new features in oracle 18c, 19c
Why oracle data guard new features in oracle 18c, 19c
Satishbabu Gunukula
 
Oracle architecture ppt
Oracle architecture pptOracle architecture ppt
Oracle architecture ppt
Deepak Shetty
 
Less06 networking
Less06 networkingLess06 networking
Less06 networking
Amit Bhalla
 
Oracle User Management
Oracle User ManagementOracle User Management
Oracle User Management
Arun Sharma
 
Oracle DBA
Oracle DBAOracle DBA
Oracle DBA
shivankuniversity
 
User, roles and privileges
User, roles and privilegesUser, roles and privileges
User, roles and privileges
Yogiji Creations
 
Oracle Architecture
Oracle ArchitectureOracle Architecture
Oracle Architecture
Neeraj Singh
 
Oracle Tablespace - Basic
Oracle Tablespace - BasicOracle Tablespace - Basic
Oracle Tablespace - Basic
Eryk Budi Pratama
 
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdfOracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
SrirakshaSrinivasan2
 
Oracle architecture
Oracle architectureOracle architecture
Oracle architecture
Soumya Das
 
Fast Start Failover DataGuard
Fast Start Failover DataGuardFast Start Failover DataGuard
Fast Start Failover DataGuard
Borsaniya Vaibhav
 
Less01 architecture
Less01 architectureLess01 architecture
Less01 architectureAmit Bhalla
 
An Introduction To Oracle Database
An Introduction To Oracle DatabaseAn Introduction To Oracle Database
An Introduction To Oracle Database
Meysam Javadi
 
Oracle Golden Gate Interview Questions
Oracle Golden Gate Interview QuestionsOracle Golden Gate Interview Questions
Oracle Golden Gate Interview Questions
Arun Sharma
 
Oracle data pump
Oracle data pumpOracle data pump
Oracle data pumpmarcxav72
 
ORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIES
ORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIESORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIES
ORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIES
Ludovico Caldara
 
MySQL Backup & Recovery
MySQL Backup & RecoveryMySQL Backup & Recovery
MySQL Backup & Recovery
Mindfire Solutions
 
The Oracle RAC Family of Solutions - Presentation
The Oracle RAC Family of Solutions - PresentationThe Oracle RAC Family of Solutions - Presentation
The Oracle RAC Family of Solutions - Presentation
Markus Michalewicz
 
The oracle database architecture
The oracle database architectureThe oracle database architecture
The oracle database architecture
Akash Pramanik
 

What's hot (20)

What to Expect From Oracle database 19c
What to Expect From Oracle database 19cWhat to Expect From Oracle database 19c
What to Expect From Oracle database 19c
 
Why oracle data guard new features in oracle 18c, 19c
Why oracle data guard new features in oracle 18c, 19cWhy oracle data guard new features in oracle 18c, 19c
Why oracle data guard new features in oracle 18c, 19c
 
Oracle architecture ppt
Oracle architecture pptOracle architecture ppt
Oracle architecture ppt
 
Less06 networking
Less06 networkingLess06 networking
Less06 networking
 
Oracle User Management
Oracle User ManagementOracle User Management
Oracle User Management
 
Oracle DBA
Oracle DBAOracle DBA
Oracle DBA
 
User, roles and privileges
User, roles and privilegesUser, roles and privileges
User, roles and privileges
 
Oracle Architecture
Oracle ArchitectureOracle Architecture
Oracle Architecture
 
Oracle Tablespace - Basic
Oracle Tablespace - BasicOracle Tablespace - Basic
Oracle Tablespace - Basic
 
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdfOracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
 
Oracle architecture
Oracle architectureOracle architecture
Oracle architecture
 
Fast Start Failover DataGuard
Fast Start Failover DataGuardFast Start Failover DataGuard
Fast Start Failover DataGuard
 
Less01 architecture
Less01 architectureLess01 architecture
Less01 architecture
 
An Introduction To Oracle Database
An Introduction To Oracle DatabaseAn Introduction To Oracle Database
An Introduction To Oracle Database
 
Oracle Golden Gate Interview Questions
Oracle Golden Gate Interview QuestionsOracle Golden Gate Interview Questions
Oracle Golden Gate Interview Questions
 
Oracle data pump
Oracle data pumpOracle data pump
Oracle data pump
 
ORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIES
ORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIESORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIES
ORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIES
 
MySQL Backup & Recovery
MySQL Backup & RecoveryMySQL Backup & Recovery
MySQL Backup & Recovery
 
The Oracle RAC Family of Solutions - Presentation
The Oracle RAC Family of Solutions - PresentationThe Oracle RAC Family of Solutions - Presentation
The Oracle RAC Family of Solutions - Presentation
 
The oracle database architecture
The oracle database architectureThe oracle database architecture
The oracle database architecture
 

Viewers also liked

Backup And Recovery
Backup And RecoveryBackup And Recovery
Backup And Recovery
raghu_designer
 
2.6 backup and recovery
2.6 backup and recovery2.6 backup and recovery
2.6 backup and recoverymrmwood
 
Data protection for oracle backup & recovery for oracle databases
Data protection for oracle  backup & recovery for oracle databasesData protection for oracle  backup & recovery for oracle databases
Data protection for oracle backup & recovery for oracle databases
solarisyougood
 
Presentation on backup and recoveryyyyyyyyyyyyy
Presentation on backup and recoveryyyyyyyyyyyyyPresentation on backup and recoveryyyyyyyyyyyyy
Presentation on backup and recoveryyyyyyyyyyyyyTehmina Gulfam
 
Oracle database backup recovery step by step
Oracle database backup recovery step by stepOracle database backup recovery step by step
Oracle database backup recovery step by step
Aakash Mehndiratta
 
Database backup and recovery
Database backup and recoveryDatabase backup and recovery
Database backup and recovery
Anne Lee
 
03 backup-and-recovery
03 backup-and-recovery03 backup-and-recovery
03 backup-and-recovery
hunny garg
 
Backup And Recovery
Backup And RecoveryBackup And Recovery
Backup And Recovery
Wynthorpe
 
Disaster Recovery & Data Backup Strategies
Disaster Recovery & Data Backup StrategiesDisaster Recovery & Data Backup Strategies
Disaster Recovery & Data Backup StrategiesSpiceworks
 
Less17 flashback tb3
Less17 flashback tb3Less17 flashback tb3
Less17 flashback tb3Imran Ali
 
Oracle backup and recovery user's guide
Oracle backup and recovery user's guideOracle backup and recovery user's guide
Oracle backup and recovery user's guide
Egg Chang
 
Oracle flashback
Oracle flashbackOracle flashback
Oracle flashback
Cambodia
 
Presentation recovery manager (rman) configuration and performance tuning ...
Presentation    recovery manager (rman) configuration and performance tuning ...Presentation    recovery manager (rman) configuration and performance tuning ...
Presentation recovery manager (rman) configuration and performance tuning ...
xKinAnx
 
Beginbackup
BeginbackupBeginbackup
Beginbackup
oracle documents
 
Cyceo solution stockage de fichiers
Cyceo solution stockage de fichiersCyceo solution stockage de fichiers
Cyceo solution stockage de fichiers
CYCEO INFORMATIQUE
 
Nettoyage de matériels informatique
Nettoyage de matériels informatiqueNettoyage de matériels informatique
Nettoyage de matériels informatique
CYCEO INFORMATIQUE
 
2011.11.23 - Le Cloud, Réalités et Perspectives - 8ème Forum du Club Cloud de...
2011.11.23 - Le Cloud, Réalités et Perspectives - 8ème Forum du Club Cloud de...2011.11.23 - Le Cloud, Réalités et Perspectives - 8ème Forum du Club Cloud de...
2011.11.23 - Le Cloud, Réalités et Perspectives - 8ème Forum du Club Cloud de...
Club Cloud des Partenaires
 
Track 2 - Atelier 1 - Big data analytics présenté avec Intel
Track 2 - Atelier 1 - Big data analytics présenté avec IntelTrack 2 - Atelier 1 - Big data analytics présenté avec Intel
Track 2 - Atelier 1 - Big data analytics présenté avec Intel
Amazon Web Services
 
Mon Stockage a la Cloud Attitude
Mon Stockage a la Cloud Attitude Mon Stockage a la Cloud Attitude
Mon Stockage a la Cloud Attitude
Microsoft Technet France
 

Viewers also liked (20)

Backup And Recovery
Backup And RecoveryBackup And Recovery
Backup And Recovery
 
2.6 backup and recovery
2.6 backup and recovery2.6 backup and recovery
2.6 backup and recovery
 
Data protection for oracle backup & recovery for oracle databases
Data protection for oracle  backup & recovery for oracle databasesData protection for oracle  backup & recovery for oracle databases
Data protection for oracle backup & recovery for oracle databases
 
Presentation on backup and recoveryyyyyyyyyyyyy
Presentation on backup and recoveryyyyyyyyyyyyyPresentation on backup and recoveryyyyyyyyyyyyy
Presentation on backup and recoveryyyyyyyyyyyyy
 
Oracle database backup recovery step by step
Oracle database backup recovery step by stepOracle database backup recovery step by step
Oracle database backup recovery step by step
 
Database backup and recovery
Database backup and recoveryDatabase backup and recovery
Database backup and recovery
 
03 backup-and-recovery
03 backup-and-recovery03 backup-and-recovery
03 backup-and-recovery
 
Backup And Recovery
Backup And RecoveryBackup And Recovery
Backup And Recovery
 
Disaster Recovery & Data Backup Strategies
Disaster Recovery & Data Backup StrategiesDisaster Recovery & Data Backup Strategies
Disaster Recovery & Data Backup Strategies
 
Less17 flashback tb3
Less17 flashback tb3Less17 flashback tb3
Less17 flashback tb3
 
Oracle backup and recovery user's guide
Oracle backup and recovery user's guideOracle backup and recovery user's guide
Oracle backup and recovery user's guide
 
Oracle flashback
Oracle flashbackOracle flashback
Oracle flashback
 
Presentation recovery manager (rman) configuration and performance tuning ...
Presentation    recovery manager (rman) configuration and performance tuning ...Presentation    recovery manager (rman) configuration and performance tuning ...
Presentation recovery manager (rman) configuration and performance tuning ...
 
Beginbackup
BeginbackupBeginbackup
Beginbackup
 
Cyceo solution stockage de fichiers
Cyceo solution stockage de fichiersCyceo solution stockage de fichiers
Cyceo solution stockage de fichiers
 
Nettoyage de matériels informatique
Nettoyage de matériels informatiqueNettoyage de matériels informatique
Nettoyage de matériels informatique
 
2011.11.23 - Le Cloud, Réalités et Perspectives - 8ème Forum du Club Cloud de...
2011.11.23 - Le Cloud, Réalités et Perspectives - 8ème Forum du Club Cloud de...2011.11.23 - Le Cloud, Réalités et Perspectives - 8ème Forum du Club Cloud de...
2011.11.23 - Le Cloud, Réalités et Perspectives - 8ème Forum du Club Cloud de...
 
10135 b 08
10135 b 0810135 b 08
10135 b 08
 
Track 2 - Atelier 1 - Big data analytics présenté avec Intel
Track 2 - Atelier 1 - Big data analytics présenté avec IntelTrack 2 - Atelier 1 - Big data analytics présenté avec Intel
Track 2 - Atelier 1 - Big data analytics présenté avec Intel
 
Mon Stockage a la Cloud Attitude
Mon Stockage a la Cloud Attitude Mon Stockage a la Cloud Attitude
Mon Stockage a la Cloud Attitude
 

Similar to Oracle backup and recovery

Less14 Br Concepts
Less14 Br ConceptsLess14 Br Concepts
Less14 Br Conceptsvivaankumar
 
Les 06 Perform Rec
Les 06 Perform RecLes 06 Perform Rec
Les 06 Perform Rec
vivaankumar
 
Les 02 Config Rec
Les 02 Config RecLes 02 Config Rec
Les 02 Config Rec
vivaankumar
 
Backup and Recovery Procedure
Backup and Recovery ProcedureBackup and Recovery Procedure
Backup and Recovery ProcedureAnar Godjaev
 
Oracle OCP Backup Exam
Oracle OCP Backup ExamOracle OCP Backup Exam
Oracle OCP Backup ExamInprise Group
 
Mid term & final- preparation- student-review(Oracle)
Mid term & final- preparation- student-review(Oracle)Mid term & final- preparation- student-review(Oracle)
Mid term & final- preparation- student-review(Oracle)
than sare
 
Oracle ocp backup exam
Oracle ocp backup examOracle ocp backup exam
Oracle ocp backup examsriram raj
 
8 i rman_love_it
8 i rman_love_it8 i rman_love_it
8 i rman_love_it
Anil Pandey
 
[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery
altistory
 
Ioug tip book11_gunukula
Ioug tip book11_gunukulaIoug tip book11_gunukula
Ioug tip book11_gunukula
Satishbabu Gunukula
 
Les 07 Rman Rec
Les 07 Rman RecLes 07 Rman Rec
Les 07 Rman Rec
vivaankumar
 
Backup beyond just a strategy with SQL Server
Backup beyond just a strategy with SQL ServerBackup beyond just a strategy with SQL Server
Backup beyond just a strategy with SQL Server
Vinod Kumar
 
Les 05 Create Bu
Les 05 Create BuLes 05 Create Bu
Les 05 Create Bu
vivaankumar
 
Oracle Database Backup
Oracle Database BackupOracle Database Backup
Oracle Database Backup
Handy_Backup
 
Oracle database hot backup and recovery
Oracle database hot backup and recoveryOracle database hot backup and recovery
Oracle database hot backup and recovery
Arun Sharma
 
Backups And Recovery
Backups And RecoveryBackups And Recovery
Backups And Recovery
asifmalik110
 
IT103Microsoft Windows XP/OS Chap15
IT103Microsoft Windows XP/OS Chap15IT103Microsoft Windows XP/OS Chap15
IT103Microsoft Windows XP/OS Chap15blusmurfydot1
 
Data Guard New Features
Data Guard New FeaturesData Guard New Features
Data Guard New Features
xiangrong
 

Similar to Oracle backup and recovery (20)

Less14 Br Concepts
Less14 Br ConceptsLess14 Br Concepts
Less14 Br Concepts
 
Les 06 Perform Rec
Les 06 Perform RecLes 06 Perform Rec
Les 06 Perform Rec
 
Les 02 Config Rec
Les 02 Config RecLes 02 Config Rec
Les 02 Config Rec
 
Backup and Recovery Procedure
Backup and Recovery ProcedureBackup and Recovery Procedure
Backup and Recovery Procedure
 
Oracle OCP Backup Exam
Oracle OCP Backup ExamOracle OCP Backup Exam
Oracle OCP Backup Exam
 
Mid term & final- preparation- student-review(Oracle)
Mid term & final- preparation- student-review(Oracle)Mid term & final- preparation- student-review(Oracle)
Mid term & final- preparation- student-review(Oracle)
 
Oracle ocp backup exam
Oracle ocp backup examOracle ocp backup exam
Oracle ocp backup exam
 
8 i rman_love_it
8 i rman_love_it8 i rman_love_it
8 i rman_love_it
 
[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery
 
Ioug tip book11_gunukula
Ioug tip book11_gunukulaIoug tip book11_gunukula
Ioug tip book11_gunukula
 
Les 07 Rman Rec
Les 07 Rman RecLes 07 Rman Rec
Les 07 Rman Rec
 
Less15 Backups
Less15 BackupsLess15 Backups
Less15 Backups
 
Backup beyond just a strategy with SQL Server
Backup beyond just a strategy with SQL ServerBackup beyond just a strategy with SQL Server
Backup beyond just a strategy with SQL Server
 
Les 05 Create Bu
Les 05 Create BuLes 05 Create Bu
Les 05 Create Bu
 
Oracle Database Backup
Oracle Database BackupOracle Database Backup
Oracle Database Backup
 
Les 07 rman_rec
Les 07 rman_recLes 07 rman_rec
Les 07 rman_rec
 
Oracle database hot backup and recovery
Oracle database hot backup and recoveryOracle database hot backup and recovery
Oracle database hot backup and recovery
 
Backups And Recovery
Backups And RecoveryBackups And Recovery
Backups And Recovery
 
IT103Microsoft Windows XP/OS Chap15
IT103Microsoft Windows XP/OS Chap15IT103Microsoft Windows XP/OS Chap15
IT103Microsoft Windows XP/OS Chap15
 
Data Guard New Features
Data Guard New FeaturesData Guard New Features
Data Guard New Features
 

Recently uploaded

CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 

Recently uploaded (20)

CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 

Oracle backup and recovery

  • 1. Oracle Backup and Recovery Created By: Saurabh Kulkarni www.yogijicreations.com
  • 2. Index  Backup and Need of it  Different types of backup  Hot vs cold  Full vs incremental  Physical vs logical  User Managed backup  RMAN  Database recovery  User managed  RMAN based  Flashback Recovery www.yogijicreations.com
  • 3. Backup  What do we mean by database backup ?  The process of periodically taking a copy of the database and log file (and possibly programs) onto offline storage media. A backup is a copy of data. www.yogijicreations.com
  • 4. Need of taking backup  Instance Failures  instance shuts down without synchronizing all the database files to the same system change number (SCN)  A few causes for instance failure:  A power outage  A server hardware failure  Failure of an Oracle background process  Emergency shutdown procedures (intentional power outage or SHUTDOWN ABORT)  Solution :STARTUP Database and let Oracle automatically perform instance recovery using the online redo logs and undo data in the undo tablespace. www.yogijicreations.com
  • 5. Need of taking backup  User Error Failures  Inadvertently delete or modify data in tables or drop an index.  the DROP TABLE command worked fine, but you really didn’t want to drop that table! www.yogijicreations.com
  • 6.  Media Failures  The loss of one or more database files (Datafiles, Control files, redo log files)  The database file can be lost or corrupted for a number of reasons:  Failure of a disk drive  Failure of a disk controller  Inadvertent deletion or corruption of a database file www.yogijicreations.com
  • 7. Different types of backup techniques  Hot or On-line Backups  backup of one or more database files while the database is open  Inconsistent !!!  Mismatch in SCN SCN ( System change Number): A stamp that defines a committed version of a database at a point in time. Oracle assigns every committed transaction a unique SCN. www.yogijicreations.com
  • 8. Different types of backup techniques  In 24 X 7 environment  Database should be in ARCHIVELOG mode www.yogijicreations.com
  • 9. Different types of backup techniques  Cold /offline Backup  Backing up the database when it is closed (shutdown state).  Consistent  No need of recovery because the data is already consistent. www.yogijicreations.com
  • 10. Different types of backup techniques  Whole database backups  Tablespace Backups  Datafile Backups www.yogijicreations.com
  • 11. Different types of backup techniques  Full Backup  Incremental Backup  Differential Incremental Backup  Cumulative Incremental Backup www.yogijicreations.com
  • 12. Differential Incremental Backup  Backup all the blocks that have changed between level 0 and level 1 www.yogijicreations.com
  • 13. Cumulative Incremental Backup  Backup all the blocks till the level 1. www.yogijicreations.com
  • 14. User-Managed Backups  The basic user-managed backup strategy is to make periodic backups of datafiles and archived logs with operating system commands.  Logical or physical.  Physical: Backup of physical file structure (datafiles, control files..)  Logical: backups of logical objects such as tables, views…  Export / Import utility is used to take logical backup and restore it back. www.yogijicreations.com
  • 15. Basic Backup Methodology  Identify the datafiles, control files, and archived redo logs to be backed up by querying dynamic performance views or data dictionary tables  Use an operating system command such as the UNIX cp command to back up datafiles and archived redo logs  Use a SQL statement to back up the control file  Use an operating system command such as the UNIX cp command to back up configuration files www.yogijicreations.com
  • 18. The RMAN  Oracle provided utility for backing-up, restoring and recovering Oracle Databases  Doesn't require a separate installation.  Off-line and on-line database backups.  Can not write directly to tape.  3rd-party tools (like Veritas, Omiback) can integrate with RMAN to handle tape library management.  Only compatible with Oracle release 8.0 or higher www.yogijicreations.com
  • 20. RMAN features  Compress backups of datafiles so that only those data blocks that have been written to are included in a backup  Store frequently executed backup and recovery operations in scripts.  Perform incremental backups  Create a duplicate production database for testing purpose  printable message log of all backup and recovery operations.  Recovery catalog automates both restore and recovery operations  Perform crosschecks www.yogijicreations.com
  • 21. RMAN Backup Concepts  Server-managed backup  Can back up entire database, all datafiles in a tablespace, selected datafiles, control files, archived redo log files www.yogijicreations.com
  • 23. RMAN: Backup techniques  Image File Archived Log file Datafile 3 Copy of datafile 3 Copy of archived log Datafile 3 Archived Log file Control file Control file Copy of control file www.yogijicreations.com
  • 24. RMAN: Backup techniques  Backup Set Backup set 1 Backup set 2 Backup set 3 Datafile 1 Datafile 2 Datafile 3 Datafile 4 Control file Datafile 4 Control file Datafile 1 Datafile 2 Datafile 3 www.yogijicreations.com
  • 25. Backup Set  Usually contain more than one file.  Can be written to a disk or tape.  Required to extract files for restoration  Can be incremental or full.  Do not include never-used blocks. www.yogijicreations.com
  • 26. Backup Piece  A backup piece is a file in a backup set.  A backup piece can contain blocks from more than one datafile. Backup set 1 (Logical) Piece 2 (file)Piece 1 (file) Datafile 1 Datafile 4 Datafile 5 www.yogijicreations.com
  • 27. RMAN commands  BACKUP Back up database files, archive logs, backups, or copies.  CATALOG Add information about files to the repository. (10g+)  CHANGE Update the status of a backup in the RMAN repository.  CONFIGURE Persistent RMAN settings.  CONNECT Connect to a recovery catalog or auxiliary database  CROSSCHECK Check whether backup items still exist.  DELETE Delete backups from disk or tape EXIT Exit the RMAN console  LIST List backups and copies www.yogijicreations.com
  • 28. RMAN Commands  RECOVER Apply redo logs or incremental backups to a restored backup set (or copy) in order to update it to a specified time.  REPORT Report backup status: database, files, backups  RESTORE Restore files from an RMAN backup (or copy)  RUN Some RMAN commands are only valid inside a RUN block.  SET Settings for the current RMAN session.  SHOW Display the current configuration  SHUTDOWN Shutdown the database SQL Execute a PL/SQL procedure or SQL statement(not SELECT)  STARTUP Startup the database  ADVISE FAILURE Display repair options (11g Data Recovery Advisor)  REPAIR FAILURE Repair database failures (11g Data Recovery Advisor) www.yogijicreations.com
  • 29. Backing up database using RMAN  Command: Backup  During an RMAN backup, the Oracle database server reads the datafiles, not an operating system utility.  The server reads each block and determines whether the block is inconsistent.  If the block is inconsistent, then Oracle re- reads the block until it gets a consistent picture of the data. www.yogijicreations.com
  • 30. Backing up database using RMAN Logical name assigned to a backup set or image copy month_full_backup week_full_backup Wednesday_1_backup Datafile 3 Datafile 4 Backup set Datafiles 1,3 Datafiles 2,4 Backup set Datafile 1 Backup set www.yogijicreations.com
  • 31. RMAN Control File Autobackups  CONFIGURE CONTROLFILE AUTOBACKUP  When enabled, RMAN automatically performs a control file autobackup after BACKUP or COPY commands www.yogijicreations.com
  • 32. Archived Redo Log Backups  Archived redo logs are essential for recovering an inconsistent backup.  BACKUP ARCHIVELOG www.yogijicreations.com
  • 33. RMAN Dynamic Views  V$ARCHIVED_LOG  V$BACKUP_CORRUPTION  V$COPY_CORRUPTION  V$BACKUP_DATAFILE  V$BACKUP_REDOLOG  V$BACKUP_SET  V$BACKUP_PIECE www.yogijicreations.com
  • 34. Database Recovery  Difference between restoring and recovering?  Restoring: copying backup files from secondary storage (backup media) to disk.  Recovering: process of applying redo logs to the database to roll it forward. www.yogijicreations.com
  • 36. Preparing to recover (user managed recovery)  Remain calm and do not panic  Restore database files to their respective locations  Recover the database to the point of failure using Online redo log files. (Roll forward)  Roll back to the last consistent state. www.yogijicreations.com
  • 37. Restoring Backups of the Damaged or Missing Files  Determine which datafiles to recover  SELECT * FROM V$RECOVER_FILE; www.yogijicreations.com
  • 38. Restoring Backups of the Damaged or Missing Files  Query V$DATAFILE and V$TABLESPACE to obtain filenames and tablespace names for datafiles requiring recovery.  Incase of media failure, indicate the new locations of datafiles files to the control file.  If the database is open, then take the tablespaces containing the inaccessible datafiles offline.  ALTER TABLESPACE users OFFLINE IMMEDIATE;  Copy backups of the damaged datafiles to their default location  % cp /disk2/backup/tbs_24.bak /disk1/oracle/dbs/tbs_24.f  Recover the affected tablespace.  RECOVER TABLESPACE users  Bring the recovered tablespace online  ALTER TABLESPACE users ONLINE www.yogijicreations.com
  • 39. Re-Creating Datafiles When Backups Are Unavailable  All archived log files written after the creation of the original datafile must be available  The control file contains the name of the damaged file  Create a new, empty datafile to replace a damaged datafile that has no corresponding backup.  ALTER DATABASE CREATE DATAFILE '/disk1/users1.f' AS '/disk2/users1.f';  Perform media recovery on the empty datafile.  ALTER DATABASE CREATE DATAFILE '/disk1/users1.f' AS '/disk2/users1.f'; www.yogijicreations.com
  • 40. Recovery of Database when Control files are lost  Find the location of the datafiles and log files.  Create a new control file based on above information  CREATE CONTROLFILE REUSE DATABASE "ORCL10G" RESETLOGS LOGFILE GROUP 1 'K:ORCL10GLOGREDO01.LOG' SIZE 50M, GROUP 2 'K:ORCL10GLOGREDO02.LOG' SIZE 50M, DATAFILE 'K:ORCL10GDATASYSTEM01.DBF', 'K:ORCL10GDATAUNDOTBS01.DBF', 'K:ORCL10GDATASYSAUX01.DBF‘;  Open the database with resetlogs option.  alter database open resetlogs; www.yogijicreations.com
  • 41. RMAN Recovery Techniques  Enhanced RMAN Features  Automated File Creation During Recovery  Simplified Recovery Through Resetlogs  Change-Aware Incremental Backups  Automated Disk-Based Backup and Recovery  RMAN Database Dropping and Deregistration www.yogijicreations.com
  • 42. Automated File Creation During Recovery  This feature enhances RMAN recovery by automatically creating and recovering datafiles that have never been backed up.  Archive log files are still required www.yogijicreations.com
  • 43. Automated File Creation During Recovery data file #1 data file #2 Missing data file #3 Control fle RMAN Archive log files www.yogijicreations.com
  • 44. Importance of Redo log files  The online redo logs are a set of two or more files that record all changes made to Oracle datafiles and control files.  Whenever a change is made to the database, the Oracle database server writes the data and generates a redo record in the redo buffer. www.yogijicreations.com
  • 45. Recovery using Flashback Functions  Flashback is an Oracle database facility to quickly move an entire database or a table back to a prior state for recovery purposes.  Flashback was first introduced with Oracle 9i with Oracle's Flashback Query feature. www.yogijicreations.com
  • 46. FRA ( Flashback Recovery area)  storage area (directory on disk or ASM diskgroup) that enables database Flash Backup and Recovery operations.  first introduced with Oracle 10g.  Related parameters:  db_recovery_file_dest  db_recovery_file_dest_size  db_flashback_retention_target www.yogijicreations.com
  • 47. Flashback Query ( 9i Feature)  Allows users to see a consistent view of the database as it was at a point in the past.  In Oracle 10g, we can now retrieve all versions of the rows that exist or ever existed between the time the query was issued and a point back in time. www.yogijicreations.com
  • 48. Flashback Database  Faster than traditional point-in-time recovery.  Traditional recovery method: Backups and Redo logs  Flashback Database is implemented using a new type of log file called the Flashback Database log.  Oracle database server periodically logs before images of data blocks in the Flashback Database logs.  The data block images are used to quickly back out changes to the database during Flashback Database.  RVWR: similar to the LGWR (log writer) process.  writes Flashback Database data to the Flashback Database logs. www.yogijicreations.com
  • 50. Enabling Flashback Database  Make sure the database is in archive mode.  Configure the recovery area by setting the two parameters:  DB_RECOVERY_FILE_DEST  DB_RECOVERY_FILE_DEST_SIZE  Open the database in MOUNT EXCLUSIVE mode and turn on the flashback feature: SQL> STARTUP MOUNT EXCLUSIVE; SQL> ALTER DATABASE FLASHBACK ON;  Set the Flashback Database retention target:  DB_FLASHBACK_RETENTION_TARGET www.yogijicreations.com
  • 51. Flashback Drop  DROP command permanently removed objects from the database…  In Oracle 10g, a DROP command places the object in the recycle bin.  You can restore the object from the recycle bin at any time.  Flashback table emp to before drop;  drop table emp PURGE; www.yogijicreations.com
  • 52. Recycle Bin  A recycle bin contains all the dropped database objects until,  Permanently drop them with the PURGE command.  Recover the dropped objects with the FLASHBACK TABLE command.  There is no room in the tablespace for new rows or updates to existing rows.  The tablespace needs to be extended. www.yogijicreations.com
  • 53. Flashback Table  Flashback Table allows you to recover a table or tables to a specific point in time without restoring a backup.  When you use the Flashback Table feature to restore a table to a specific point in time, all associated objects, such as, indexes, constraints, and triggers will be restored.  FLASHBACK TABLE emp TO SCN 76230; www.yogijicreations.com
  • 54. Flashback Transaction Query  It provides a way for you to view changes made to the database at the transaction level.  It allows you to diagnose problems in your database and perform analysis and audit transactions www.yogijicreations.com