Tuesday, July 29, 2014

BACKUP AND RECOVERY

BACKUP AND RECOVERY

Media Failure and Recovery:
Database in NOARCHIVELOG Mode
Failure : loss of disk,data file,or corruption
Recovery : Restore all Oracle files:
- Data files
- Control files
- Redo log files
- Password file (optional)
- Parameter file (optional)
Advantage
·         Easy to perform with low risk of error
·         Recovery time is the time it takes to restore all files.
Disadvantage
·         Data is lost and must be reapplied manually
·         The entire database is restored to the point of the last whole closed backup
Recovery
            > shutdown
Restore all files using operating system
            > startup
Restoring to a Different Location
            > startup mount
            > alter database rename file ’/clover/oradata/user_01.dbf’ to                                                                                                ’/clover/oradata/user_01.dbf’;
            > alter database open;
Media Failure and Recovery:
ARCHIVELOG Mode
Failure : loss of disk,data file,or corruption
Recovery
- Data files for restore must be offline.
- Restore only lost or damaged data files
- Do not restore the control files, redo log files, password files, or parameter files
- Recover the data files.
Advantages
·         Only need to restore lost files
·         Recovers all data to the time of failure
·         Recovery time is the time it takes to restore lost files and apply all archived log files
Disadvantages
·         Must have all archived log files since the backup from which you are restoring
Complete recovery
·         Closed database recovery for
- System data files
- Rollback segment data files
- Whole database
·         Opened database recovery, with database initially opened : for file loss
·         Opened database recovery with database initially closed : for hardware failure
·         Data file recovery with no data file backup
Incomplete recovery
·         Time based
·         Cancel based
·         Using control file
·         Change based
Closed database backup
No archive log mode
Data files, Control files, Redolog files, Parameter file, Password file
            > SHUTDOWN IMMEDIATE
            cp  /backup
            > STARTUP OPEN;
Open database backup
Archive log mode
Data files, Control files, Parameter file, Password file
Arch process must be enabled
            > alter tablespace TEST begin backup;
            cp /clover/data/test.dbf  /clover/backup/test.dbf
            > alter tablespace TEST end backup;
Creating a binary image;
            > alter database backup controlfile to ‘controll.bk
Creating a text trace file:       
            > alter database backup controlfile to trace;

No comments:

Post a Comment