SlideShare a Scribd company logo
Copyright © 2008, Oracle. All rights reserved.
Using RMAN to Perform Recovery
Copyright © 2008, Oracle. All rights reserved.
7 - 2
Objectives
After completing this lesson, you should be able to use RMAN
to:
• Perform complete recovery when a critical or noncritical data
file is lost
• Recover using incrementally updated backups
• Switch to image copies for fast recovery
• Restore a database onto a new host
• Recover using a backup control file
Copyright © 2008, Oracle. All rights reserved.
7 - 3
Using RMAN RESTORE and RECOVER Commands
• RESTORE command: Restores database files from backup
• RECOVER command: Recovers restored files by applying
changes recorded in the redo log files
RMAN> SQL 'ALTER TABLESPACE inv_tbs OFFLINE IMMEDIATE';
RMAN> RESTORE TABLESPACE inv_tbs;
RMAN> RECOVER TABLESPACE inv_tbs;
RMAN> SQL 'ALTER TABLESPACE inv_tbs ONLINE';
Copyright © 2008, Oracle. All rights reserved.
7 - 4
Performing Recovery Using Enterprise Manager
The Enterprise Manager Recovery Wizard creates and runs an
RMAN script to perform the recovery.
Copyright © 2008, Oracle. All rights reserved.
7 - 5
Performing Complete Recovery: Loss of a
Noncritical Data File in ARCHIVELOG Mode
If a data file is lost or corrupted, and that file does not belong to
the SYSTEM or UNDO tablespace, then restore and recover the
missing data file.
Copyright © 2008, Oracle. All rights reserved.
7 - 6
Performing Complete Recovery: Loss of a
System-Critical Data File in ARCHIVELOG Mode
If a data file is lost or corrupted, and that file belongs to the
SYSTEM or UNDO tablespace, then perform the following steps:
1. The instance may or may not shut down automatically. If it
does not, use SHUTDOWN ABORT to shut the instance
down.
2. Mount the database.
3. Restore and recover the missing data file.
4. Open the database.
Copyright © 2008, Oracle. All rights reserved.
7 - 7
Recovering Image Copies
RMAN can recover image copies by using incremental
backups:
• Image copies are updated with all changes up to the
incremental backup SCN.
• Incremental backup reduces the time required for media
recovery.
• There is no need to perform an image copy after the
incremental restoration.
Incremental
backup files
Image copy
of data file
RMAN> RECOVER COPY OF
2> DATAFILE {n|'file_name'}
Copyright © 2008, Oracle. All rights reserved.
7 - 8
Recovering Image Copies: Example
RMAN> recover copy of database with tag 'daily_inc';
RMAN> backup incremental level 1 for recover of copy
2> with tag 'daily_inc' database;
If you run these commands daily:
RECOVER BACKUP
Day 1 Nothing Create image copies
Day 2 Nothing Create incremental level 1
Day 3 and
onward
Recover copies based on
incremental
Create incremental level 1
This is the result:
Copyright © 2008, Oracle. All rights reserved.
7 - 10
Performing a Fast Switch to Image Copies
Perform fast recovery by
performing the following
steps:
1. Take data files offline.
2. Use the SWITCH TO ...
COPY command to switch to
image copies.
3. Recover data files.
4. Bring data files online.
Optionally, do the following
to put the files back into
their original location:
5. Create an image copy of
the data file in the original
location.
6. Take data files offline.
7.SWITCH TO ... COPY
8. Recover data files.
9. Bring data files online.
Now the data files are recovered
and usable in their new location.
SQL> SWITCH DATAFILE 'filename' TO COPY;
Copyright © 2008, Oracle. All rights reserved.
7 - 11
Using SET NEWNAME for Switching Files
For RUN blocks, you can use the SET NEWNAME command to
prepare for SWITCH commands.
RUN
{
ALLOCATE CHANNEL dev1 DEVICE TYPE DISK;
ALLOCATE CHANNEL dev2 DEVICE TYPE sbt;
SQL "ALTER TABLESPACE users OFFLINE IMMEDIATE";
SET NEWNAME FOR DATAFILE
'/disk1/oradata/prod/users01.dbf'
TO '/disk2/users01.dbf';
RESTORE TABLESPACE users;
SWITCH DATAFILE ALL;
RECOVER TABLESPACE users;
SQL "ALTER TABLESPACE users ONLINE";
}
Copyright © 2008, Oracle. All rights reserved.
7 - 12
Performing Restore and Recovery of a Database
in NOARCHIVELOG Mode
• If the database is in NOARCHIVELOG mode, and any data file
is lost, perform the following tasks:
– Shut down the instance if it is not already down.
– Restore the entire database, including all data and control
files, from the backup.
– Open the database.
• Users must reenter all changes made since the last backup.
Copyright © 2008, Oracle. All rights reserved.
7 - 13
Creating Restore Points
A restore point provides a name to a point in time:
• Now:
• Some time in the past:
SQL> CREATE RESTORE POINT before_mods;
SQL> CREATE RESTORE POINT end_q1 AS OF SCN 100;
Timeline
Copyright © 2008, Oracle. All rights reserved.
7 - 14
Performing Incomplete Recovery
Perform server-managed incomplete recovery by doing the
following:
1. Determine the target point of the restore: SCN, time,
restore point, or log sequence number.
2. Set the NLS environment variables appropriately.
3. Mount the database.
4. Prepare and run a RUN block, using the SET UNTIL,
RESTORE, and RECOVER commands.
5. Open the database in READONLY mode, and verify that
the recovery point is what you wanted.
6. Open the database using RESETLOGS.
Copyright © 2008, Oracle. All rights reserved.
7 - 16
Performing Recovery with a Backup Control File
• Restore and mount a backup control file when all copies of
the current control file are lost or damaged.
• Execute the RECOVER command after restoring the backup
control file.
• Open the database with the RESETLOGS option after
performing complete or point-in-time recovery.
Copyright © 2008, Oracle. All rights reserved.
7 - 17
Restoring the Server Parameter File from the
Control File Autobackup
Recovery
Manager
(RMAN) Flash Recovery
Area
Database
Server
parameter
file
RMAN> STARTUP FORCE NOMOUNT;
RMAN> RESTORE SPFILE FROM AUTOBACKUP;
RMAN> STARTUP FORCE;
Copyright © 2008, Oracle. All rights reserved.
7 - 18
Restoring the Control File from Autobackup
Recovery
Manager
(RMAN) Flash Recovery
Area
Database
Control
file
RMAN> STARTUP NOMOUNT;
RMAN> RESTORE CONTROLFILE FROM AUTOBACKUP;
RMAN> ALTER DATABASE MOUNT;
RMAN> RECOVER DATABASE;
RMAN> ALTER DATABASE OPEN RESETLOGS;
Copyright © 2008, Oracle. All rights reserved.
7 - 20
Using Incremental Backups to Recover a
Database in NOARCHIVELOG Mode
Use incremental backups to perform limited recovery of a
database in NOARCHIVELOG mode.
STARTUP FORCE NOMOUNT;
RESTORE CONTROLFILE;
ALTER DATABASE MOUNT;
RESTORE DATABASE;
RECOVER DATABASE NOREDO;
ALTER DATABASE OPEN RESETLOGS;
Copyright © 2008, Oracle. All rights reserved.
7 - 21
Restoring and Recovering the Database
on a New Host
Use the procedure to:
• Perform test restores
• Move a production database to a new host
Server
parameter file
Backups
Server
parameter file
RMAN>
Copyright © 2008, Oracle. All rights reserved.
7 - 22
Preparing to Restore the Database to a New Host
To prepare to restore a database, perform the following steps:
• Record the database identifier (DBID) of your source
database.
• Copy the source database initialization parameter file to the
new host.
• Ensure that source backups, including the control file
autobackup, are accessible on the restore host.
Copyright © 2008, Oracle. All rights reserved.
7 - 23
Restoring the Database to a New Host
Perform the following steps on the restore host to restore the
database:
1. Configure the ORACLE_SID environment variable.
2. Start RMAN and connect to the target instance in
NOCATALOG mode.
3. Set the database identifier (DBID).
4. Start the instance in NOMOUNT mode.
5. Restore the server parameter file from the backup sets.
6. Shut down the instance.
7. Edit the restored initialization parameter file.
8. Start the instance in NOMOUNT mode.
Copyright © 2008, Oracle. All rights reserved.
7 - 25
Restoring the Database to a New Host
9. Create a RUN block to:
– Restore the control file
– Mount the database
10.Create the RMAN recovery script to restore and recover
the database.
11.Execute the RMAN script.
12.Open the database with the RESETLOGS option.
Copyright © 2008, Oracle. All rights reserved.
7 - 27
Performing Disaster Recovery
• Disaster implies the loss of the entire target database, the
recovery catalog database, all current control files, all online
redo log files, and all parameter files.
• Disaster recovery includes the restoration and recovery of
the target database.
• Minimum required set of backups:
– Backups of data files
– Corresponding archived redo logs files
– At least one control file autobackup
Copyright © 2008, Oracle. All rights reserved.
7 - 28
Performing Disaster Recovery
Basic procedure:
• Restore an autobackup of the server parameter file.
• Start the target database instance.
• Restore the control file from autobackup.
• Mount the database.
• Restore the data files.
• Recover the data files.
• Open the database with the RESETLOGS option.
Copyright © 2008, Oracle. All rights reserved.
7 - 29
Summary
In this lesson, you should have learned how to use RMAN to do
the following:
• Perform complete recovery when a critical or noncritical data
file is lost
• Recover using incrementally updated backups
• Switch to image copies for fast recovery
• Restore a database onto a new host
• Recover using a backup control file
Copyright © 2008, Oracle. All rights reserved.
7 - 30
Practice 7 Overview:
Using RMAN to Perform Recovery
This practice covers the following topics:
• Recovering image copies
• Performing fast recovery

More Related Content

Similar to 5895640.ppt

Les 06 Perform Rec
Les 06 Perform RecLes 06 Perform Rec
Les 06 Perform Rec
vivaankumar
 
What’s new in oracle 12c recovery manager (rman)
What’s new in oracle 12c recovery manager (rman)What’s new in oracle 12c recovery manager (rman)
What’s new in oracle 12c recovery manager (rman)
Satishbabu Gunukula
 
Les 03 catalog
Les 03 catalogLes 03 catalog
Les 03 catalog
Femi Adeyemi
 
Les 02 config
Les 02 configLes 02 config
Les 02 config
Femi Adeyemi
 
2011 384 hackworth_ppt
2011 384 hackworth_ppt2011 384 hackworth_ppt
2011 384 hackworth_ppt
maclean liu
 
Oracle backup and recovery
Oracle backup and recoveryOracle backup and recovery
Oracle backup and recovery
Yogiji Creations
 
Rman 12c new_features
Rman 12c new_featuresRman 12c new_features
Rman 12c new_features
Nabi Abdul
 
Oow14 con7681-rman-1
Oow14 con7681-rman-1Oow14 con7681-rman-1
Oow14 con7681-rman-1
Dan Glasscock
 
Backups And Recovery
Backups And RecoveryBackups And Recovery
Backups And Recovery
asifmalik110
 
Backup and Recovery
Backup and RecoveryBackup and Recovery
Backup and Recovery
Anar Godjaev
 
Les 02 Config Rec
Les 02 Config RecLes 02 Config Rec
Les 02 Config Rec
vivaankumar
 
Refresh development from productions
Refresh development from productionsRefresh development from productions
Refresh development from productions
Osama Mustafa
 
Data Guard New Features
Data Guard New FeaturesData Guard New Features
Data Guard New Features
xiangrong
 
[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery
altistory
 
Backup and recovery in oracle
Backup and recovery in oracleBackup and recovery in oracle
Backup and recovery in oracle
sadegh salehi
 
oracle upgradation
oracle upgradationoracle upgradation
oracle upgradation
influxbob
 
15362590.ppt
15362590.ppt15362590.ppt
15362590.ppt
hesham alataby
 
Physical_Standby_Database_R12.2.4
Physical_Standby_Database_R12.2.4Physical_Standby_Database_R12.2.4
Physical_Standby_Database_R12.2.4
mohammed shahnawaz ahmed
 
B35 all you wanna know about rman by francisco alvarez
B35 all you wanna know about rman by francisco alvarezB35 all you wanna know about rman by francisco alvarez
B35 all you wanna know about rman by francisco alvarez
Insight Technology, Inc.
 
Creating a physical standby database 11g on windows
Creating a physical standby database 11g on windowsCreating a physical standby database 11g on windows
Creating a physical standby database 11g on windows
Roo Wall
 

Similar to 5895640.ppt (20)

Les 06 Perform Rec
Les 06 Perform RecLes 06 Perform Rec
Les 06 Perform Rec
 
What’s new in oracle 12c recovery manager (rman)
What’s new in oracle 12c recovery manager (rman)What’s new in oracle 12c recovery manager (rman)
What’s new in oracle 12c recovery manager (rman)
 
Les 03 catalog
Les 03 catalogLes 03 catalog
Les 03 catalog
 
Les 02 config
Les 02 configLes 02 config
Les 02 config
 
2011 384 hackworth_ppt
2011 384 hackworth_ppt2011 384 hackworth_ppt
2011 384 hackworth_ppt
 
Oracle backup and recovery
Oracle backup and recoveryOracle backup and recovery
Oracle backup and recovery
 
Rman 12c new_features
Rman 12c new_featuresRman 12c new_features
Rman 12c new_features
 
Oow14 con7681-rman-1
Oow14 con7681-rman-1Oow14 con7681-rman-1
Oow14 con7681-rman-1
 
Backups And Recovery
Backups And RecoveryBackups And Recovery
Backups And Recovery
 
Backup and Recovery
Backup and RecoveryBackup and Recovery
Backup and Recovery
 
Les 02 Config Rec
Les 02 Config RecLes 02 Config Rec
Les 02 Config Rec
 
Refresh development from productions
Refresh development from productionsRefresh development from productions
Refresh development from productions
 
Data Guard New Features
Data Guard New FeaturesData Guard New Features
Data Guard New Features
 
[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery
 
Backup and recovery in oracle
Backup and recovery in oracleBackup and recovery in oracle
Backup and recovery in oracle
 
oracle upgradation
oracle upgradationoracle upgradation
oracle upgradation
 
15362590.ppt
15362590.ppt15362590.ppt
15362590.ppt
 
Physical_Standby_Database_R12.2.4
Physical_Standby_Database_R12.2.4Physical_Standby_Database_R12.2.4
Physical_Standby_Database_R12.2.4
 
B35 all you wanna know about rman by francisco alvarez
B35 all you wanna know about rman by francisco alvarezB35 all you wanna know about rman by francisco alvarez
B35 all you wanna know about rman by francisco alvarez
 
Creating a physical standby database 11g on windows
Creating a physical standby database 11g on windowsCreating a physical standby database 11g on windows
Creating a physical standby database 11g on windows
 

More from hesham alataby

HyperLinks.ppt
HyperLinks.pptHyperLinks.ppt
HyperLinks.ppt
hesham alataby
 
TextTags.2.ppt
TextTags.2.pptTextTags.2.ppt
TextTags.2.ppt
hesham alataby
 
fdocuments.in_the-model-clause-explained (1).pptx
fdocuments.in_the-model-clause-explained (1).pptxfdocuments.in_the-model-clause-explained (1).pptx
fdocuments.in_the-model-clause-explained (1).pptx
hesham alataby
 
7035416.ppt
7035416.ppt7035416.ppt
7035416.ppt
hesham alataby
 
4714649_2.ppt
4714649_2.ppt4714649_2.ppt
4714649_2.ppt
hesham alataby
 
4714649.ppt
4714649.ppt4714649.ppt
4714649.ppt
hesham alataby
 

More from hesham alataby (10)

Frames.ppt
Frames.pptFrames.ppt
Frames.ppt
 
HyperLinks.ppt
HyperLinks.pptHyperLinks.ppt
HyperLinks.ppt
 
Images_Amended.ppt
Images_Amended.pptImages_Amended.ppt
Images_Amended.ppt
 
Tables.ppt
Tables.pptTables.ppt
Tables.ppt
 
TextTags.1.ppt
TextTags.1.pptTextTags.1.ppt
TextTags.1.ppt
 
TextTags.2.ppt
TextTags.2.pptTextTags.2.ppt
TextTags.2.ppt
 
fdocuments.in_the-model-clause-explained (1).pptx
fdocuments.in_the-model-clause-explained (1).pptxfdocuments.in_the-model-clause-explained (1).pptx
fdocuments.in_the-model-clause-explained (1).pptx
 
7035416.ppt
7035416.ppt7035416.ppt
7035416.ppt
 
4714649_2.ppt
4714649_2.ppt4714649_2.ppt
4714649_2.ppt
 
4714649.ppt
4714649.ppt4714649.ppt
4714649.ppt
 

Recently uploaded

Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
co23btech11018
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
abbyasa1014
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
IJNSA Journal
 
New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
wisnuprabawa3
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
camseq
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
IJECEIAES
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.pptUnit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
KrishnaveniKrishnara1
 
Textile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdfTextile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdf
NazakatAliKhoso2
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have oneISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
Las Vegas Warehouse
 
Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...
bijceesjournal
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
gerogepatton
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
University of Maribor
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
NidhalKahouli2
 
Recycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part IIRecycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part II
Aditya Rajan Patra
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
Yasser Mahgoub
 

Recently uploaded (20)

Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
 
New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.pptUnit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
 
Textile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdfTextile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdf
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have oneISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
 
Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
 
Recycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part IIRecycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part II
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
 

5895640.ppt

  • 1. Copyright © 2008, Oracle. All rights reserved. Using RMAN to Perform Recovery
  • 2. Copyright © 2008, Oracle. All rights reserved. 7 - 2 Objectives After completing this lesson, you should be able to use RMAN to: • Perform complete recovery when a critical or noncritical data file is lost • Recover using incrementally updated backups • Switch to image copies for fast recovery • Restore a database onto a new host • Recover using a backup control file
  • 3. Copyright © 2008, Oracle. All rights reserved. 7 - 3 Using RMAN RESTORE and RECOVER Commands • RESTORE command: Restores database files from backup • RECOVER command: Recovers restored files by applying changes recorded in the redo log files RMAN> SQL 'ALTER TABLESPACE inv_tbs OFFLINE IMMEDIATE'; RMAN> RESTORE TABLESPACE inv_tbs; RMAN> RECOVER TABLESPACE inv_tbs; RMAN> SQL 'ALTER TABLESPACE inv_tbs ONLINE';
  • 4. Copyright © 2008, Oracle. All rights reserved. 7 - 4 Performing Recovery Using Enterprise Manager The Enterprise Manager Recovery Wizard creates and runs an RMAN script to perform the recovery.
  • 5. Copyright © 2008, Oracle. All rights reserved. 7 - 5 Performing Complete Recovery: Loss of a Noncritical Data File in ARCHIVELOG Mode If a data file is lost or corrupted, and that file does not belong to the SYSTEM or UNDO tablespace, then restore and recover the missing data file.
  • 6. Copyright © 2008, Oracle. All rights reserved. 7 - 6 Performing Complete Recovery: Loss of a System-Critical Data File in ARCHIVELOG Mode If a data file is lost or corrupted, and that file belongs to the SYSTEM or UNDO tablespace, then perform the following steps: 1. The instance may or may not shut down automatically. If it does not, use SHUTDOWN ABORT to shut the instance down. 2. Mount the database. 3. Restore and recover the missing data file. 4. Open the database.
  • 7. Copyright © 2008, Oracle. All rights reserved. 7 - 7 Recovering Image Copies RMAN can recover image copies by using incremental backups: • Image copies are updated with all changes up to the incremental backup SCN. • Incremental backup reduces the time required for media recovery. • There is no need to perform an image copy after the incremental restoration. Incremental backup files Image copy of data file RMAN> RECOVER COPY OF 2> DATAFILE {n|'file_name'}
  • 8. Copyright © 2008, Oracle. All rights reserved. 7 - 8 Recovering Image Copies: Example RMAN> recover copy of database with tag 'daily_inc'; RMAN> backup incremental level 1 for recover of copy 2> with tag 'daily_inc' database; If you run these commands daily: RECOVER BACKUP Day 1 Nothing Create image copies Day 2 Nothing Create incremental level 1 Day 3 and onward Recover copies based on incremental Create incremental level 1 This is the result:
  • 9. Copyright © 2008, Oracle. All rights reserved. 7 - 10 Performing a Fast Switch to Image Copies Perform fast recovery by performing the following steps: 1. Take data files offline. 2. Use the SWITCH TO ... COPY command to switch to image copies. 3. Recover data files. 4. Bring data files online. Optionally, do the following to put the files back into their original location: 5. Create an image copy of the data file in the original location. 6. Take data files offline. 7.SWITCH TO ... COPY 8. Recover data files. 9. Bring data files online. Now the data files are recovered and usable in their new location. SQL> SWITCH DATAFILE 'filename' TO COPY;
  • 10. Copyright © 2008, Oracle. All rights reserved. 7 - 11 Using SET NEWNAME for Switching Files For RUN blocks, you can use the SET NEWNAME command to prepare for SWITCH commands. RUN { ALLOCATE CHANNEL dev1 DEVICE TYPE DISK; ALLOCATE CHANNEL dev2 DEVICE TYPE sbt; SQL "ALTER TABLESPACE users OFFLINE IMMEDIATE"; SET NEWNAME FOR DATAFILE '/disk1/oradata/prod/users01.dbf' TO '/disk2/users01.dbf'; RESTORE TABLESPACE users; SWITCH DATAFILE ALL; RECOVER TABLESPACE users; SQL "ALTER TABLESPACE users ONLINE"; }
  • 11. Copyright © 2008, Oracle. All rights reserved. 7 - 12 Performing Restore and Recovery of a Database in NOARCHIVELOG Mode • If the database is in NOARCHIVELOG mode, and any data file is lost, perform the following tasks: – Shut down the instance if it is not already down. – Restore the entire database, including all data and control files, from the backup. – Open the database. • Users must reenter all changes made since the last backup.
  • 12. Copyright © 2008, Oracle. All rights reserved. 7 - 13 Creating Restore Points A restore point provides a name to a point in time: • Now: • Some time in the past: SQL> CREATE RESTORE POINT before_mods; SQL> CREATE RESTORE POINT end_q1 AS OF SCN 100; Timeline
  • 13. Copyright © 2008, Oracle. All rights reserved. 7 - 14 Performing Incomplete Recovery Perform server-managed incomplete recovery by doing the following: 1. Determine the target point of the restore: SCN, time, restore point, or log sequence number. 2. Set the NLS environment variables appropriately. 3. Mount the database. 4. Prepare and run a RUN block, using the SET UNTIL, RESTORE, and RECOVER commands. 5. Open the database in READONLY mode, and verify that the recovery point is what you wanted. 6. Open the database using RESETLOGS.
  • 14. Copyright © 2008, Oracle. All rights reserved. 7 - 16 Performing Recovery with a Backup Control File • Restore and mount a backup control file when all copies of the current control file are lost or damaged. • Execute the RECOVER command after restoring the backup control file. • Open the database with the RESETLOGS option after performing complete or point-in-time recovery.
  • 15. Copyright © 2008, Oracle. All rights reserved. 7 - 17 Restoring the Server Parameter File from the Control File Autobackup Recovery Manager (RMAN) Flash Recovery Area Database Server parameter file RMAN> STARTUP FORCE NOMOUNT; RMAN> RESTORE SPFILE FROM AUTOBACKUP; RMAN> STARTUP FORCE;
  • 16. Copyright © 2008, Oracle. All rights reserved. 7 - 18 Restoring the Control File from Autobackup Recovery Manager (RMAN) Flash Recovery Area Database Control file RMAN> STARTUP NOMOUNT; RMAN> RESTORE CONTROLFILE FROM AUTOBACKUP; RMAN> ALTER DATABASE MOUNT; RMAN> RECOVER DATABASE; RMAN> ALTER DATABASE OPEN RESETLOGS;
  • 17. Copyright © 2008, Oracle. All rights reserved. 7 - 20 Using Incremental Backups to Recover a Database in NOARCHIVELOG Mode Use incremental backups to perform limited recovery of a database in NOARCHIVELOG mode. STARTUP FORCE NOMOUNT; RESTORE CONTROLFILE; ALTER DATABASE MOUNT; RESTORE DATABASE; RECOVER DATABASE NOREDO; ALTER DATABASE OPEN RESETLOGS;
  • 18. Copyright © 2008, Oracle. All rights reserved. 7 - 21 Restoring and Recovering the Database on a New Host Use the procedure to: • Perform test restores • Move a production database to a new host Server parameter file Backups Server parameter file RMAN>
  • 19. Copyright © 2008, Oracle. All rights reserved. 7 - 22 Preparing to Restore the Database to a New Host To prepare to restore a database, perform the following steps: • Record the database identifier (DBID) of your source database. • Copy the source database initialization parameter file to the new host. • Ensure that source backups, including the control file autobackup, are accessible on the restore host.
  • 20. Copyright © 2008, Oracle. All rights reserved. 7 - 23 Restoring the Database to a New Host Perform the following steps on the restore host to restore the database: 1. Configure the ORACLE_SID environment variable. 2. Start RMAN and connect to the target instance in NOCATALOG mode. 3. Set the database identifier (DBID). 4. Start the instance in NOMOUNT mode. 5. Restore the server parameter file from the backup sets. 6. Shut down the instance. 7. Edit the restored initialization parameter file. 8. Start the instance in NOMOUNT mode.
  • 21. Copyright © 2008, Oracle. All rights reserved. 7 - 25 Restoring the Database to a New Host 9. Create a RUN block to: – Restore the control file – Mount the database 10.Create the RMAN recovery script to restore and recover the database. 11.Execute the RMAN script. 12.Open the database with the RESETLOGS option.
  • 22. Copyright © 2008, Oracle. All rights reserved. 7 - 27 Performing Disaster Recovery • Disaster implies the loss of the entire target database, the recovery catalog database, all current control files, all online redo log files, and all parameter files. • Disaster recovery includes the restoration and recovery of the target database. • Minimum required set of backups: – Backups of data files – Corresponding archived redo logs files – At least one control file autobackup
  • 23. Copyright © 2008, Oracle. All rights reserved. 7 - 28 Performing Disaster Recovery Basic procedure: • Restore an autobackup of the server parameter file. • Start the target database instance. • Restore the control file from autobackup. • Mount the database. • Restore the data files. • Recover the data files. • Open the database with the RESETLOGS option.
  • 24. Copyright © 2008, Oracle. All rights reserved. 7 - 29 Summary In this lesson, you should have learned how to use RMAN to do the following: • Perform complete recovery when a critical or noncritical data file is lost • Recover using incrementally updated backups • Switch to image copies for fast recovery • Restore a database onto a new host • Recover using a backup control file
  • 25. Copyright © 2008, Oracle. All rights reserved. 7 - 30 Practice 7 Overview: Using RMAN to Perform Recovery This practice covers the following topics: • Recovering image copies • Performing fast recovery