SlideShare a Scribd company logo
1 of 2
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’;

More Related Content

What's hot

Oracle Database Backup
Oracle Database BackupOracle Database Backup
Oracle Database BackupHandy_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 PlanHamid J. Fard
 
Oracle apps 11i file system
Oracle apps 11i   file systemOracle apps 11i   file system
Oracle apps 11i file systemDeepti Singh
 
576 oracle-dba-interview-questions
576 oracle-dba-interview-questions576 oracle-dba-interview-questions
576 oracle-dba-interview-questionsNaveen P
 
DBA 3 year Interview Questions
DBA 3 year Interview QuestionsDBA 3 year Interview Questions
DBA 3 year Interview QuestionsNaveen 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 architectureSoumya Das
 
Recovery Techniques and Need of Recovery
Recovery Techniques and   Need of RecoveryRecovery Techniques and   Need of Recovery
Recovery Techniques and Need of RecoveryPooja Dixit
 
All Oracle-dba-interview-questions
All Oracle-dba-interview-questionsAll Oracle-dba-interview-questions
All Oracle-dba-interview-questionsNaveen P
 
Oracle database hot backup and recovery
Oracle database hot backup and recoveryOracle database hot backup and recovery
Oracle database hot backup and recoveryArun Sharma
 
DataGuard - Oracle's Time Machine
DataGuard - Oracle's Time MachineDataGuard - Oracle's Time Machine
DataGuard - Oracle's Time MachineNavneet Upneja
 
Presentation on backup and recoveryyyyyyyyyyyyy
Presentation on backup and recoveryyyyyyyyyyyyyPresentation on backup and recoveryyyyyyyyyyyyy
Presentation on backup and recoveryyyyyyyyyyyyyTehmina Gulfam
 
12. oracle database architecture
12. oracle database architecture12. oracle database architecture
12. oracle database architectureAmrit 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 Avivaankumar
 
The oracle database architecture
The oracle database architectureThe oracle database architecture
The oracle database architectureAkash Pramanik
 

What's hot (20)

Backup And Recovery
Backup And RecoveryBackup And Recovery
Backup And Recovery
 
Oracle Database Backup
Oracle Database BackupOracle Database Backup
Oracle Database 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
 
Oracle apps 11i file system
Oracle apps 11i   file systemOracle apps 11i   file system
Oracle apps 11i file system
 
Oracle Tablespace - Basic
Oracle Tablespace - BasicOracle Tablespace - Basic
Oracle Tablespace - Basic
 
576 oracle-dba-interview-questions
576 oracle-dba-interview-questions576 oracle-dba-interview-questions
576 oracle-dba-interview-questions
 
DBA 3 year Interview Questions
DBA 3 year Interview QuestionsDBA 3 year Interview Questions
DBA 3 year Interview Questions
 
Introduction to oracle(2)
Introduction to oracle(2)Introduction to oracle(2)
Introduction to oracle(2)
 
Oracle architecture
Oracle architectureOracle architecture
Oracle architecture
 
21
2121
21
 
Recovery Techniques and Need of Recovery
Recovery Techniques and   Need of RecoveryRecovery Techniques and   Need of Recovery
Recovery Techniques and Need of Recovery
 
Oracle architecture
Oracle architectureOracle architecture
Oracle architecture
 
Data Backup (IT) Lecture Slide # 5
Data Backup (IT) Lecture Slide # 5Data Backup (IT) Lecture Slide # 5
Data Backup (IT) Lecture Slide # 5
 
All Oracle-dba-interview-questions
All Oracle-dba-interview-questionsAll Oracle-dba-interview-questions
All Oracle-dba-interview-questions
 
Oracle database hot backup and recovery
Oracle database hot backup and recoveryOracle database hot backup and recovery
Oracle database hot backup and recovery
 
DataGuard - Oracle's Time Machine
DataGuard - Oracle's Time MachineDataGuard - Oracle's Time Machine
DataGuard - Oracle's Time Machine
 
Presentation on backup and recoveryyyyyyyyyyyyy
Presentation on backup and recoveryyyyyyyyyyyyyPresentation on backup and recoveryyyyyyyyyyyyy
Presentation on backup and recoveryyyyyyyyyyyyy
 
12. oracle database architecture
12. oracle database architecture12. oracle database architecture
12. oracle database architecture
 
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
 
The oracle database architecture
The oracle database architectureThe oracle database architecture
The oracle database architecture
 

Viewers also liked

Curso basicoseguridadweb slideshare9
Curso basicoseguridadweb slideshare9Curso basicoseguridadweb slideshare9
Curso basicoseguridadweb slideshare9tantascosasquenose
 
Startupandshutdown
StartupandshutdownStartupandshutdown
StartupandshutdownVinay Thota
 
Introduction to sql server
Introduction to sql serverIntroduction to sql server
Introduction to sql serverVinay Thota
 
Controlfilemanagement
ControlfilemanagementControlfilemanagement
ControlfilemanagementVinay Thota
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerLuminary 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 CarsLinkedIn
 

Viewers also liked (8)

Basic commands
Basic commandsBasic commands
Basic commands
 
Curso basicoseguridadweb slideshare9
Curso basicoseguridadweb slideshare9Curso basicoseguridadweb slideshare9
Curso basicoseguridadweb slideshare9
 
Startupandshutdown
StartupandshutdownStartupandshutdown
Startupandshutdown
 
Tablespaces
TablespacesTablespaces
Tablespaces
 
Introduction to sql server
Introduction to sql serverIntroduction to sql server
Introduction to sql server
 
Controlfilemanagement
ControlfilemanagementControlfilemanagement
Controlfilemanagement
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
 
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
 

Similar to Backup&recovery

Oracle ocp backup exam
Oracle ocp backup examOracle ocp backup exam
Oracle ocp backup examsriram raj
 
Oracle OCP Backup Exam
Oracle OCP Backup ExamOracle OCP Backup Exam
Oracle OCP Backup ExamInprise Group
 
Backup and Recovery Procedure
Backup and Recovery ProcedureBackup and Recovery Procedure
Backup and Recovery ProcedureAnar Godjaev
 
Backups And Recovery
Backups And RecoveryBackups And Recovery
Backups And Recoveryasifmalik110
 
Oracle backup and recovery
Oracle backup and recoveryOracle backup and recovery
Oracle backup and recoveryYogiji Creations
 
Les 06 Perform Rec
Les 06 Perform RecLes 06 Perform Rec
Les 06 Perform Recvivaankumar
 
Backup-Recovery in PostgreSQL
Backup-Recovery in PostgreSQLBackup-Recovery in PostgreSQL
Backup-Recovery in PostgreSQLAshnik Pte Ltd
 
BACKUP & RECOVERY IN DBMS
BACKUP & RECOVERY IN DBMSBACKUP & RECOVERY IN DBMS
BACKUP & RECOVERY IN DBMSBaivabiNayak
 
Less14 Br Concepts
Less14 Br ConceptsLess14 Br Concepts
Less14 Br Conceptsvivaankumar
 
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 RecoveryRaja Waseem Akhtar
 
Data backup and disaster recovery
Data backup and disaster recoveryData backup and disaster recovery
Data backup and disaster recoverycatacutanjcsantos
 
Backup and recovery in oracle
Backup and recovery in oracleBackup and recovery in oracle
Backup and recovery in oraclesadegh salehi
 
Collaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mysteryCollaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mysteryNelson Calero
 
Les 05 Create Bu
Les 05 Create BuLes 05 Create Bu
Les 05 Create Buvivaankumar
 
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.docxhoney725342
 
Dataguard presentation
Dataguard presentationDataguard presentation
Dataguard presentationVimlendu Kumar
 

Similar to Backup&recovery (20)

Oracle ocp backup exam
Oracle ocp backup examOracle ocp backup exam
Oracle ocp backup exam
 
Oracle OCP Backup Exam
Oracle OCP Backup ExamOracle OCP Backup Exam
Oracle OCP Backup Exam
 
Backup and Recovery Procedure
Backup and Recovery ProcedureBackup and Recovery Procedure
Backup and Recovery Procedure
 
Less15 Backups
Less15 BackupsLess15 Backups
Less15 Backups
 
Backups And Recovery
Backups And RecoveryBackups And Recovery
Backups And Recovery
 
Oracle backup and recovery
Oracle backup and recoveryOracle backup and recovery
Oracle backup and recovery
 
Les 06 Perform Rec
Les 06 Perform RecLes 06 Perform Rec
Les 06 Perform Rec
 
Xpp c user_rec
Xpp c user_recXpp c user_rec
Xpp c user_rec
 
Backup-Recovery in PostgreSQL
Backup-Recovery in PostgreSQLBackup-Recovery in PostgreSQL
Backup-Recovery in PostgreSQL
 
Les 06 rec
Les 06 recLes 06 rec
Les 06 rec
 
BACKUP & RECOVERY IN DBMS
BACKUP & RECOVERY IN DBMSBACKUP & RECOVERY IN DBMS
BACKUP & RECOVERY IN DBMS
 
Less14 Br Concepts
Less14 Br ConceptsLess14 Br Concepts
Less14 Br Concepts
 
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
 
Data backup and disaster recovery
Data backup and disaster recoveryData backup and disaster recovery
Data backup and disaster recovery
 
IMSDB - DBRC
IMSDB - DBRCIMSDB - DBRC
IMSDB - DBRC
 
Backup and recovery in oracle
Backup and recovery in oracleBackup and recovery in oracle
Backup and recovery in oracle
 
Collaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mysteryCollaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mystery
 
Les 05 Create Bu
Les 05 Create BuLes 05 Create Bu
Les 05 Create Bu
 
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
 
Dataguard presentation
Dataguard presentationDataguard presentation
Dataguard presentation
 

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’;