IS 4510 – Database Administration Module – 2 Database Backup 10/24/20141Compiled by: Zafar Iqbal Khan.

Slides:



Advertisements
Similar presentations
Introduction to Oracle
Advertisements

CHAPTER 13 Data Pump. Tool that replaces legacy exp/imp utilities Data Pump is a scalable, feature-rich utility that allows you to extract objects and.
INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Backup and Recovery Copyright System Managers LLC 2008 all rights reserved.
Oracle Architecture. Instances and Databases (1/2)
ITEC474 Control File Maintenance
The New Data Pump Caleb Small Next generation Import / Export New features Better performance Improved security Versatile interfaces.
FlareCo Ltd ALTER DATABASE AdventureWorks SET PARTNER FORCE_SERVICE_ALLOW_DATA_LOSS Slide 1.
Harvard University Oracle Database Administration Session 10 Database Backups.
Harvard University Oracle Database Administration Session 2 System Level.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 12: Managing and Implementing Backups and Disaster Recovery.
Advanced Databases Basic Database Administration Guide to Oracle 10g 1.
Advanced Databases DBA: Backups 1. Advanced Databases Agenda Define backup Discuss Backup Terminology Explain various backup and restore options in Oracle.
Oracle Database Instance Management Oracle 10g. Ebtisam Alabdulqader Outline Management Framework. Managing Oracle instance through the Enterprise Manager.
Database Backup and Recovery
RMAN Restore and Recovery
Backup and Recovery (2) Oracle 10g CAP364 1 Hebah ElGibreen.
Backup and Recovery Part 1.
Harvard University Oracle Database Administration Session 11 Database 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.
Chapter 5 Configuring the RMAN Environment. Objectives Show command to see existing settings Configure command to change settings Backing up the controlfile.
CHAPTER 5 Managing Control Files, Online Redo Logs, and Archiving.
9 Copyright © Oracle Corporation, All rights reserved. Oracle Recovery Manager Overview and Configuration.
CHAPTER 17 Configuring RMAN. Introduction to RMAN RMAN was introduced in Oracle 8.0. RMAN is Oracle’s tool for backup and recovery. RMAN is much more.
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
Navigating the Oracle Backup Maze Robert Spurzem Senior Product Marketing Manager
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 12: Managing and Implementing Backups and Disaster Recovery.
20 Copyright © 2004, Oracle. All rights reserved. Database Recovery.
13 Copyright © Oracle Corporation, All rights reserved. RMAN Complete Recovery.
PPOUG, 05-OCT-01 Agenda RMAN Architecture Why Use RMAN? Implementation Decisions RMAN Oracle9i New Features.
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.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 12: Managing and Implementing Backups and Disaster Recovery.
Backup & Recovery Backup and Recovery Strategies on Windows Server 2003.
16 Copyright © 2007, Oracle. All rights reserved. Performing Database Recovery.
CSE 781 – DATABASE MANAGEMENT SYSTEMS Introduction To Oracle 10g Rajika Tandon.
15 Copyright © 2007, Oracle. All rights reserved. Performing Database Backups.
The protection of the DB against intentional or unintentional threats using computer-based or non- computer-based controls. Database Security – Part 2.
A Guide to Oracle9i1 Database Instance startup and shutdown.
11 DISASTER RECOVERY Chapter 13. Chapter 13: DISASTER RECOVERY2 OVERVIEW  Back up server data using the Backup utility and the Ntbackup command  Restore.
IT Database Administration SECTION 01. Starting Up and Shutting Down the Database Database Administration Facilities – A number of tools are available.
Advanced Databases DBA: Security and Backups Guide to Oracle 10g 1.
IT Database Administration Section 09. Backup and Recovery Backup: The available options Full Consistent (cold) Backup Database shutdown, all files.
Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
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.
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.
3 Copyright © 2007, Oracle. All rights reserved. Using the RMAN Recovery Catalog.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
19 Copyright © 2004, Oracle. All rights reserved. Database Backups.
14 Copyright © 2007, Oracle. All rights reserved. Backup and Recovery Concepts.
How To Pass Oracle 1z0-060 Exam In First Attempt?
Backup and Recovery (1) Oracle 10g Hebah ElGibreen CAP364.
Duplicating a Database
Performing Database Recovery
Database Backup and Recovery
UTILITY TO EXPORT/IMPORT DATA Gary M. Noble LDS Church
Presentation transcript:

IS 4510 – Database Administration Module – 2 Database Backup 10/24/20141Compiled by: Zafar Iqbal Khan

Objectives After the completion of this module, you will be able to Outline number of ways database backup can be performed Distinguish between logical & physical backup Understand export & import processes for oracle backup 10/24/2014Compiled by: Zafar Iqbal Khan2

Database Backup Whole database and the log are periodically copied onto a cheap storage medium such as magnetic tapes or other large capacity offline storage devices. In case of a catastrophic system failure, the latest backup copy can be reloaded from the tape to the disk, and the system can be restarted. Data from critical applications such as banking, insurance, stock market, and other similar databases is periodically backed up in its entirety and moved to physically separate safe locations. 10/24/2014Compiled by: Zafar Iqbal Khan3

Database Backup contd… There are three standard methods, and two types of backups available- Methods- – Exports – Offline backups – Online backups Types – Logical Backups – Physical Backups 10/24/2014Compiled by: Zafar Iqbal Khan4

Database Backup contd… DB backup Physical backup Online backup Offline backup Logical backup Exports 10/24/2014Compiled by: Zafar Iqbal Khan5

Physical Backups Physical backups involve copying the files that constitute the database. These backups are also referred to as file system backups because they involve using operating system file backup commands. Oracle supports two different types of physical file backups: offline backups and the online backups (also known as cold and hot backups, respectively). 10/24/2014Compiled by: Zafar Iqbal Khan6

Offline Backups Consistent offline backups occur when the database has been shut down normally (that is, not due to instance failure) using the normal, immediate, or transactional option of the shutdown command. While the database is “offline,” the following files should be backed up:- 1.All data files 2.All control files 3.All archived redo log files 4.The init.ora file or server parameter file (SPFILE) 10/24/2014Compiled by: Zafar Iqbal Khan7

Offline Backups contd… Having all these files backed up while the database is closed provides a complete image of the database as it existed at the time it was closed. The full set of these files could be retrieved from the backups at a later date, and the database would be able to function 10/24/2014Compiled by: Zafar Iqbal Khan8

Online Backups Online backups could be made for any database that is running in ARCHIVELOG mode. In this mode, the online redo logs are archived, creating a log of all transactions within the database. An online backup involves setting each tablespace into a backup state, backing up its datafiles, and then restoring the tablespace to its normal state. 10/24/2014Compiled by: Zafar Iqbal Khan9

Online Backups contd… The database can be fully recovered from an online backup, and with the help of archived redo logs files, could be restored to any point in time before the failure. When the database is then opened, any committed transactions that were in the database at the time of the failure will have been restored, and any uncommitted transactions will have been rolled back. While the database is open, the following files can be backed up: 1.All data files 2.All archived redo log files 3.One control file, via the alter database backup control file 4.The server parameter file (SPFILE) 10/24/2014Compiled by: Zafar Iqbal Khan10

Online Backups contd… Online backup procedures are very powerful for two reasons. First, they provide full point-in-time recovery. Second, they allow the database to remain open during the file system backup. Even databases that cannot be shut down due to user requirements can still have file-system backups. Keeping the database open also keeps the System Global Area (SGA) of the database instance from being cleared when the database is shut down and restarted. Keeping the SGA memory from being cleared will improve the database’s performance because it will reduce the number of physical I/Os required by the database 10/24/2014Compiled by: Zafar Iqbal Khan11

Data Pump Export and Import This feature was introduced in Oracle 10g, data pump provides a server-based data-extraction and data-import facility. Its feature include significant architectural and functional upgrade over the original import and export utilities. It has many powerful and effective enhancement viz. ability to stop and restart job, see the status of running job, and restrict the data that is exported and imported. 10/24/2014Compiled by: Zafar Iqbal Khan12

Data Pump Export and Import contd… Because data pump runs as server process, gives users benefits in many ways: – Client process that starts the job may be detached and later on reconnected as required – Faster in contrast to original export/import as processing of data takes place at server – Has capabilities of being parallelized data pump export and loads adding further performance enhancement 10/24/2014Compiled by: Zafar Iqbal Khan13

Creating a Directory Data pump operation requires that you create a directory to stores data and log files before starting the process. First create a folder with sought name on windows explorer then map it at oracle from following command: SQL> create directory datapumpEXIM as 'd:\datapump'; Directory created. SQL> grant read, write on directory datapumpEXIM to HR; Grant succeeded. You have to login from sys as sysdba for doing this job Directory can be created on local server, network server or any other node attached to the Network, provided it is accessible and read/write permission has been granted over it. 10/24/2014Compiled by: Zafar Iqbal Khan14

Data Pump Export Options Oracle provides a utility viz. ‘expdp’ which acts like interface to data pump, there are some input parameters for expdp when job is created, there are five modes for expdp export 1.Fullexport all database data & metadata 2.Schemaexport data & metadata for specific user 3.Tablespaceexport data & metadata for tablespaces 4.Tableexport data & metadata for tables and table partitions 5.Transportable Tablespaceexport metadata for specific tablespaces in preparation for transporting a tablespace from one database to another 10/24/2014Compiled by: Zafar Iqbal Khan15

10/24/2014Compiled by: Zafar Iqbal Khan16 Data Pump Export Options contd…

Starting a Data Pump Export Job You can store your job parameters in a parameter file, referenced via the PARFILE parameter of expdp. E.g. we can create a file named dp_rjb.par with the following entries: directory= datapumpEXIM dumpfile=metadata_only.dmp content=metadata_only To initiate a data pump job, use following command C:\>expdp hr/hr parfile=dp_rjb.par 10/24/2014Compiled by: Zafar Iqbal Khan17

Starting a Data Pump Export Job contd.. We can use multiple directories and dump files for a single Data Pump export. Within the DUMPFILE parameter setting, list the directory along with the filename, in this format: DUMPFILE=directory1:file1.dmp, directory2:file2.dmp Using multiple directories in the DUMPFILE parameter has two benefits: the Data Pump job can use parallel processes (using the PARALLEL parameter), in addition to spreading out the dump file to wherever disk space is available. we can also use the substitution variable %U in the filename specification to automatically create multiple dump files that can be written to by multiple processes automatically. Even if only one process is writing the dump file, using the %U substitution variable in combination with the FILESIZE parameter will limit the size of each dump file. 10/24/2014Compiled by: Zafar Iqbal Khan18

Starting a Data Pump Import Job We can start data pump import with ‘impdp’ utility provided with Oracle 11g with following command: On command prompt write C:\> impdp hr/hr directory= datapumpEXIM dumpfile=employee.dmp logfile=imp.log – Here hr/hrusername/password datapumpEXIMdirectory made for export/import employees.dmpdump file created by export process Imp.loglog file created by import process 10/24/2014Compiled by: Zafar Iqbal Khan19

Stopping and Restarting Running Jobs Once we have started a Data Pump Import job, we can close the client window we used to start the job. Because it is server based, the import will continue to run. we can then attach to the job, later after some time check its status, and alter it: impdp hr/hr parfile=hr_dp_imp.par //hr_dp_imp.par is a parameter file Press CTRL-C to leave the log display, and Data Pump Import will return you to the import prompt: Import> Exit to the operating system using the exit_client command: Import> exit_client Later, we can restart the client and attach to the currently running job under our schema: impdp hr/hr attach You can then issue the continue_client command to see the log entries as they are generated, or you can alter the running job. Import> continue_client Not surprisingly, you can temporarily stop a job using the stop_job command: Import> stop_job While the job is stopped, you can increase its parallelism via the parallel option, and then restart the job: Import> start_job 10/24/2014Compiled by: Zafar Iqbal Khan20

Integration of Logical and Physical Backups MethodTypeRecovery Characteristics Data Pump ExportLogical Can recover any database object to its status as of the moment it was exported. Offline backupsPhysical Can recover the database to its status as of the moment it was shut down. If the database is run in ARCHIVELOG mode, you can recover the database to a status at any point in time. Online backupsPhysical Can recover the database to its status at any point in time 10/24/2014Compiled by: Zafar Iqbal Khan21

Integration of Logical and Physical Backups contd… Offline backups are the least flexible method of backing up the database if the database is running in NOARCHIVELOG mode. Offline backups are a point-in-time snapshot of the database. Also, because they are a physical backup, DBAs cannot selectively recover logical objects (such as tables) from them. Online backups, with the database running in ARCHIVELOG mode, allow you to recover the database to the point in time immediately preceding a system fault or a user error. Using a Data Pump Export-based strategy would limit you to only being able to go back to the data as it existed the last time the data was exported. A good backup strategy combines both logical and physical backups Data Pump Export validates that the data is logically sound, and physical backups that it is physically sound. A good database backup strategy integrates logical and physical backups. 10/24/2014Compiled by: Zafar Iqbal Khan22