Backup and Recovery

Backup Types
Logical Cold

Hot
Physical
With Without

Issues
– – – – Protect the database from numerous types of failures Increase Mean-Time-Between-Failures (MTBF) Decrease Mean-Time-To-Recover (MTTR) Minimize data loss

but with insufficient free space left in the tablespace . causing an extent to be allocated.Categories of Failures – Statement failure No Recovery Needed – Logic error in an application – Attempt to enter bad data into the table – Attempt an operation with insufficient privileges – Attempt an INSERT or UPDATE to a table.

– The user’s session was abnormally terminated.Categories of Failures – Statement failure – User process failure No Recovery Needed PMON – The user performed an abnormal disconnect in the session. – The user’s program raised an address exception terminating the session. .

– Accidental TRUNCATE TABLE. – Accidental DELETE / UPDATE.Categories of Failures – Statement failure – User process failure – User error Recovery Needed IMP Utility – Accidental DROP TABLE. .

Categories of Failures – – – – Statement failure User process failure User error Instance failure No Recovery Needed PMON SMON – HardWare Problem on CPU / RAM .

Categories of Failures – – – – – Statement failure User process failure User error Instance failure Media failure Recovery Needed Physical – HardWare Problem on I/O Device .

man power and time Database configurations Transaction volume Frequency of backups – Operational requirements • 7-day / 24-hour operations • Testing and validating backups .Requirements for Strategy – Business requirements • Evolutionary process – Technical requirements • • • • Hardware. software.

Physical Backup Methods No archive mode Archive mode Physical backup .

arc 053 052 LOG_ARCHIVE_DEST LOG_ARCHIVE_FORMAT .ARCHIVELOG Online redo log files Group 1 Group 2 Archived log file ARC0 052 053 052 /disk1/archive/ arch%s.

ora Control file 3 Alter database ARCHIVELOG 5 Shutdown normal or immediate 6 Full database backup .Enabling ARCHIVELOG Mode 1 2 Startup mount Shutdown normal or immediate 4 Alter database open Init.

SHUTDOWN IMMEDIATE. . Physical Closed Database Backup Data files Control files Redo log files Password Parameter files file HOST cp <files> /backup/ Online or offline storage STARTUP OPEN.

Advantages of Physical Closed Database Backups – Conceptually simple – Easy to perform – Require little operator interaction .

Physical Opened Database Backup (1) Online redo log files Control files Online or offline storage Parameter files Archived redo log files HOST cp <files> /backup/ Pwd file .

Online or offline storage Data files HOST cp <files> /backup/ SQL> alter tablespace <name> end backup. .Physical Opened Database All tablespace data Backup (2) Individual data files file SQL> alter tablespace <name> begin backup.

Advantages of Physical Opened Database Backups – Maintains high database availability – Can be done at a tablespace or data file level – Supports nonstop business operations .

1 1 Archived log file ARC0 Redo log files Data files 1 Control file .

2 1 2 Archived log file ARC0 1 Data files Redo log files 2 Control file .

3 3 2 Archived log file ARC0 1 2 Data files Redo log files 3 Control file .

4 3 4 Archived log file ARC0 1 2 Data files Redo log files 3 4 Control file .

5 5 4 Archived log file ARC0 1 2 Data files Redo log files 3 4 5 Control file 5 5 Data files Control file .

6 5 6 Archived log file ARC0 1 2 Data files Redo log files 3 5 4 6 Control file 5 5 Data files Control file .

9 9 8 Archived log file ARC0 1 2 Data files Redo log files 3 5 4 6 8 9 7 Control file 5 5 Data files Control file .

S.1 2 3 9 9 5 9 Shutdown Startup Mount O. Restore From Hot or Cold Physical BackUp DataFile (s) 9 8 4 Recover DataFile (s) Automatic 4a 4b 5 Applyed Archived Logs #5 #6 #7 Applyed On Line Logs #8 #9 Redo log files Data files 9 Alter DataBase Open Shutdown Immediate New Cold Physical BackUp Startup Open Control file 6 7 8 .

System Change Number Control file Data files Header RedoRecord 1 Incremental Time Stamp 2 Unique Identified “Committed Version D.N.C.S.” Log file # Log file Low SCN # Higth SCN # .B.

by specifying parameters .Logical Backup Methods Oracle Export and Import Utilities • An interactive dialog • The export page of the Data Manager within Enterprise Manager • The command line interface.

These utilities enable you to do the following: – Archive historical data – Save table definitions (with or without data) to protect from user error failure – Move data between machines and databases or versions of the Oracle server – Transport tablespaces between databases .

Formato Binario Proprietario Data Base Exp File *.dmp Data Base Imp .

Export Concepts Oracle Server Generate SQL commands Two-Task common (TTC) SQL command processing Buffer cache manager Analyze blocks Dump file TTC buffer Evaluating buffer Buffer cache Read blocks 1 1a Full 2 Owner 3 Tables Oracle9i Server IncType Complete 1b IncType Cumulative 1c IncType Incremental .

DMP) log file of screen output parameter filename maximum size of each dump file import into one extent cross-table consistency export export export export export grants indexes data rows constraints triggers (Y) (N) (Y) (Y) (Y) (Y) (Y) (N) export entire DataBase list of owner usernames list of table names incremental export type direct path analyze objects (N) (ESTIMATE) .KEYWORD DESCRIPTION (DEFAULT) ----------------------------------------------------------------USERID username/password BUFFER size of data buffer FILE LOG PARFILE FILESIZE COMPRESS CONSISTENT GRANTS INDEXES ROWS CONSTRAINTS TRIGGERS FULL OWNER TABLES INCTYPE DIRECT STATISTICS output files (EXPDAT.

. exporting table DEPT 4 rows exported . exporting pre-schema procedural objects and actions . . . exporting table EMP 14 rows exported .Command-Line Method > exp scott/tiger file=scott..Production With the Partitioning option PL/SQL Release 9. . exporting object type definitions for user SCOTT About to export SCOTT’s objects . exporting database links .0.0. .dmp owner=scott grants=Y rows=Y compress=Y Export Messages Export: Release 9.0.Production on Fri Oct 30 09:35:33 1998 (c) Copyright 2003 Oracle Corporation. Connected to: Oracle9i Enterprise Edition Release 9. exporting cluster definitions ..4. exporting foreign function library names for user SCOTT .0 .0 ..4. All rights reserved. exporting sequence numbers .0 .2.4. exporting table BONUS 0 rows exported . about to export SCOTT’s tables via Conventional Path . .2.2.Production Export done in WE8DEC character set and WE8DEC NCHAR character set .

IncType Complete IncType Incremental -----> Exp IncType Generic IncType Cumulative -----> Exp IncType Cumulative or Complete .

Oracle Standby Implementation • • • • • Fail over Solution Disaster Recovery Solution (if remote) Ease of implementation Minimum impact on Production System Read Only Standby Database .

S.N. ARCH Redo log Arc log Recovery proc Arc log RFS DBWR Primary DB Standby DB Primary control file Standby control file 1 Recovery Mode 3 Activate 2 ReadOnly Mode .Overview of Managed Oracle Standby DB Primary Instance Standby Instance T.