IT 21003 Database Administration Section 09. Backup and Recovery Backup: The available options Full Consistent (cold) Backup Database shutdown, all files.

Slides:



Advertisements
Similar presentations
INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Backup and Recovery Copyright System Managers LLC 2008 all rights reserved.
Advertisements

Oracle Architecture. Instances and Databases (1/2)
ITEC474 Control File Maintenance
Page Footer Keed Education Oracle Database Administration Basic Copyright 2009 Keed Education BV Version Concept.
Harvard University Oracle Database Administration Session 10 Database Backups.
Harvard University Oracle Database Administration Session 2 System Level.
Database Backup and Recovery
INTRODUCTION TO ORACLE Lynnwood Brown President System Managers LLC Data Loading & Backup And Recovery Lecture 5 Copyright System Managers LLC 2003 all.
RMAN Restore and Recovery
Backup and Recovery (2) Oracle 10g CAP364 1 Hebah ElGibreen.
Backup and Recovery Part 1.
Chapter 12 Performing Incomplete Recovery. Background Viewed as one of the more difficult chapters to write Thought it was important to put in material.
Harvard University Oracle Database Administration Session 11 Database Recovery.
Database Backup & Recovery David Konopnicki. Introduction A major responsibility of the database administrator is to prepare for the possibility of hardware,
CHAPTER 16 User-Managed Backup and Recovery. Introduction to User Managed Backup and Recovery Backup and recover is one of the most critical skills a.
CHAPTER 5 Managing Control Files, Online Redo Logs, and Archiving.
Backup Concepts. Introduction Backup and recovery procedures protect your database against data loss and reconstruct the data, should loss occur. The.
Agenda  Overview  Configuring the database for basic Backup and Recovery  Backing up your database  Restore and Recovery Operations  Managing your.
Oracle backup and recovery strategy
Introduction to Oracle Backup and Recovery
Using RMAN to Perform Recovery
CHAPTER 16 User-Managed Backup and Recovery. Introduction to User Managed Backup and Recovery Backup and recover is one of the most critical skills a.
IS 4510 – Database Administration Module – 2 Database Backup 10/24/20141Compiled by: Zafar Iqbal Khan.
Backup & Recovery Concepts for Oracle Database
20 Copyright © 2004, Oracle. All rights reserved. Database Recovery.
13 Copyright © Oracle Corporation, All rights reserved. RMAN Complete Recovery.
IT Database Administration Section 03. Tablespaces and the DBA  Important for DBAs – logical units of database storage Made up of physical operating-system.
Database Administration TableSpace & Data File Management
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
SRUTHI NAGULAVANCHA CIS 764, FALL 2008 Department of Computing and Information Sciences (CIS) Kansas State University -1- Back up & Recovery Strategies.
5 Copyright © 2004, Oracle. All rights reserved. Using Recovery Manager.
Chapter 7 Making Backups with RMAN. Objectives Explain backup sets and image copies RMAN Backup modes’ Types of files backed up Backup destinations Specifying.
11 Copyright © Oracle Corporation, All rights reserved. RMAN Backups.
11 Copyright © Oracle Corporation, All rights reserved. RMAN Backups.
Backup & Recovery Backup and Recovery Strategies on Windows Server 2003.
16 Copyright © 2007, Oracle. All rights reserved. Performing Database Recovery.
7202ICT Database Administration Lecture 7 Managing Database Storage Part 2 Orale Concept Manuel Chapter 3 & 4.
15 Copyright © 2007, Oracle. All rights reserved. Performing Database Backups.
9 Copyright © 2004, Oracle. All rights reserved. Flashback Database.
The protection of the DB against intentional or unintentional threats using computer-based or non- computer-based controls. Database Security – Part 2.
IT Database Administration SECTION 01. Starting Up and Shutting Down the Database Database Administration Facilities – A number of tools are available.
Database structure and space Management. Database Structure An ORACLE database has both a physical and logical structure. By separating physical and logical.
Database Storage Structures
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
IT Database Administration SECTION 02. CREATING DATABASES Creating a Database: Overview 1. Plan the physical design and storage structures 2. Back.
Backup Concepts. Introduction Backup and recovery procedures protect your database against data loss and reconstruct the data, should loss occur. The.
3 Copyright © 2006, Oracle. All rights reserved. Using Recovery Manager.
10 Copyright © Oracle Corporation, All rights reserved. User-Managed Backups.
Overview of Oracle Backup and Recovery Darl Kuhn, Regis University.
12 Copyright © Oracle Corporation, All rights reserved. User-Managed Complete Recovery.
18 Copyright © 2004, Oracle. All rights reserved. Backup and Recovery Concepts.
6 Copyright © 2007, Oracle. All rights reserved. Performing User-Managed Backup and Recovery.
16 Copyright © 2005, Oracle. All rights reserved. Performing Database Recovery.
Oracle Architecture - Structure. Oracle Architecture - Structure The Oracle Server architecture 1. Structures are well-defined objects that store the.
8 Copyright © 2007, Oracle. All rights reserved. Using RMAN to Duplicate a Database.
18 Copyright © 2004, Oracle. All rights reserved. Recovery Concepts.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
14 Copyright © 2007, Oracle. All rights reserved. Backup and Recovery Concepts.
8 Copyright © Oracle Corporation, All rights reserved. Managing Tablespaces and Data files.
RMAN Maintenance.
Database Administration
Backup and Recovery.
How To Pass Oracle 1z0-060 Exam In First Attempt?
Recovery Catalog Creation and Maintenance
Maintaining Online Redo Log Files
Backup and Recovery (1) Oracle 10g Hebah ElGibreen CAP364.
Performing User-Managed Backup and Recovery
Performing Database Recovery
ISYS366, Oracle Disk Internals
Database Backup and Recovery
Presentation transcript:

IT Database Administration Section 09

Backup and Recovery Backup: The available options Full Consistent (cold) Backup Database shutdown, all files copied (data, control, redo logs) Partial Offline Backup Backup of individual tablespaces while offline Partial Online (hot) Backup Individual tablespaces backed up while database is open and tablespace is online Export/Import Logical Backups Database normally closed to users while full export takes place

Backup and Recovery Determining the Files  Information available in OPEN and MOUNT states  Datafiles  Select name From v&datafile;  From control files  Select file_name From dba_data_files;  From data dictionary  Online Redo Log Files Select member From v$logfile; Select member From v$logfile;  Current Control File Names  Select name From v$controlfile;

Backup and Recovery Full Consistent Backups  Database must be closed during the backup Makes a block-by-block copy of all database and control files Makes a block-by-block copy of all database and control files  On large databases, full backup can take a long time Might not be able to have database down for this period to get a full backup Might not be able to have database down for this period to get a full backup Requires lots of storage for the backup files Requires lots of storage for the backup files  Easier and more reliable than other methods  Can be performed in ARCHIVELOG and NOARCHIVELOG mode

Backup and Recovery A Full Backup  Determine all files to backup  Shutdown the database in NORMAL mode This ensures the database is left in a consistent state This ensures the database is left in a consistent state Use SHUTDOWN IMMEDIATE to quickly remove users if needed Use SHUTDOWN IMMEDIATE to quickly remove users if needed If SHUTDOWN ABORT must be used, startup in RESTRICTED mode and then SHUTDOWN NORMAL If SHUTDOWN ABORT must be used, startup in RESTRICTED mode and then SHUTDOWN NORMAL  Use a backup utility or OS commands to perform the backup  Startup the Instance and then Open the database

Backup and Recovery A Partial Offline (Tablespace-Level) Backup  Only the tablespace being backed up needs to be offline during the backup The SYSTEM tablespace or any tablespace containing active rollback segments cannot be taken offline The SYSTEM tablespace or any tablespace containing active rollback segments cannot be taken offline  Allows portions of large databases to be dumped during separate down periods  More error prone than a full backup due to increased operator input needed

Backup and Recovery A Partial Offline (Tablespace-Level) Backup  Identify the datafiles belonging to the tablespace in question Select tablespace_name, file_name, Select tablespace_name, file_name, From dba_data_files From dba_data_files Where tablespace_name = ‘USER1_TBSPC’; Where tablespace_name = ‘USER1_TBSPC’;  Ensure the tablespace is offline Alter Tablespace user1_tbspc Offline; Alter Tablespace user1_tbspc Offline;  Use a backup utility or OS commands to perform the backup  Bring the tablespace back online  Alter Tablespace user1_tbspc Online;

Backup and Recovery A Partial Online (Hot) Backup  Identify the datafiles belonging to the tablespace in question  For each tablespace in turn, perform the following steps:  Mark the beginning of the backup period  Alter Tablespace user1_tbspc Begin Backup;  Oracle stops recording checkpoints in the file headers  Deferred rollback segments are used while is backed up  Backup all files within the tablespace  Mark the end of the backup period  Alter Tablespace user1_tbspc End Backup;  Oracle updates the file headers to the current database checkpoint

Backup and Recovery A Partial Online (Hot) Backup  The Begin and End Backup statements should be as close in time as possible  LGWR logs whole blocks of data at any change made within the tablespace during the backup period  Could result in heavy logging activity  Make sure tablespaces are backed up one at a time to minimize block logging

Backup and Recovery Recovery from a Full Backup  Database is in ARCHIVELOG mode  Connect As Sysdba so that the required privileges are enabled  Shutdown the database  Restore all datafiles but not the Control Files and Redo Log Files from the cold backup Do Not Restore the redo log files, because that will overwrite the current log files, which are needed in the last stages of the recovery Do Not Restore the redo log files, because that will overwrite the current log files, which are needed in the last stages of the recovery  Startup the instance in MOUNT state  Startup Mount instance_name Pfile = parameter_file_name

Backup and Recovery Recovery from a Full Backup  Recover the database  Use Recover Database  Oracle applies archived logs to roll the database forward in time  If archived files are not available in the destination area, Oracle prompts for the location of each log  Having consumed the archived logs, Oracle then applies all the information held in the online redo logs to complete the recovery  The magic words that the recovery is complete are:  Media Recovery Complete (MRC)  The database can now be made available to users

Backup and Recovery Recovery from a Partial (Hot or Cold) Backup  Close the database Described in previous slides Described in previous slides Performed in the MOUNT state Performed in the MOUNT state All tablespaces can be recovered this way All tablespaces can be recovered this way  Open the database  Performed in an OPEN state  The SYSTEM tablespace and tablespaces containing active rollback segments cannot be recovered in this way

Backup and Recovery Recovery of a tablespace on a Closed database  Connect As Sysdba and shutdown the database  Restore the files for the tablespace (Copy)  MOUNT but do not OPEN the database  Put any offline files back online  Recover Database or Recover Tablespace tblspc_name; Look for the MRC result Look for the MRC result  Alter the database to an OPEN state

Backup and Recovery Recovery of a tablespace on a Open database  Connect As Sysdba  Take the target tablespace offline  Restore (copy) the files for the tablespace  Recover the tablespace  Put the tablespace back online

Backup and Recovery The Export/Import Utilities  Export and Import can be used for a variety of purposes  As part of a backup strategy  Reorganize database storage  Transfer data across systems  Upgrade (migrate) to different versions of Oracle  Store data offline for future use  Tablespace Point-In-Time Recovery

Backup and Recovery The Export/Import Utilities  Essential Features  Users may export/import their own objects  Easiest method to restore a single table  Must have privileged access to export other user’s objects  Export data file is a binary file in “internal” Oracle format  Export does not drop exported objects  Import can create objects as well as import rows  Errors do not halt processing – is simply reported  Can COMPRESS/NOCOMPRESS extents

Backup and Recovery Export Levels  Table  Specific tables can be exported with or without data  Oracle is able to export partitions and subpartitions  User  Allows export of all objects owned by one user  DBAs may use this to export a series of users  Tablespace  Transportable Tablespaces  Database  DBAs can export all objects except those owned by SYS  Do Not Use This

Backup and Recovery Using Export/Import as part of a Backup strategy  A full database-level export is a logical dump of the database  Can be very slow, usually slower than an OS physical dump  Useful for recovering single tables from a DROP command  Database must be OPEN to perform an export  Export guarantees a read-consistent view of only single tables  If multiple tables are being exported  Lock them in SHARE mode to prevent concurrent updates or  OPEN DATABSE in RESTRICTED mode

Backup and Recovery Using Export/Import as part of a Backup strategy  Export/Import can be used to restore/reorganize a database  No rollforward recovery is possible  Rebuild database after a change in the block size  Must prebuild rollback segments and all tablespaces first  Move tables across users; reduce fragmentation, migration effects

Backup and Recovery Methods of Exporting  Two basic methods  Interactively with a GUI utility  Command Line  Can be run at the OS command prompt or from within Oracle  Perform exports before file-level backups  This catches data block corruption problems

Backup and Recovery Import  The only utility that can read export files  Can selectively import types of database objects  Useful for delaying and controlling index creation  Can ask to show the export file contents

Backup and Recovery Points to Consider  Good for restructuring tables  Set up a good PCTFREE before exporting data  Drop old tables, then import under new storage definitions  Can import database objects without including rows  Useful for moving from development to live databases  Import will carry on past any errors  Disable referential constraints during import, and recompile stored procedures as necessary

Backup and Recovery Transportable Tablespaces  Fast method to move tablespaces from one database to another  Both databases must be compatible and on the same OS  Tablespaces must be self-contained  No outside constraints or partitions  Make tablespaces READ ONLY and export the metadata  Export Transport Tablespace = Y Tablespaces = users File = tblspc_expdata.dmp  Use the OS to copy datafiles and export file to the target machine

Backup and Recovery Transportable Tablespaces  Plug in the transported tablespaces to the target database  Imp Transport_Tablespace = Y Datafiles = … Tablespaces = … File = …  Rowids in the target database are no longer unique  A rowid is only unique within a table  Transportable tablespacees are covered more in later course levels

Backup and Recovery Questions?