SlideShare a Scribd company logo
1 of 25
Copyright © 2009, Oracle. All rights reserved.
Duplicating a Database
Copyright © 2009, Oracle. All rights reserved.
20 - 2
Objectives
After completing this lesson, you should be able to:
• List the purposes of creating a duplicate database
• Choose a technique for duplicating a database
• Duplicate a database with RMAN
• Use an RMAN backup to duplicate a database
• Duplicate a database based on a running instance
Copyright © 2009, Oracle. All rights reserved.
20 - 3
Using a Duplicate Database
• Using a duplicate database to:
– Test backup and recovery procedures
– Recover objects by creating an export and importing the
objects into the production database
• Creating a duplicate database:
– With the RMAN DUPLICATE command
– On the same or separate hosts
– With the identical content, or subset of source
– Performed by auxiliary channels for backup-up based
duplication
– Performed by target channels for active database duplication
Copyright © 2009, Oracle. All rights reserved.
20 - 4
Choosing Database Duplication Techniques
Choosing a technique to duplicate your database—always with
connection to the auxiliary instance:
From an active database,
connected to the target instance
From backups
With target
connection
Without target
connection
With recovery
catalog connection
Without recovery
catalog connection
Copyright © 2009, Oracle. All rights reserved.
20 - 5
Duplicating an Active Database
• With network (no backups required)
• Including customized SPFILE
• Via Enterprise Manager or RMAN command line
Source
instance
Source
database
RMAN client
Source host
Auxiliary
instance
Duplicate
database
Destination
host
Connect
target
Connect
auxiliary
Copyright © 2009, Oracle. All rights reserved.
20 - 6
Duplicating a Database with a Target Connection
• Connecting to the target (source database)
• Connecting to the auxiliary instance
• Optionally, connecting to the recovery catalog (or using
target control file)
Source
instance
Source
database
RMAN client
Source host
Auxiliary
instance
Duplicate
database
Destination
host
Connect
target
Connect
auxiliary
RMAN
backups
Copyright © 2009, Oracle. All rights reserved.
20 - 7
Duplicating a Database with Recovery Catalog
Without Target Connection
• Connecting to a recovery catalog for backup metadata
• Connecting to the auxiliary instance, which must have
access to the RMAN backups
RMAN client
Auxiliary
instance
Duplicate
database
Destination
host
Connect
catalog
Connect
auxiliary
RMAN
backups
Catalog
instance
Recovery
catalog
database
Recovery
catalog host
Copyright © 2009, Oracle. All rights reserved.
20 - 8
Duplicating a Database Without Recovery
Catalog or Target Connection
Connecting to the auxiliary instance, which must have access
to a disk BACKUP LOCATION
RMAN client
Auxiliary
instance
Duplicate
database
Destination
host
Connect
auxiliary
Backup location
Copyright © 2009, Oracle. All rights reserved.
20 - 9
Creating a Backup-Based 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 © 2009, Oracle. All rights reserved.
20 - 10
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 © 2009, Oracle. All rights reserved.
20 - 11
Specifying New Names for Your Destination
Available techniques:
• SET NEWNAME command
• CONFIGURE AUXNAME command (deprecated for recovery
set data files)
• DB_FILE_NAME_CONVERT parameter with the
DUPLICATE command
Copyright © 2009, Oracle. All rights reserved.
20 - 12
Using the SET NEWNAME Clauses
• SET NEWNAME clauses enable you to specify a default
name format for all files in a database or in a named
tablespace.
• The default name is used for DUPLICATE, RESTORE, and
SWITCH commands in the RUN block.
• It enables you to set file names with a single command
rather than setting each file name individually.
SET NEWNAME FOR DATABASE
TO {NEW|'formatSpec'};
Copyright © 2009, Oracle. All rights reserved.
20 - 13
Substitution Variables for SET NEWNAME
Syntax
Element
Description
%b Specifies the file name without the directory path
%f Specifies the absolute file number of the data file for which the new
name is generated
%I Specifies the DBID
%N Specifies the tablespace name
%U Specifies a system-generated file name of the format:
data-D-%d_id-%I_TS-%N_FNO-%f
Copyright © 2009, Oracle. All rights reserved.
20 - 14
Specifying Parameters for File Naming
Alternatively, specify the following parameters to explicitly
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 © 2009, Oracle. All rights reserved.
20 - 16
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 285212672 bytes
Fixed Size 1218992 bytes
Variable Size 92276304 bytes
Database Buffers 188743680 bytes
Redo Buffers 2973696 bytes
SQL> create spfile
2 from pfile='$HOME/auxinstance/initAUX.ora';
File created.
Copyright © 2009, Oracle. All rights reserved.
20 - 17
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 © 2009, Oracle. All rights reserved.
20 - 18
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
instance, the auxiliary instance, and recovery catalog if
applicable.
– Allocate at least one auxiliary channel within the RUN block.
$ rman target sys/oracle_4U@trgt auxiliary
sys/oracle_4U@auxdb
RMAN> RUN
{ALLOCATE AUXILIARY CHANNEL aux1 DEVICE TYPE DISK;
ALLOCATE AUXILIARY CHANNEL aux2 DEVICE TYPE DISK;
…
DUPLICATE TARGET DATABASE to auxdb; . . .
Copyright © 2009, Oracle. All rights reserved.
20 - 19
Understanding the RMAN Duplication Operation
When you execute the DUPLICATE command, RMAN performs
the following operations:
1A.Creates a control file server parameter file for the auxiliary
instance (for active and for backup-based duplication with
target connection) , or:
1B.Restores from backup (for standby database and for
backup-based duplication without target connection)
2. Mounts the backup control file
3. For backup-based duplication: Selects the backups for
restoring the data files to the auxiliary instance
4. Restores the target data files to the duplicate database
5. Performs incomplete recovery using all available
incremental backups and archived redo log files
Copyright © 2009, Oracle. All rights reserved.
20 - 20
Understanding the RMAN Duplication Operation
When you execute the DUPLICATE command, RMAN performs
the following operations:
6. Shuts down and restarts the auxiliary instance in NOMOUNT
mode
7. Creates a new control file, which then creates and stores
the new DBID in the data files
8. Opens the duplicate database with the RESETLOGS option
9. Creates the online redo log files for the duplicate database
Note: The database duplication process attempts to
resume from the point-of-failure upon reexecution.
Copyright © 2009, Oracle. All rights reserved.
20 - 21
Specifying Options for the DUPLICATE Command
You can specify the following options with the DUPLICATE command:
Option Purpose
SKIP READONLY Excludes read-only tablespaces
SKIP TABLESPACE Excludes named tablespaces
TABLESPACE Includes named tablespaces
NOFILENAMECHECK Prevents checking of file names
OPEN RESTRICTED Enables RESTRICTED SESSION automatically
Copyright © 2009, Oracle. All rights reserved.
20 - 22
Using Additional DUPLICATE Command Options
Option Purpose
NOREDO Signals RMAN that the application of redo logs should be
suppressed during recovery
Must be used with targetless DUPLICATE when target
database is in NOARCHIVELOG mode at backup time
Can also be used to explicitly state that no archived redo
log files should be applied
UNDO TABLESPACE Must be specified when target database is not open and
there is no recovery catalog connection so that RMAN
does not check the tablespace for SYS-owned objects
Copyright © 2009, Oracle. All rights reserved.
20 - 23
Using EM to Clone a Database
Copyright © 2009, Oracle. All rights reserved.
20 - 24
Quiz
Select all statements that are true about database duplication:
1. You can duplicate a database with or without connection to
the auxiliary instance.
2. You can duplicate a database with or without connection to
the recovery catalog.
3. You can duplicate a database with or without target
connection.
4. You can duplicate a database only when you have RMAN
backups.
5. You always have to manually re-create control files on the
auxiliary instance.
Copyright © 2009, Oracle. All rights reserved.
20 - 25
Summary
In this lesson, you should have learned how to:
• List the purposes of creating a duplicate database
• Choose a technique for duplicating a database
• Duplicate a database with RMAN
• Use an RMAN backup to duplicate a database
• Duplicate a database based on a running instance
Copyright © 2009, Oracle. All rights reserved.
20 - 26
Practice 20 Overview:
Duplicating a Database
This practice covers cloning a database and using utilities to
complete the setup of a functioning duplicated database.

More Related Content

Similar to 15362590.ppt

D17316 gc20 l05_phys_sql
D17316 gc20 l05_phys_sqlD17316 gc20 l05_phys_sql
D17316 gc20 l05_phys_sqlMoeen_uddin
 
RMAN in 12c: The Next Generation (WP)
RMAN in 12c: The Next Generation (WP)RMAN in 12c: The Next Generation (WP)
RMAN in 12c: The Next Generation (WP)Gustavo Rene Antunez
 
Oracle Database Backup
Oracle Database BackupOracle Database Backup
Oracle Database BackupHandy_Backup
 
DBAII_R1_1_Les17_E_075812.pptx
DBAII_R1_1_Les17_E_075812.pptxDBAII_R1_1_Les17_E_075812.pptx
DBAII_R1_1_Les17_E_075812.pptxsingbling
 
Rman cloning guide
Rman cloning guideRman cloning guide
Rman cloning guideAmit87_dba
 
Collaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mysteryCollaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mysteryNelson Calero
 
Backup and recovery in oracle
Backup and recovery in oracleBackup and recovery in oracle
Backup and recovery in oraclesadegh salehi
 
Les 02 Config Rec
Les 02 Config RecLes 02 Config Rec
Les 02 Config Recvivaankumar
 
11 Understanding and Influencing the PL/SQL Compilar
11 Understanding and Influencing the PL/SQL Compilar11 Understanding and Influencing the PL/SQL Compilar
11 Understanding and Influencing the PL/SQL Compilarrehaniltifat
 
Oracle backup and recovery
Oracle backup and recoveryOracle backup and recovery
Oracle backup and recoveryYogiji Creations
 
Corporate-informatica-training-in-mumbai
Corporate-informatica-training-in-mumbaiCorporate-informatica-training-in-mumbai
Corporate-informatica-training-in-mumbaiUnmesh Baile
 
Corporate-informatica-training-in-mumbai
Corporate-informatica-training-in-mumbaiCorporate-informatica-training-in-mumbai
Corporate-informatica-training-in-mumbaiUnmesh Baile
 
Less14 Br Concepts
Less14 Br ConceptsLess14 Br Concepts
Less14 Br Conceptsvivaankumar
 
Mid term & final- preparation- student-review(Oracle)
Mid term & final- preparation- student-review(Oracle)Mid term & final- preparation- student-review(Oracle)
Mid term & final- preparation- student-review(Oracle)than sare
 

Similar to 15362590.ppt (20)

D17316 gc20 l05_phys_sql
D17316 gc20 l05_phys_sqlD17316 gc20 l05_phys_sql
D17316 gc20 l05_phys_sql
 
Les 04 config_bu
Les 04 config_buLes 04 config_bu
Les 04 config_bu
 
RMAN in 12c: The Next Generation (WP)
RMAN in 12c: The Next Generation (WP)RMAN in 12c: The Next Generation (WP)
RMAN in 12c: The Next Generation (WP)
 
Oracle Database Backup
Oracle Database BackupOracle Database Backup
Oracle Database Backup
 
DBAII_R1_1_Les17_E_075812.pptx
DBAII_R1_1_Les17_E_075812.pptxDBAII_R1_1_Les17_E_075812.pptx
DBAII_R1_1_Les17_E_075812.pptx
 
Les 03 Catalog
Les 03 CatalogLes 03 Catalog
Les 03 Catalog
 
Rman cloning guide
Rman cloning guideRman cloning guide
Rman cloning guide
 
Collaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mysteryCollaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mystery
 
Les 02 config
Les 02 configLes 02 config
Les 02 config
 
Backup and recovery in oracle
Backup and recovery in oracleBackup and recovery in oracle
Backup and recovery in oracle
 
Les 02 Config Rec
Les 02 Config RecLes 02 Config Rec
Les 02 Config Rec
 
Xpp c user_rec
Xpp c user_recXpp c user_rec
Xpp c user_rec
 
Plsql les04
Plsql les04Plsql les04
Plsql les04
 
11 Understanding and Influencing the PL/SQL Compilar
11 Understanding and Influencing the PL/SQL Compilar11 Understanding and Influencing the PL/SQL Compilar
11 Understanding and Influencing the PL/SQL Compilar
 
Oracle backup and recovery
Oracle backup and recoveryOracle backup and recovery
Oracle backup and recovery
 
5895640.ppt
5895640.ppt5895640.ppt
5895640.ppt
 
Corporate-informatica-training-in-mumbai
Corporate-informatica-training-in-mumbaiCorporate-informatica-training-in-mumbai
Corporate-informatica-training-in-mumbai
 
Corporate-informatica-training-in-mumbai
Corporate-informatica-training-in-mumbaiCorporate-informatica-training-in-mumbai
Corporate-informatica-training-in-mumbai
 
Less14 Br Concepts
Less14 Br ConceptsLess14 Br Concepts
Less14 Br Concepts
 
Mid term & final- preparation- student-review(Oracle)
Mid term & final- preparation- student-review(Oracle)Mid term & final- preparation- student-review(Oracle)
Mid term & final- preparation- student-review(Oracle)
 

More from hesham alataby

More from hesham alataby (8)

Frames.ppt
Frames.pptFrames.ppt
Frames.ppt
 
HyperLinks.ppt
HyperLinks.pptHyperLinks.ppt
HyperLinks.ppt
 
Images_Amended.ppt
Images_Amended.pptImages_Amended.ppt
Images_Amended.ppt
 
Tables.ppt
Tables.pptTables.ppt
Tables.ppt
 
TextTags.1.ppt
TextTags.1.pptTextTags.1.ppt
TextTags.1.ppt
 
TextTags.2.ppt
TextTags.2.pptTextTags.2.ppt
TextTags.2.ppt
 
fdocuments.in_the-model-clause-explained (1).pptx
fdocuments.in_the-model-clause-explained (1).pptxfdocuments.in_the-model-clause-explained (1).pptx
fdocuments.in_the-model-clause-explained (1).pptx
 
7035416.ppt
7035416.ppt7035416.ppt
7035416.ppt
 

Recently uploaded

Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 

Recently uploaded (20)

Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 

15362590.ppt

  • 1. Copyright © 2009, Oracle. All rights reserved. Duplicating a Database
  • 2. Copyright © 2009, Oracle. All rights reserved. 20 - 2 Objectives After completing this lesson, you should be able to: • List the purposes of creating a duplicate database • Choose a technique for duplicating a database • Duplicate a database with RMAN • Use an RMAN backup to duplicate a database • Duplicate a database based on a running instance
  • 3. Copyright © 2009, Oracle. All rights reserved. 20 - 3 Using a Duplicate Database • Using a duplicate database to: – Test backup and recovery procedures – Recover objects by creating an export and importing the objects into the production database • Creating a duplicate database: – With the RMAN DUPLICATE command – On the same or separate hosts – With the identical content, or subset of source – Performed by auxiliary channels for backup-up based duplication – Performed by target channels for active database duplication
  • 4. Copyright © 2009, Oracle. All rights reserved. 20 - 4 Choosing Database Duplication Techniques Choosing a technique to duplicate your database—always with connection to the auxiliary instance: From an active database, connected to the target instance From backups With target connection Without target connection With recovery catalog connection Without recovery catalog connection
  • 5. Copyright © 2009, Oracle. All rights reserved. 20 - 5 Duplicating an Active Database • With network (no backups required) • Including customized SPFILE • Via Enterprise Manager or RMAN command line Source instance Source database RMAN client Source host Auxiliary instance Duplicate database Destination host Connect target Connect auxiliary
  • 6. Copyright © 2009, Oracle. All rights reserved. 20 - 6 Duplicating a Database with a Target Connection • Connecting to the target (source database) • Connecting to the auxiliary instance • Optionally, connecting to the recovery catalog (or using target control file) Source instance Source database RMAN client Source host Auxiliary instance Duplicate database Destination host Connect target Connect auxiliary RMAN backups
  • 7. Copyright © 2009, Oracle. All rights reserved. 20 - 7 Duplicating a Database with Recovery Catalog Without Target Connection • Connecting to a recovery catalog for backup metadata • Connecting to the auxiliary instance, which must have access to the RMAN backups RMAN client Auxiliary instance Duplicate database Destination host Connect catalog Connect auxiliary RMAN backups Catalog instance Recovery catalog database Recovery catalog host
  • 8. Copyright © 2009, Oracle. All rights reserved. 20 - 8 Duplicating a Database Without Recovery Catalog or Target Connection Connecting to the auxiliary instance, which must have access to a disk BACKUP LOCATION RMAN client Auxiliary instance Duplicate database Destination host Connect auxiliary Backup location
  • 9. Copyright © 2009, Oracle. All rights reserved. 20 - 9 Creating a Backup-Based 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.
  • 10. Copyright © 2009, Oracle. All rights reserved. 20 - 10 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.
  • 11. Copyright © 2009, Oracle. All rights reserved. 20 - 11 Specifying New Names for Your Destination Available techniques: • SET NEWNAME command • CONFIGURE AUXNAME command (deprecated for recovery set data files) • DB_FILE_NAME_CONVERT parameter with the DUPLICATE command
  • 12. Copyright © 2009, Oracle. All rights reserved. 20 - 12 Using the SET NEWNAME Clauses • SET NEWNAME clauses enable you to specify a default name format for all files in a database or in a named tablespace. • The default name is used for DUPLICATE, RESTORE, and SWITCH commands in the RUN block. • It enables you to set file names with a single command rather than setting each file name individually. SET NEWNAME FOR DATABASE TO {NEW|'formatSpec'};
  • 13. Copyright © 2009, Oracle. All rights reserved. 20 - 13 Substitution Variables for SET NEWNAME Syntax Element Description %b Specifies the file name without the directory path %f Specifies the absolute file number of the data file for which the new name is generated %I Specifies the DBID %N Specifies the tablespace name %U Specifies a system-generated file name of the format: data-D-%d_id-%I_TS-%N_FNO-%f
  • 14. Copyright © 2009, Oracle. All rights reserved. 20 - 14 Specifying Parameters for File Naming Alternatively, specify the following parameters to explicitly 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'
  • 15. Copyright © 2009, Oracle. All rights reserved. 20 - 16 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 285212672 bytes Fixed Size 1218992 bytes Variable Size 92276304 bytes Database Buffers 188743680 bytes Redo Buffers 2973696 bytes SQL> create spfile 2 from pfile='$HOME/auxinstance/initAUX.ora'; File created.
  • 16. Copyright © 2009, Oracle. All rights reserved. 20 - 17 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
  • 17. Copyright © 2009, Oracle. All rights reserved. 20 - 18 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 instance, the auxiliary instance, and recovery catalog if applicable. – Allocate at least one auxiliary channel within the RUN block. $ rman target sys/oracle_4U@trgt auxiliary sys/oracle_4U@auxdb RMAN> RUN {ALLOCATE AUXILIARY CHANNEL aux1 DEVICE TYPE DISK; ALLOCATE AUXILIARY CHANNEL aux2 DEVICE TYPE DISK; … DUPLICATE TARGET DATABASE to auxdb; . . .
  • 18. Copyright © 2009, Oracle. All rights reserved. 20 - 19 Understanding the RMAN Duplication Operation When you execute the DUPLICATE command, RMAN performs the following operations: 1A.Creates a control file server parameter file for the auxiliary instance (for active and for backup-based duplication with target connection) , or: 1B.Restores from backup (for standby database and for backup-based duplication without target connection) 2. Mounts the backup control file 3. For backup-based duplication: Selects the backups for restoring the data files to the auxiliary instance 4. Restores the target data files to the duplicate database 5. Performs incomplete recovery using all available incremental backups and archived redo log files
  • 19. Copyright © 2009, Oracle. All rights reserved. 20 - 20 Understanding the RMAN Duplication Operation When you execute the DUPLICATE command, RMAN performs the following operations: 6. Shuts down and restarts the auxiliary instance in NOMOUNT mode 7. Creates a new control file, which then creates and stores the new DBID in the data files 8. Opens the duplicate database with the RESETLOGS option 9. Creates the online redo log files for the duplicate database Note: The database duplication process attempts to resume from the point-of-failure upon reexecution.
  • 20. Copyright © 2009, Oracle. All rights reserved. 20 - 21 Specifying Options for the DUPLICATE Command You can specify the following options with the DUPLICATE command: Option Purpose SKIP READONLY Excludes read-only tablespaces SKIP TABLESPACE Excludes named tablespaces TABLESPACE Includes named tablespaces NOFILENAMECHECK Prevents checking of file names OPEN RESTRICTED Enables RESTRICTED SESSION automatically
  • 21. Copyright © 2009, Oracle. All rights reserved. 20 - 22 Using Additional DUPLICATE Command Options Option Purpose NOREDO Signals RMAN that the application of redo logs should be suppressed during recovery Must be used with targetless DUPLICATE when target database is in NOARCHIVELOG mode at backup time Can also be used to explicitly state that no archived redo log files should be applied UNDO TABLESPACE Must be specified when target database is not open and there is no recovery catalog connection so that RMAN does not check the tablespace for SYS-owned objects
  • 22. Copyright © 2009, Oracle. All rights reserved. 20 - 23 Using EM to Clone a Database
  • 23. Copyright © 2009, Oracle. All rights reserved. 20 - 24 Quiz Select all statements that are true about database duplication: 1. You can duplicate a database with or without connection to the auxiliary instance. 2. You can duplicate a database with or without connection to the recovery catalog. 3. You can duplicate a database with or without target connection. 4. You can duplicate a database only when you have RMAN backups. 5. You always have to manually re-create control files on the auxiliary instance.
  • 24. Copyright © 2009, Oracle. All rights reserved. 20 - 25 Summary In this lesson, you should have learned how to: • List the purposes of creating a duplicate database • Choose a technique for duplicating a database • Duplicate a database with RMAN • Use an RMAN backup to duplicate a database • Duplicate a database based on a running instance
  • 25. Copyright © 2009, Oracle. All rights reserved. 20 - 26 Practice 20 Overview: Duplicating a Database This practice covers cloning a database and using utilities to complete the setup of a functioning duplicated database.