Overview of RMAN Database DuplicationPurpose of Database DuplicationA duplicate database is useful for a variety of purposes, most of which involve testing. You can perform the following tasks in a duplicate database: Show
For example, you can duplicate the production database on If you copy a database with operating system utilities rather than the The Basic Concepts of Database DuplicationThe source host is the computer that hosts the source database. The source database instance is the instance associated with the source database. The destination host is the computer that hosts the duplicate database. The source host and destination host can be the same or different computers. For the duplication process, the database instance associated with the duplicate database is called the auxiliary instance. Note: Performing simultaneous database duplication operations using the same source database is not supported. Techniques for Duplicating a DatabaseRMAN supports two basic types of duplication: active database duplication and backup-based duplication. RMAN can perform backup-based duplication with or without either of the following connections:
A connection to both is required for active database duplication. Figure 25-1 shows the decision tree for the two duplication techniques. About Active Database Duplication with RMANIn active database duplication, RMAN connects as RMAN can transfer the files required for active database duplication as image copies or backup sets. Note: Performing active database duplication using backup sets is available starting with Oracle Database 12c Release 1 (12.1). Figure 25-2 illustrates active database duplication. When active database duplication is performed using image copies, after RMAN establishes a connection with the source database, the source database transfers the required database files to the auxiliary database. Using image copies may require additional resources on the source database. This method is referred to as the push-based method of active database duplication. When RMAN performs active database duplication using backup sets, a connection is established with the source database and the auxiliary database. The auxiliary database then connects to the source database through Oracle Net Services and retrieves the required database files from the source database. This method of active database duplication is also to as the pull-based method. Using backup sets for active database duplication provides certain advantages. RMAN can employ unused block compression while creating backups, thus reducing the size of backups that are transported over the network. Backup sets can be created in parallel on the source database by using multisection backups. You can also encrypt backup sets created on the source database. See Also:
Factors That Determine Whether Backup Sets or Image Copies Are Used for Active Database Duplication RMAN only uses image copies to perform active database duplication when no auxiliary channels are allocated or when the number of auxiliary channels allocated is less than the number of target channels. RMAN uses backup sets to perform active database duplication when the connection to the target database is established using a net service name and any one of the following conditions is satisfied:
Note: Oracle recommends that you use backup sets to perform active database duplication. About Backup-Based Duplication with RMANIn backup-based duplication, RMAN creates the duplicate database by using preexisting RMAN backups and copies. This technique of duplication uses one of the following mutually exclusive methods:
Figure 25-3 illustrates backup-based duplication without a target connection. RMAN connects to a recovery catalog database instance and the auxiliary instance. The destination host must have access to the RMAN backups required to create the duplicate database. Figure 25-4 illustrates backup-based duplication without connections to the target or to the recovery catalog database instance. RMAN connects to the auxiliary instance of the duplicate database on the destination host. A disk backup location containing all the backups or copies for duplication must be available to the destination host. Figure 25-5 illustrates backup-based duplication with a target connection. RMAN connects to the source database instance and the auxiliary instance. Optionally, RMAN can connect to a recovery catalog database (not shown in the figure). The destination host must have access to the RMAN backups required to create the duplicate database. Contents of a Duplicate DatabaseA duplicate database can include the same contents as the source database or only a subset of the tablespaces in the source database. For example, you can use the How RMAN Duplicates a DatabaseFor backup-based duplication, the principal work of the duplication is performed by the auxiliary channels. These channels correspond to a server session on the auxiliary instance on the destination host. For active database duplication, the type of duplication technique used determines which channel performs the principal work. When active database duplication is performed using backup sets, the principal work of duplication is performed by the auxiliary channels. When image copies are used, the primary work is performed by the target channels. RMAN must perform database point-in-time recovery, even when no explicit point in time is provided for duplication. Point-in-time recovery is required because the online redo log files in the source database are not backed up and cannot be applied to the duplicate database. The farthest point of recovery of the duplicate database is the most recent redo log file archived by the source database. As part of the duplicating operation, RMAN automates the following steps:
Basic Steps of Database DuplicationTo duplicate a database: This section describes the basic steps of database duplication. Follow the link in each step for further instructions.
Duplicating CDBsWhen duplicating a whole CDB or one more PDBs:
When transferring backup files from the source to the destination host: Duplicating PDBsRMAN enables you to duplicate PDBs with the You must log in to
the root of the CDB as a user who is granted the To duplicate PDBs, you must create the auxiliary instance as a CDB. To do so, start the instance with the declaration Table 25-1 Options to Duplicate PDBs
To duplicate PDBs:
To duplicate tablespaces within a PDB:
Preparing to Duplicate a DatabaseStep 1: Choosing a Duplication TechniqueYour business requirements and the database environment determine which duplication technique is best for your situation. Consider the following questions:
Specifying Encryption for Active Database DuplicationStarting with Oracle Database 12c Release 1 (12.1), RMAN can use backup sets to transfer the source database files that need to be duplicated. The backup sets are transferred over the network to the auxiliary database. Backup sets can be encrypted for additional
security. Specify the encryption algorithm by using the Before you perform active database duplication, use one of the following techniques to ensure that the encryption is successful:
The following example connects to the target database and an auxiliary database
using net service names and performs active database duplication. The keystore that contains the encryption key is shared between the target and the auxiliary database. CONNECT TARGET "sbu@prod AS SYSBACKUP"; CONNECT AUXILIARY "sbu@dup_db AS SYSBACKUP"; SET ENCRYPTION ALGORITHM 'AES128'; DUPLICATE TARGET DATABASE TO dup_db FROM ACTIVE DATABASE PASSWORD FILE; Compressing Backup Sets Used to Perform Active Database DuplicationWhen you use backup sets to perform active database duplication, you can compress the backup sets created to transfer files from the source database to the destination database. Using compressed backup sets minimizes the size of the backup sets and thus provides better performance for the database duplication. Compressing backup sets used for active database duplication is supported starting with Oracle Database 12c Release 1 (12.1). Use the DUPLICATE TARGET DATABASE TO dup_db FROM ACTIVE DATABASE PASSWORD FILE USING COMPRESSED BACKUPSET; Creating Backup Sets in Parallel During Active Database DuplicationRMAN multisection backups provide faster backup performance by backing up very large data files in parallel. Multiple backup pieces are created, with a separate channel writing to each backup piece. Starting with Oracle Database 12c Release 1 (12.1), you can use multisection backup sets to transfer the source files required to perform active database duplication. Use the DUPLICATE TARGET DATABASE TO dup_db FROM ACTIVE DATABASE PASSWORD FILE SECTION SIZE 400M; Specifying the State of the Duplicate DatabaseWhen you use the RMAN You may not want to open the duplicate database immediately after creation in the following situations:
The following command creates a duplicate database called DUPLICATE TARGET DATABASE TO dupdb FROM ACTIVE DATABASE NOOPEN; Step 2: Choosing a Strategy for Naming Duplicate FilesWhen duplicating a database, RMAN generates names for the duplicate control files, data files, temp files, and online redo log files. Therefore, you must decide on a naming strategy for these files. The simplest duplication strategy is to configure the duplicate database to use the same names as the source database. Using the same names means that your environment meets the following requirements:
When you configure your environment as suggested, no additional configuration is required to name the duplicate files. It is recommended that you use different names for the ASM disk groups in the source and duplicate database. Use one of the following techniques to specify different names for database files in the duplicate database:
Step 3: Installing the Oracle Database Software on the Destination HostIf the source and destination hosts are different, then you must install the Oracle Database software on the destination host so that you can create the auxiliary instance. You can install the software in one of two ways:
Step 4: Making Backups Accessible to the Duplicate InstanceWhen duplicating with a target and recovery catalog or just a target connection, RMAN uses metadata in the RMAN repository to locate backups and archived redo log files needed for duplication. If RMAN is connected to a recovery catalog, then RMAN obtains the backup metadata from the catalog. If RMAN is not connected to a catalog, as may be the case when performing backup-based duplication with a target connection, then RMAN obtains metadata from the control file. Unless you are duplicating without a connection to the target and to the recovery catalog, the names of the backups must be available with the same names recorded in the RMAN repository. Ensure that auxiliary channels on the destination host can access all data file backups and archived redo log files (required to restore and recover the duplicate database to the desired point in time). If not, duplication fails. The archived redo log files can be available either as image copies or backup sets. Note: The database backup need
not have been generated with This section contains the following topics:
Making SBT Backups Accessible to the Auxiliary InstanceThe steps in this task are specific to your media manager configuration. To make SBT backups accessible to the auxiliary instance:
Making Disk Backups Accessible to the Auxiliary InstanceWhen you make disk backups accessible to the auxiliary instance, your strategy depends on whether or not you duplicate the database while connected to the target or recovery catalog. If you do not connect to the target or recovery catalog, then you must designate a backup location for the duplication by using the When you use a
backup location, the backups and copies can reside in a shared location or can be moved to the location on the destination host. In the latter case, you do not need to preserve the name or the original path of the backup or copy. The location specified in the It is not required that all of the backups be from the same point in time, or that they all be backup sets, or all image copies. Data file backups can be supplied as either image copies or backup sets. Archived logs can be supplied either in their normal format or as backup sets of archived logs. When you use backups from different points in time, the backup location must contain archived logs covering the time from the start of the oldest backup until the desired recovery point. If the backup location contains backup files from multiple
databases, then the The source database's Fast Recovery Area is particularly well suited for use as a backup location because it almost always contains all of the files needed for the duplication. To use a Fast Recovery Area as a backup location, you can either remotely access it from the destination system, or copy its contents to the destination system. When you are not using a backup location, your strategy depends on the following mutually exclusive scenarios:
Assume that you have two hosts, To transfer the backups from the source host to the destination host:
Step 5: Preparing Remote Access to DatabasesEstablishing Database ConnectivityYou can establish database connectivity by manually creating a password file or using Oracle Net. To create a password file manually: To establish Oracle Net connectivity and set up a static listener: Creating a Password File for the Auxiliary InstanceYou have the following options for creating a password file for the auxiliary instance on the destination host:
Note: If you create a standby database with the Step 6: Copying the Oracle Keystore to the Destination HostIf transparent encryption is configured on the source database, then you must ensure that the Oracle software keystore from the source database is available to the auxiliary instance. Manually copy the source database keystore to the destination host. The following are requirements for the keystore at the duplicate database:
See Also:
Step 7: Creating an Initialization Parameter File and Starting the Auxiliary Instance
If you cannot meet the preceding requirements, then see "Duplicating a Database When No Server Parameter File Exists". To create an initialization parameter file and start the auxiliary instance:
Note: For this scenario, ensure that the auxiliary instance is started with a text-based initialization parameter file and not a server parameter file. Do not create a control file or try to mount or open the auxiliary instance. Step 8: Placing the Source Database in the Proper StateIf RMAN is connected to the source database as To ensure that the source database is in the proper state:
Starting RMAN and Connecting to DatabasesIn this task, you must start the RMAN client and connect to the database instances required by the duplication technique chosen in "Step 1: Choosing a Duplication Technique". The RMAN client can be located on any host so long as it can connect to the necessary databases over the network. To start RMAN and connect to the target and auxiliary instances:
Configuring RMAN Channels for Use in DuplicationConfiguring Channels for Backup-Based DuplicationThe channel on the auxiliary instance, not the source database instance, restores RMAN backups in backup-based duplication. The channel configuration depends on your duplication technique. RMAN
can use the same channel configurations on the source database for duplication on the destination host. RMAN can use these configurations even if the source database channels do not specify the Note the following additional considerations:
Configuring Channels for Active Database DuplicationIn active database duplication, you do not have to change your source database channel configuration or configure To perform active database duplication using backup sets, you must allocate additional auxiliary channels. The number of auxiliary channels must be greater than or equal to the number of target channels. Using backup sets for active duplication also enables parallelism which can improve the speed of the duplication process. Duplicating a DatabaseThis section describes the most basic procedure to duplicate a database. This section makes the following assumptions:
To duplicate a database to a remote host with the same directory structure:
Example 25-1 Duplicating to a Different Host with the Same Directory Structure (Active) This example illustrates how to perform active duplication. RMAN uses the pull method
(using backup sets) by default. The RMAN automatically copies the server parameter file to the destination host, restarts the auxiliary instance with the server parameter file, copies all necessary database files and archived redo logs over
the network to the destination host, and recovers the database. Finally, RMAN opens the database with the DUPLICATE TARGET DATABASE TO dupdb FROM ACTIVE DATABASE PASSWORD FILE SPFILE NOFILENAMECHECK; Example 25-2 Duplicating a PDB This example adds the DUPLICATE TARGET DATABASE TO cdbdupe PLUGGABLE DATABASE sales FROM ACTIVE DATABASE PASSWORD FILE SPFILE NOFILENAMECHECK; Backup-Based Duplication Without a Target Connection: ExampleIn this variation of
Example 25-1, RMAN does not use a Example 25-3 Duplicating a Database to a Past Point in Time (Backup-Based) DUPLICATE DATABASE prod DBID 8675309 TO dupdb UNTIL TIME "TO_DATE('11/01/2013', 'MM/DD/YYYY')" SPFILE NOFILENAMECHECK; Note the following characteristics of Example 25-3:
Assume a variation in which you want to
restore an archival backup, which is all-inclusive in the sense that every file needed to restore and recover the database is included. The recommended technique for restoring an archival backup for testing is to create a temporary instance and use the In the
Example 25-4 Using an Archival Backup for Backup-Based Duplication DUPLICATE DATABASE prod DBID 8675309 TO dupdb TO RESTORE POINT TESTDB103107 SPFILE NOFILENAMECHECK; Backup-Based Duplication with a Target Connection: ExampleAssume a backup-based variation of Example 25-1 in which RMAN
is connected as Example 25-5 Duplicating a Database to a Past Point in Time (Backup-Based) DUPLICATE TARGET DATABASE TO dupdb SPFILE NOFILENAMECHECK UNTIL TIME 'SYSDATE-7'; Note the following characteristics of Example 25-5:
Backup-Based Duplication Without a Target or Recovery Catalog Connection: ExampleIn the variation of Example 25-1 shown in
Example 25-6, RMAN does not use a Example 25-6 Duplicating a Database Without a Target and Recovery Catalog Connection (Backup-Based) DUPLICATE DATABASE TO dupdb UNTIL TIME "TO_DATE('11/01/2013 14:00:00', 'MM/DD/YYYY HH24:MI:SS')" SPFILE BACKUP LOCATION '/prod_backups' NOFILENAMECHECK; Note the following characteristics of Example 25-6 :
Example 25-7 Duplicating a Database to a Past Point in Time (Backup-Based) This example performs backup-based duplication to a point-in-time in the past. DUPLICATE TARGET DATABASE TO dupdb SPFILE NOFILENAMECHECK UNTIL TIME 'SYSDATE-7'; Note the following characteristics of Example 25-7:
Example: Script to Duplicate a Database Using Backup-based DuplicationThis example shows how to use a script to automate the process of duplicating a target database. This example assumes the following:
The script provided in this example performs the following tasks:
To duplicate a target database using backup-based duplication without a target connection:
Restarting DUPLICATE After a FailureRMAN automatically optimizes a To restart a DUPLICATE operation:
The second
If you do not want RMAN to automatically recover from a failed When the same data is duplicated in multiple files of a database?Data redundancy occurs when the same piece of data is stored in two or more separate places and is a common occurrence in many businesses.
What database term is defined as the duplication of data or the storing of the same data in more than one place in a data file?Data redundancy refers to the practice of keeping data in two or more places within a database or data storage system. Data redundancy ensures an organization can provide continued operations or services in the event something happens to its data -- for example, in the case of data corruption or data loss.
Which of the following enables users to view the same data in different ways using multiple dimensions?Multidimensional analysis enables users to view the same data in different ways using multiple dimensions.
Which of the following occurs when the same attribute is related data files has different values?Answer: Data redundancy occurs when different divisions, functional areas, and groups in an organization independently collect the same piece of information.
|