SlideShare a Scribd company logo
Backup & Recovery
Backup and recovery procedures protect your database against data loss and reconstruct the data,
should loss occur. The reconstructing of data is achieved through media recovery, which refers to the
various operations involved in restoring, rolling forward, and rolling back a backup of database files.
A backup is a copy of data. This copy can include important parts of the database, such as the control file
and datafiles. A backup is a safeguard against unexpected data loss and application errors. If you lose
the original data, then you can reconstruct it by using a backup.
Backups are divided into physical backups and logical backups.
Physical backups, which are the primary concern in a backup and recovery strategy, are copies of
physical database files. You can make physical backups with either the Recovery Manager (RMAN) Utility
or operating system utilities.
In contrast, logical backups contain logical data (for example, tables and stored procedures) extracted
with an oracle utility and stored in a binary file. You can use logical backups to supplement physical
backups.
There are two ways to perform Oracle backup and recovery: Recovery Manager and user managed
backup and recovery.
1.Offline backup
2.Online backup
3.logical backup
4.RMAN.
1:Offline backup:
To take offline backup we need to shutdown the database before taking backup. Before we shutdown,
we must know about the location of files to be copied.
Though only datafiles are to be backed up, we can also backup controlfile and redolog files in offline
backup.
Follow the steps below to take offline backup:
Sql>spool backup.sql
Sql>select ‘host cp –v ‘||file_name||’ /path/backup’ from dba_data_files union
Select ‘host cp –v ‘||name||’ /path/backup’ from v$controlfile union
Select ‘host cp –v ‘||member||’ /path/backup’ from v$logfile;
Sql>spool off
Sql>shutdown immediate;
Sql>@backup.sql
Sql>startup
The above steps will copy all datafiles, control files and redo log files to /path/backup.
2. Online backup:
It may be hard to find the time to shutdown the instance and copy the files, in such situations you may
take online backup.
Follow the steps below to take online backup:
Sql>spool obackup.sql
Sql>select ‘host cp –v ‘||file_name||’ /path/backup’ from dba_data_files;
Sql>spool off
Sql>alter database begin backup; (database should be in archive log mode.)
Sql>select file#, status from v$backup;
Sql>@obackup.sql
Sql>alter database end backup;
Sql>alter database backup controlfile to ‘/path/backup/control.ctl.bkp’;
Ad

More Related Content

What's hot (20)

Backup And Recovery
Backup And RecoveryBackup And Recovery
Backup And Recovery
raghu_designer
 
Oracle Database Backup
Oracle Database BackupOracle Database Backup
Oracle Database Backup
Handy_Backup
 
SQL Server Database Backup and Restore Plan
SQL Server Database Backup and Restore PlanSQL Server Database Backup and Restore Plan
SQL Server Database Backup and Restore Plan
Hamid J. Fard
 
Oracle apps 11i file system
Oracle apps 11i   file systemOracle apps 11i   file system
Oracle apps 11i file system
Deepti Singh
 
Oracle Tablespace - Basic
Oracle Tablespace - BasicOracle Tablespace - Basic
Oracle Tablespace - Basic
Eryk Budi Pratama
 
576 oracle-dba-interview-questions
576 oracle-dba-interview-questions576 oracle-dba-interview-questions
576 oracle-dba-interview-questions
Naveen P
 
DBA 3 year Interview Questions
DBA 3 year Interview QuestionsDBA 3 year Interview Questions
DBA 3 year Interview Questions
Naveen P
 
Introduction to oracle(2)
Introduction to oracle(2)Introduction to oracle(2)
Introduction to oracle(2)
Sumit Tambe
 
Oracle architecture
Oracle architectureOracle architecture
Oracle architecture
Soumya Das
 
21
2121
21
hanumanthareddy
 
Recovery Techniques and Need of Recovery
Recovery Techniques and   Need of RecoveryRecovery Techniques and   Need of Recovery
Recovery Techniques and Need of Recovery
Pooja Dixit
 
Oracle architecture
Oracle architectureOracle architecture
Oracle architecture
Sandeep Kamath
 
Data Backup (IT) Lecture Slide # 5
Data Backup (IT) Lecture Slide # 5Data Backup (IT) Lecture Slide # 5
Data Backup (IT) Lecture Slide # 5
Muhammad Talha Zaroon
 
All Oracle-dba-interview-questions
All Oracle-dba-interview-questionsAll Oracle-dba-interview-questions
All Oracle-dba-interview-questions
Naveen P
 
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
 
DataGuard - Oracle's Time Machine
DataGuard - Oracle's Time MachineDataGuard - Oracle's Time Machine
DataGuard - Oracle's Time Machine
Navneet Upneja
 
Presentation on backup and recoveryyyyyyyyyyyyy
Presentation on backup and recoveryyyyyyyyyyyyyPresentation on backup and recoveryyyyyyyyyyyyy
Presentation on backup and recoveryyyyyyyyyyyyy
Tehmina Gulfam
 
12. oracle database architecture
12. oracle database architecture12. oracle database architecture
12. oracle database architecture
Amrit Kaur
 
Less03 D B D B C A
Less03  D B  D B C ALess03  D B  D B C A
Less03 D B D B C A
vivaankumar
 
The oracle database architecture
The oracle database architectureThe oracle database architecture
The oracle database architecture
Akash Pramanik
 
Oracle Database Backup
Oracle Database BackupOracle Database Backup
Oracle Database Backup
Handy_Backup
 
SQL Server Database Backup and Restore Plan
SQL Server Database Backup and Restore PlanSQL Server Database Backup and Restore Plan
SQL Server Database Backup and Restore Plan
Hamid J. Fard
 
Oracle apps 11i file system
Oracle apps 11i   file systemOracle apps 11i   file system
Oracle apps 11i file system
Deepti Singh
 
576 oracle-dba-interview-questions
576 oracle-dba-interview-questions576 oracle-dba-interview-questions
576 oracle-dba-interview-questions
Naveen P
 
DBA 3 year Interview Questions
DBA 3 year Interview QuestionsDBA 3 year Interview Questions
DBA 3 year Interview Questions
Naveen P
 
Introduction to oracle(2)
Introduction to oracle(2)Introduction to oracle(2)
Introduction to oracle(2)
Sumit Tambe
 
Oracle architecture
Oracle architectureOracle architecture
Oracle architecture
Soumya Das
 
Recovery Techniques and Need of Recovery
Recovery Techniques and   Need of RecoveryRecovery Techniques and   Need of Recovery
Recovery Techniques and Need of Recovery
Pooja Dixit
 
All Oracle-dba-interview-questions
All Oracle-dba-interview-questionsAll Oracle-dba-interview-questions
All Oracle-dba-interview-questions
Naveen P
 
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
 
DataGuard - Oracle's Time Machine
DataGuard - Oracle's Time MachineDataGuard - Oracle's Time Machine
DataGuard - Oracle's Time Machine
Navneet Upneja
 
Presentation on backup and recoveryyyyyyyyyyyyy
Presentation on backup and recoveryyyyyyyyyyyyyPresentation on backup and recoveryyyyyyyyyyyyy
Presentation on backup and recoveryyyyyyyyyyyyy
Tehmina Gulfam
 
12. oracle database architecture
12. oracle database architecture12. oracle database architecture
12. oracle database architecture
Amrit Kaur
 
Less03 D B D B C A
Less03  D B  D B C ALess03  D B  D B C A
Less03 D B D B C A
vivaankumar
 
The oracle database architecture
The oracle database architectureThe oracle database architecture
The oracle database architecture
Akash Pramanik
 

Viewers also liked (8)

Basic commands
Basic commandsBasic commands
Basic commands
Vinay Thota
 
Curso basicoseguridadweb slideshare9
Curso basicoseguridadweb slideshare9Curso basicoseguridadweb slideshare9
Curso basicoseguridadweb slideshare9
tantascosasquenose
 
Startupandshutdown
StartupandshutdownStartupandshutdown
Startupandshutdown
Vinay Thota
 
Tablespaces
TablespacesTablespaces
Tablespaces
Vinay Thota
 
Introduction to sql server
Introduction to sql serverIntroduction to sql server
Introduction to sql server
Vinay Thota
 
Controlfilemanagement
ControlfilemanagementControlfilemanagement
Controlfilemanagement
Vinay Thota
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
Luminary Labs
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
LinkedIn
 
Curso basicoseguridadweb slideshare9
Curso basicoseguridadweb slideshare9Curso basicoseguridadweb slideshare9
Curso basicoseguridadweb slideshare9
tantascosasquenose
 
Startupandshutdown
StartupandshutdownStartupandshutdown
Startupandshutdown
Vinay Thota
 
Introduction to sql server
Introduction to sql serverIntroduction to sql server
Introduction to sql server
Vinay Thota
 
Controlfilemanagement
ControlfilemanagementControlfilemanagement
Controlfilemanagement
Vinay Thota
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
Luminary Labs
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
LinkedIn
 
Ad

Similar to Backup&recovery (20)

Oracle ocp backup exam
Oracle ocp backup examOracle ocp backup exam
Oracle ocp backup exam
sriram raj
 
Oracle OCP Backup Exam
Oracle OCP Backup ExamOracle OCP Backup Exam
Oracle OCP Backup Exam
Inprise Group
 
Backup and Recovery Procedure
Backup and Recovery ProcedureBackup and Recovery Procedure
Backup and Recovery Procedure
Anar Godjaev
 
Less15 Backups
Less15 BackupsLess15 Backups
Less15 Backups
vivaankumar
 
Backups And Recovery
Backups And RecoveryBackups And Recovery
Backups And Recovery
asifmalik110
 
Oracle backup and recovery
Oracle backup and recoveryOracle backup and recovery
Oracle backup and recovery
Yogiji Creations
 
Les 06 Perform Rec
Les 06 Perform RecLes 06 Perform Rec
Les 06 Perform Rec
vivaankumar
 
Xpp c user_rec
Xpp c user_recXpp c user_rec
Xpp c user_rec
Femi Adeyemi
 
Backup-Recovery in PostgreSQL
Backup-Recovery in PostgreSQLBackup-Recovery in PostgreSQL
Backup-Recovery in PostgreSQL
Ashnik Pte Ltd
 
Les 06 rec
Les 06 recLes 06 rec
Les 06 rec
Femi Adeyemi
 
BACKUP & RECOVERY IN DBMS
BACKUP & RECOVERY IN DBMSBACKUP & RECOVERY IN DBMS
BACKUP & RECOVERY IN DBMS
BaivabiNayak
 
Less14 Br Concepts
Less14 Br ConceptsLess14 Br Concepts
Less14 Br Concepts
vivaankumar
 
Chapter12 Managing And Implementing Backups And Disaster Recovery
Chapter12     Managing And Implementing Backups And Disaster RecoveryChapter12     Managing And Implementing Backups And Disaster Recovery
Chapter12 Managing And Implementing Backups And Disaster Recovery
Raja Waseem Akhtar
 
Data backup and disaster recovery
Data backup and disaster recoveryData backup and disaster recovery
Data backup and disaster recovery
catacutanjcsantos
 
IMSDB - DBRC
IMSDB - DBRCIMSDB - DBRC
IMSDB - DBRC
Srinimf-Slides
 
Backup and recovery in oracle
Backup and recovery in oracleBackup and recovery in oracle
Backup and recovery in oracle
sadegh salehi
 
Collaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mysteryCollaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mystery
Nelson Calero
 
Les 05 Create Bu
Les 05 Create BuLes 05 Create Bu
Les 05 Create Bu
vivaankumar
 
1 ISACA JOURNAL VOLUME 1, 2012FeatureThe ability to r.docx
1 ISACA JOURNAL  VOLUME 1, 2012FeatureThe ability to r.docx1 ISACA JOURNAL  VOLUME 1, 2012FeatureThe ability to r.docx
1 ISACA JOURNAL VOLUME 1, 2012FeatureThe ability to r.docx
honey725342
 
Dataguard presentation
Dataguard presentationDataguard presentation
Dataguard presentation
Vimlendu Kumar
 
Oracle ocp backup exam
Oracle ocp backup examOracle ocp backup exam
Oracle ocp backup exam
sriram raj
 
Oracle OCP Backup Exam
Oracle OCP Backup ExamOracle OCP Backup Exam
Oracle OCP Backup Exam
Inprise Group
 
Backup and Recovery Procedure
Backup and Recovery ProcedureBackup and Recovery Procedure
Backup and Recovery Procedure
Anar Godjaev
 
Backups And Recovery
Backups And RecoveryBackups And Recovery
Backups And Recovery
asifmalik110
 
Oracle backup and recovery
Oracle backup and recoveryOracle backup and recovery
Oracle backup and recovery
Yogiji Creations
 
Les 06 Perform Rec
Les 06 Perform RecLes 06 Perform Rec
Les 06 Perform Rec
vivaankumar
 
Backup-Recovery in PostgreSQL
Backup-Recovery in PostgreSQLBackup-Recovery in PostgreSQL
Backup-Recovery in PostgreSQL
Ashnik Pte Ltd
 
BACKUP & RECOVERY IN DBMS
BACKUP & RECOVERY IN DBMSBACKUP & RECOVERY IN DBMS
BACKUP & RECOVERY IN DBMS
BaivabiNayak
 
Less14 Br Concepts
Less14 Br ConceptsLess14 Br Concepts
Less14 Br Concepts
vivaankumar
 
Chapter12 Managing And Implementing Backups And Disaster Recovery
Chapter12     Managing And Implementing Backups And Disaster RecoveryChapter12     Managing And Implementing Backups And Disaster Recovery
Chapter12 Managing And Implementing Backups And Disaster Recovery
Raja Waseem Akhtar
 
Data backup and disaster recovery
Data backup and disaster recoveryData backup and disaster recovery
Data backup and disaster recovery
catacutanjcsantos
 
Backup and recovery in oracle
Backup and recovery in oracleBackup and recovery in oracle
Backup and recovery in oracle
sadegh salehi
 
Collaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mysteryCollaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mystery
Nelson Calero
 
Les 05 Create Bu
Les 05 Create BuLes 05 Create Bu
Les 05 Create Bu
vivaankumar
 
1 ISACA JOURNAL VOLUME 1, 2012FeatureThe ability to r.docx
1 ISACA JOURNAL  VOLUME 1, 2012FeatureThe ability to r.docx1 ISACA JOURNAL  VOLUME 1, 2012FeatureThe ability to r.docx
1 ISACA JOURNAL VOLUME 1, 2012FeatureThe ability to r.docx
honey725342
 
Dataguard presentation
Dataguard presentationDataguard presentation
Dataguard presentation
Vimlendu Kumar
 
Ad

Backup&recovery

  • 1. Backup & Recovery Backup and recovery procedures protect your database against data loss and reconstruct the data, should loss occur. The reconstructing of data is achieved through media recovery, which refers to the various operations involved in restoring, rolling forward, and rolling back a backup of database files. A backup is a copy of data. This copy can include important parts of the database, such as the control file and datafiles. A backup is a safeguard against unexpected data loss and application errors. If you lose the original data, then you can reconstruct it by using a backup. Backups are divided into physical backups and logical backups. Physical backups, which are the primary concern in a backup and recovery strategy, are copies of physical database files. You can make physical backups with either the Recovery Manager (RMAN) Utility or operating system utilities. In contrast, logical backups contain logical data (for example, tables and stored procedures) extracted with an oracle utility and stored in a binary file. You can use logical backups to supplement physical backups. There are two ways to perform Oracle backup and recovery: Recovery Manager and user managed backup and recovery. 1.Offline backup 2.Online backup 3.logical backup 4.RMAN. 1:Offline backup: To take offline backup we need to shutdown the database before taking backup. Before we shutdown, we must know about the location of files to be copied. Though only datafiles are to be backed up, we can also backup controlfile and redolog files in offline backup. Follow the steps below to take offline backup: Sql>spool backup.sql Sql>select ‘host cp –v ‘||file_name||’ /path/backup’ from dba_data_files union Select ‘host cp –v ‘||name||’ /path/backup’ from v$controlfile union
  • 2. Select ‘host cp –v ‘||member||’ /path/backup’ from v$logfile; Sql>spool off Sql>shutdown immediate; Sql>@backup.sql Sql>startup The above steps will copy all datafiles, control files and redo log files to /path/backup. 2. Online backup: It may be hard to find the time to shutdown the instance and copy the files, in such situations you may take online backup. Follow the steps below to take online backup: Sql>spool obackup.sql Sql>select ‘host cp –v ‘||file_name||’ /path/backup’ from dba_data_files; Sql>spool off Sql>alter database begin backup; (database should be in archive log mode.) Sql>select file#, status from v$backup; Sql>@obackup.sql Sql>alter database end backup; Sql>alter database backup controlfile to ‘/path/backup/control.ctl.bkp’;