• Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
241
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
2
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Backup and Recovery
  • 2. Backup Types Logical Cold Hot Physical With Without
  • 3. Issues – – – – – – – – Protect the database from numerous types of failures Protect the database from numerous types of failures Increase Mean-Time-Between-Failures (MTBF) Increase Mean-Time-Between-Failures (MTBF) Decrease Mean-Time-To-Recover (MTTR) Decrease Mean-Time-To-Recover (MTTR) Minimize data loss Minimize data loss
  • 4. Categories of Failures – Statement failure – Statement failure – – – – – – Logic error in an application Logic error in an application Attempt to enter bad data into the table Attempt to enter bad data into the table Attempt an operation with insufficient Attempt an operation with insufficient privileges privileges – Attempt an INSERT or UPDATE to a table, – Attempt an INSERT or UPDATE to a table, causing an extent to be allocated, causing an extent to be allocated, but with insufficient free space but with insufficient free space left in the tablespace left in the tablespace No Recovery Needed
  • 5. Categories of Failures – Statement failure – Statement failure – User process failure – User process failure – The user performed an abnormal disconnect in – The user performed an abnormal disconnect in the session. the session. – The user’s session was abnormally terminated. – The user’s session was abnormally terminated. – The user’s program raised an address – The user’s program raised an address exception terminating the session. exception terminating the session. No Recovery Needed PMON
  • 6. Categories of Failures – Statement failure – Statement failure – User process failure – User process failure – User error – User error – – – – – – Accidental DROP TABLE; Accidental DROP TABLE; Accidental TRUNCATE TABLE; Accidental TRUNCATE TABLE; Accidental DELETE // UPDATE; Accidental DELETE UPDATE; Recovery Needed IMP Utility
  • 7. Categories of Failures – Statement failure – Statement failure – User process failure – User process failure – User error – User error – Instance failure – Instance failure – HardWare Problem on CPU // RAM – HardWare Problem on CPU RAM No Recovery Needed PMON SMON
  • 8. Categories of Failures – Statement failure – Statement failure – User process failure – User process failure – User error – User error – Instance failure – Instance failure – Media failure – Media failure – HardWare Problem on I/O Device – HardWare Problem on I/O Device Recovery Needed Physical
  • 9. Requirements for Strategy – Business requirements – Business requirements •• Evolutionary process Evolutionary process – Technical requirements – Technical requirements •• •• •• •• Hardware, software, man power and time Hardware, software, man power and time Database configurations Database configurations Transaction volume Transaction volume Frequency of backups Frequency of backups – Operational requirements – Operational requirements •• •• 7-day // 24-hour operations 7-day 24-hour operations Testing and validating backups Testing and validating backups
  • 10. Physical Backup Methods No archive mode Archive mode Physical backup
  • 11. ARCHIVELOG Online redo log files Group 1 053 Archived log file Group 2 052 ARC0 052 /disk1/archive/ arch%s.arc 053 052 LOG_ARCHIVE_DEST LOG_ARCHIVE_FORMAT
  • 12. Enabling ARCHIVELOG Mode 1 2 4 Startup mount Init.ora 3 Shutdown normal or immediate Alter database open Control file Alter database ARCHIVELOG 6 5 Shutdown normal or immediate Full database backup
  • 13. 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;
  • 14. Advantages of Physical Closed Database Backups – Conceptually simple – Conceptually simple – Easy to perform – Easy to perform – Require little operator interaction – Require little operator interaction
  • 15. Physical Opened Database Backup (1) Online redo log files Control files Parameter files Online or offline storage Archived redo log files HOST cp <files> /backup/ Pwd file
  • 16. Physical Opened Database All tablespace data Backup (2) Individual data files file SQL> alter tablespace <name> begin backup; SQL> alter tablespace <name> begin backup; Online or offline storage Data files HOST cp <files> /backup/ SQL> alter tablespace <name> end backup; SQL> alter tablespace <name> end backup;
  • 17. Advantages of Physical Opened Database Backups – Maintains high database availability – Maintains high database availability – Can be done at a tablespace or data file level – Can be done at a tablespace or data file level – Supports nonstop business operations – Supports nonstop business operations
  • 18. 1 Archived log file 1 ARC0 Redo log files Data files 1 Control file
  • 19. 2 2 Redo log files Data files 2 Control file Archived log file 1 ARC0 1
  • 20. 3 2 Redo log files Data files 3 Control file Archived log file 3 ARC0 1 2
  • 21. 4 4 Redo log files Data files 4 Control file Archived log file 3 ARC0 1 3 2
  • 22. 5 Archived log file 5 ARC0 Redo log files Data files 5 Control file 5 5 Data files Control file 1 2 3 4 4
  • 23. 6 Archived log file 5 ARC0 Redo log files Data files 1 2 3 6 4 5 6 Control file 5 5 Data files Control file
  • 24. 9 Archived log file 9 ARC0 Data files Control file 5 5 Data files Control file 4 6 7 9 2 5 Redo log files 1 3 8 8
  • 25. 1 Shutdown 2 Startup Mount 3O.S. Restore From Hot or Cold Physical BackUp DataFile (s) 9 9 9 5 4 8 Redo log files Data files Recover DataFile (s) Automatic 4a 4b 9 Applyed Archived Logs #5 #6 #7 Applyed On Line Logs #8 #9 5 Alter DataBase Open 6 Shutdown Immediate 7 New Cold Physical BackUp 8 Startup Open 9 Control file
  • 26. S.C.N. System Change Number Data files Header Control file 1 RedoRecord Incremental Time Stamp 2 Unique Identified “Committed Version D.B.” Log file # Log file Low SCN # Higth SCN #
  • 27. Logical Backup Methods Oracle Export and Import Utilities • An interactive dialog • An interactive dialog • The export page of the Data Manager within • The export page of the Data Manager within Enterprise Manager Enterprise Manager • The command line interface, by specifying • The command line interface, by specifying parameters parameters
  • 28. These utilities enable you to do the following: These utilities enable you to do the following: – Archive historical data – Archive historical data – Save table definitions (with or without data) to protect – Save table definitions (with or without data) to protect from user error failure from user error failure – Move data between machines and databases or versions – Move data between machines and databases or versions of the Oracle server of the Oracle server – Transport tablespaces between databases – Transport tablespaces between databases
  • 29. Formato Binario Proprietario Data Base Exp Data Base Imp File *.dmp
  • 30. Export Concepts Oracle Server Generate SQL commands Two-Task common (TTC) Dump file TTC buffer 1 Full 1a 2 SQL Buffer command cache Analyze blocks processing manager Evaluating buffer Owner 3 Buffer cache Read blocks Tables Oracle9i Server IncType Complete 1b IncType Cumulative 1c IncType Incremental
  • 31. KEYWORD DESCRIPTION (DEFAULT) ----------------------------------------------------------------USERID username/password BUFFER size of data buffer FILE LOG PARFILE FILESIZE output files (EXPDAT.DMP) log file of screen output parameter filename maximum size of each dump file COMPRESS CONSISTENT import into one extent cross-table consistency (Y) (N) GRANTS INDEXES ROWS CONSTRAINTS TRIGGERS export export export export export (Y) (Y) (Y) (Y) (Y) FULL OWNER TABLES export entire DataBase list of owner usernames list of table names INCTYPE DIRECT STATISTICS incremental export type direct path analyze objects grants indexes data rows constraints triggers (N) (N) (ESTIMATE)
  • 32. Command-Line Method > exp scott/tiger file=scott.dmp owner=scott grants=Y rows=Y compres Export Messages Export: Release 9.2.0.4.0 - Production on Fri Oct 30 09:35:33 1998 (c) Copyright 2003 Oracle Corporation. All rights reserved. Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - Produc With the Partitioning option PL/SQL Release 9.2.0.4.0 - Production Export done in WE8DEC character set and WE8DEC NCHAR character set . exporting pre-schema procedural objects and actions . exporting foreign function library names for user SCOTT . exporting object type definitions for user SCOTT About to export SCOTT’s objects ... . exporting database links . exporting sequence numbers . exporting cluster definitions . about to export SCOTT’s tables via Conventional Path ... . . exporting table BONUS 0 rows exported . . exporting table DEPT 4 rows exported . . exporting table EMP 14 rows exported
  • 33. IncType Complete IncType Incremental -----> Exp IncType Generic IncType Cumulative -----> Exp IncType Cumulative or Complete
  • 34. Oracle Standby Implementation • • • • • Fail over Solution Disaster Recovery Solution (if remote) Ease of implementation Minimum impact on Production System Read Only Standby Database
  • 35. Overview of Managed Oracle Standby DB Primary Instance ARCH Standby Instance T.N.S. Redo log Recovery proc DBWR Arc log Arc log RFS Primary DB Standby DB Primary control file Standby control file 1 Recovery Mode 2 3 ReadOnly Mode Activate