8 Copyright © 2007, Oracle. All rights reserved. Using RMAN to Duplicate a Database.

Slides:



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

4 Copyright © 2005, Oracle. All rights reserved. Managing the Oracle Instance.
Oracle Architecture. Instances and Databases (1/2)
1 Chapter 15 Duplicating Databases and Transporting Data.
1 Getting The Most Out of RMAN By: Charles Pfeiffer CIO, Remote Control DBA (888)
5 Copyright © 2006, Oracle. All rights reserved. Database Recovery.
Database Backup and Recovery
RMAN Restore and Recovery
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.
Oracle’s Backup and Recovery Tool
Configuring Recovery Manager
4 Copyright © 2008, Oracle. All rights reserved. Configuring Backup Specifications.
Chapter 5 Configuring the RMAN Environment. Objectives Show command to see existing settings Configure command to change settings Backing up the controlfile.
9 Copyright © Oracle Corporation, All rights reserved. Oracle Recovery Manager Overview and Configuration.
The Oracle Recovery Manager (RMAN)
Backup Concepts. Introduction Backup and recovery procedures protect your database against data loss and reconstruct the data, should loss occur. The.
CHAPTER 18 RMAN Backups and Reporting. Introduction to RMAN Backups and Reporting The focus of this chapter is backups of: Datafiles Control files Archived.
Agenda  Overview  Configuring the database for basic Backup and Recovery  Backing up your database  Restore and Recovery Operations  Managing your.
Introduction to Oracle Backup and Recovery
Using RMAN to Perform 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.
Recovery Manager Overview Target Database Recovery Catalog Database Enterprise Manager Recovery Manager (RMAN) Media Options Server Session.
5 Copyright © 2004, Oracle. All rights reserved. Using Recovery Manager.
5 Copyright © 2008, Oracle. All rights reserved. Using RMAN to Create Backups.
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.
Backup and Recovery Protects From Data Loss. Backup and Recovery Protects From Data Loss Provides for Media Recovery.
11 Copyright © Oracle Corporation, All rights reserved. RMAN Backups.
Chapter 9 Scripting RMAN. Background Authors felt that scripting was a topic not covered well Authors wanted to cover both Unix/Linux and Windows environments.
15 Copyright © 2005, Oracle. All rights reserved. Performing Database Backups.
Backup & Recovery Backup and Recovery Strategies on Windows Server 2003.
16 Copyright © 2007, Oracle. All rights reserved. Performing Database Recovery.
15 Copyright © 2007, Oracle. All rights reserved. Performing Database Backups.
9 Copyright © 2004, Oracle. All rights reserved. Flashback Database.
An Oracle server:  Is a database management system that provides an open, comprehensive, integrated approach to information management.  Consists.
17 Copyright © Oracle Corporation, All rights reserved. Recovery Catalog Creation and Maintenance.
Chapter 8Oracle9i DBA II: Backup/Recovery and Network Administration 1 Chapter 8 Complete Recovery with Recovery Manager.
15 Copyright © Oracle Corporation, All rights reserved. RMAN Incomplete Recovery.
3 Copyright © 2009, Oracle. All rights reserved. Creating an Oracle Database Using DBCA.
8 Copyright © Oracle Corporation, All rights reserved. Configuring the Database Archiving Mode.
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.
18 Copyright © 2004, Oracle. All rights reserved. Backup and Recovery Concepts.
6 Copyright © 2007, Oracle. All rights reserved. Performing User-Managed Backup and Recovery.
2 Copyright © 2007, Oracle. All rights reserved. Configuring for Recoverability.
2 Copyright © 2006, Oracle. All rights reserved. Configuring Recovery Manager.
16 Copyright © 2005, Oracle. All rights reserved. Performing Database Recovery.
3 Copyright © 2004, Oracle. All rights reserved. Creating an Oracle Database.
3 Copyright © 2007, Oracle. All rights reserved. Using the RMAN Recovery Catalog.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
10 Copyright © 2007, Oracle. All rights reserved. Using RMAN Enhancements.
19 Copyright © 2004, Oracle. All rights reserved. Database Backups.
3 Copyright © 2006, Oracle. All rights reserved. Installation and Administration Basics.
9 Copyright © 2004, Oracle. All rights reserved. Incomplete Recovery.
4 Copyright © 2004, Oracle. All rights reserved. Managing the Oracle Instance.
Control File Information The database name The timestamp of database creation The names and locations of associated datafiles and redo log files Tablespace.
5 Copyright © 2005, Oracle. All rights reserved. Managing the Oracle Instance.
RMAN Maintenance.
Is 221: Database Administration
Performing Tablespace Point-in-Time Recovery
Performing Tablespace Point-in-Time Recovery
Duplicating a Database
Performing Database Recovery
Presentation transcript:

8 Copyright © 2007, Oracle. All rights reserved. Using RMAN to Duplicate a Database

Copyright © 2007, Oracle. All rights reserved Objectives After completing this lesson, you should be able to: List the purposes of creating a duplicate database List the methods of duplicating a database Duplicate a database using RMAN Use an RMAN backup to duplicate a database Duplicate a database based on a running instance

Copyright © 2007, Oracle. All rights reserved Using RMAN to Create a Duplicate Database Use the RMAN DUPLICATE command to create a duplicate database using target database backups. Archived redo log files Data file backups Target database Auxiliary instance

Copyright © 2007, Oracle. All rights reserved Using a Duplicate Database You can use a duplicate database to: Test backup and recovery procedures Recover objects by creating an export and importing the objects into the production database

Copyright © 2007, Oracle. All rights reserved Creating a Duplicate Database 1.Create an Oracle password file for the auxiliary instance. 2.Establish Oracle Net connectivity to the auxiliary instance. 3.Create an initialization parameter file for the auxiliary instance. 4.Start the auxiliary instance in NOMOUNT mode. 5.Mount or open the target database. 6.Ensure that backups and archived redo log files are available. 7.Allocate auxiliary channels if needed. 8.Execute the DUPLICATE command.

Copyright © 2007, Oracle. All rights reserved Creating an Initialization Parameter File for the Auxiliary Instance Specify parameters as follows: DB_NAME –If the duplicate database is in the same Oracle home as the target database, names must be different. –Use the same value in the DUPLICATE command. DB_BLOCK_SIZE –Specify the same value as set for the target database.

Copyright © 2007, Oracle. All rights reserved Specifying Parameters for Control File Naming Specify the following parameters to control the naming of the files of your auxiliary database: CONTROL_FILES DB_FILE_NAME_CONVERT LOG_FILE_NAME_CONVERT CONTROL_FILES='/u01/app/oracle/oradata/aux/control01.ctl', '/u01/app/oracle/oradata/aux/control02.ctl', '/u01/app/oracle/oradata/aux/control03.ctl' DB_FILE_NAME_CONVERT='/u01/app/oracle/oradata/orcl', '/u01/app/oracle/oradata/aux' LOG_FILE_NAME_CONVERT='/u01/app/oracle/oradata/orcl', '/u01/app/oracle/oradata/aux'

Copyright © 2007, Oracle. All rights reserved Specifying Parameters to Control File Naming Full Notes Page

Copyright © 2007, Oracle. All rights reserved Starting the Instance in NOMOUNT Mode Start the auxiliary instance in NOMOUNT mode. Create a server parameter file (SPFILE) from the text initialization parameter file you used to start the instance. SQL> startup nomount pfile='$HOME/auxinstance/initAUX.ora' ORACLE instance started. Total System Global Area bytes Fixed Size bytes Variable Size bytes Database Buffers bytes Redo Buffers bytes SQL> create spfile 2 from pfile='$HOME/auxinstance/initAUX.ora'; File created.

Copyright © 2007, Oracle. All rights reserved Ensuring That Backups and Archived Redo Log Files Are Available Backups of all target database data files must be accessible on the duplicate host. Backups can be a combination of full and incremental backups. Archived redo log files needed to recover the duplicate database must be accessible on the duplicate host. Archived redo log files can be: –Backups on a media manager –Image copies –Actual archived redo log files

Copyright © 2007, Oracle. All rights reserved Allocating Auxiliary Channels Auxiliary channels specify a connection between RMAN and an auxiliary database instance. If automatic channels are not configured, allocate auxiliary channels: –Start RMAN with a connection to the target database, the auxiliary instance, and recovery catalog if applicable. –Allocate at least one auxiliary channel within the RUN block. $ rman target auxiliary RMAN> RUN {ALLOCATE AUXILIARY CHANNEL aux1 DEVICE TYPE DISK; ALLOCATE AUXILIARY CHANNEL aux2 DEVICE TYPE DISK; …

Copyright © 2007, Oracle. All rights reserved Using the RMAN DUPLICATE Command Connect to the target database and the auxiliary instance. Specify the same database name that you used in the DB_NAME initialization parameter. RMAN> RUN {ALLOCATE AUXILIARY CHANNEL aux1 DEVICE TYPE DISK; ALLOCATE AUXILIARY CHANNEL aux2 DEVICE TYPE DISK; … DUPLICATE TARGET DATABASE to auxdb; }

Copyright © 2007, Oracle. All rights reserved Understanding the RMAN Duplication Operation When you execute the DUPLICATE command, RMAN performs the following operations: Creates a control file for the duplicate database Restores the target data files to the duplicate database Performs incomplete recovery using all available incremental backups and archived redo log files Shuts down and restarts the auxiliary instance Opens the duplicate database with the RESETLOGS option Creates the online redo log files Generates a new, unique database identifier (DBID) for the duplicate database

Copyright © 2007, Oracle. All rights reserved Specifying Options for the DUPLICATE Command You can specify the following options with the DUPLICATE command: Enable RESTRICTED SESSION automatically OPEN RESTRICTED Exclude read-only tablespaces SKIP READONLY Prevent checking of file names NOFILENAMECHECK SKIP TABLESPACE Option Exclude named tablespaces Purpose

Copyright © 2007, Oracle. All rights reserved Using EM to Clone a Database Running instance Existing backup Clone database Staging area Or

Copyright © 2007, Oracle. All rights reserved Cloning a Running Database Clone a database using one of these sources: Open database in ARCHIVELOG mode Open database in NOARCHIVELOG mode Existing database backup

Copyright © 2007, Oracle. All rights reserved Cloning a Running Database

Copyright © 2007, Oracle. All rights reserved Cloning a Running Database

Copyright © 2007, Oracle. All rights reserved Cloning a Running Database From source database

Copyright © 2007, Oracle. All rights reserved Cloning a Database from a Backup Existing backup location

Copyright © 2007, Oracle. All rights reserved Summary In this lesson, you should have learned how to: List the purposes of creating a duplicate database List the methods of duplicating a database Duplicate a database using RMAN Use an RMAN backup to duplicate a database Duplicate a database based on a running instance

Copyright © 2007, Oracle. All rights reserved Practice 8 Overview: Using RMAN to Duplicate a Database This practice covers the following topic: Cloning a database using an RMAN backup