After the control file is mounted, the number of allocated channels depends on the configuration in the restored control file. Example 2-87 Using SET NEWNAME FOR DATAFILE and SET NEWNAME FOR TABLESPACE to Name Duplicate Files.

You can achieve the same result by running SET UNTIL before the DUPLICATE command. RMAN can perform backup-based duplication with or without either of the following connections: A connection to both is required for active database duplication. Start RMAN and connect to the necessary database instances. This option is valid for duplication without a target or a recovery catalog connection. Start the RMAN client, CONNECT to database prod1 as TARGET, connect to the standby1 instance as AUXILIARY, and connect to the recovery catalog. This technique is advantageous where network connections from the auxiliary host to the source database are restricted or prone to intermittent disruptions. See. of mounted: In this section, well copy the entire standby Oracle home binaries to the This applies to all forms of duplication, whether they are backup-based (with or without a target connection) or active database duplication. If the source database is not open, then it must have been shut down consistently. Example 24-6 Duplicating a Database to a Past Point in Time (Backup-Based). In the DUPLICATE command you must specify the restore point that was created with the archival backup. Note: The read-only tablespaces must be self-contained for the DUPLICATE command to succeed with this option. If you want the duplicate database to contain all the passwords available on your source database, then use the PASSWORD FILE option. In this case, RMAN automatically catalogs the backups in the new location. It is the only UNTIL subclause permitted with the BACKUP LOCATION clause. The source database is called prod1 and is the primary database in the Data Guard environment. The DBID parameter is required when you duplicate without a TARGET connection to the source database and the database name in the recovery catalog is not unique. Are the source and destination hosts connected by a LAN or a WAN? The disk space on the destination host can be an issue when you perform duplication using disk backups. Opens the duplicate database with the RESETLOGS option and creates the online redo log for the new database. Otherwise, RMAN cannot duplicate transportable tablespaces unless they have been made read/write after being transported. When a database must be accessed from another host, you must set up a password file and Oracle Net connectivity. When executing DUPLICATE on desthost, you must use the PFILE parameter to specify the location of the initialization parameter file. Because the limit is inclusive, RMAN selects only files that it can use to duplicate a database up to. The other method for converting temp file names for the new database is to use SET NEWNAME FOR TEMPFILE TO'filename' or TO NEW. No connection to the target database or the recovery catalog. Note the following characteristics of Example 24-4: The NOFILENAMECHECK option is specified because it is necessary when the duplicate database files use the same names as the source database files. You can make this backup accessible in the following ways: Use NFS to mount the backup on the destination host with the same name. You use DUPLICATE LOGFILE to specify names for the online redo log files in the duplicate database. This location is where only backups of database prod reside. Figure 24-5 Backup-Based Duplication with a Target Connection. You can then CONFIGURE the default device type to sbt for a standby database with the DB_UNIQUE_NAME of standby1: Assume all backups needed to create the standby database are on tape. duplicate rman 12c dbi Auxiliary channels have been configured with the CONFIGURE CHANNEL command. When you execute DUPLICATE with FROM ACTIVE DATABASE, at least one normal target channel and at least one AUXILIARY channel are required. You are responsible for determining that the duplicate operation does not overwrite useful data. Typically, the source and duplicate databases must be on the same platform; however some cross-platform duplication is supported. This section makes the following assumptions: You are duplicating the database to a remote host. A qualifier before the name uniquely identifies the tablespace. This subclause includes options that control aspects of duplication such as naming the files and determining an end point for the duplication. If none if these initialization parameters are set, then RMAN uses the original redo log file names of the source database for redo log files of the duplicate database. For this example, create backup directory /dsk2/dup on the destination host. See Table 25-5, "Auxiliary Instance Initialization Parameters". In this scenario, you intend to duplicate database by using backup-based duplication. CONNECT AUXILIARY "sbu@dupdb AS SYSBACKUP"; DUPLICATE DATABASE 'PROD' TO 'DUPDB' NOFILENAMECHECK; DUPLICATE DATABASE 'PROD' DBID 39525561 TO 'DUPDB' NOFILENAMECHECK; Description of the illustration duplicate.gif, Description of the illustration dupoptionlist.gif, Description of the illustration setparameter.gif, Description of the illustration logspec.gif, "Prerequisites Specific to Active Database Duplication", Example 2-87, "Using SET NEWNAME FOR DATAFILE and SET NEWNAME FOR TABLESPACE to Name Duplicate Files", Specifies the source database, which is the database you want to duplicate. Use NFS to mount the backup on the destination host with a different name, and then CATALOG the backup while RMAN is connected as TARGET to the source database. Restores and copies the duplicate datafiles and recovers them with incremental backups and archived redo log files to a noncurrent point in time. To start RMAN and connect to the target and auxiliary instances: Start the RMAN client on any host that can connect to the necessary database instances. RMAN requires a connection to a recovery catalog. If you use active database duplication, then see the FROM ACTIVE DATABASE description in dupOptionList for usage notes. However, if the duplicate database resides in a different Oracle home from the source database, then its database name just has to differ from other database names in its Oracle home. Using the same names means that your environment meets the following requirements: If the source database uses ASM disk groups, then the duplicate database must use ASM disk groups with the same names.

Specifies the PDB when connected to a PDB. The source database is called prod1 and is the primary database in the Data Guard environment. To duplicate PDBs, use the DUPLICATE command with the PLUGGABLE DATABASE option.

Scripting on this page enhances content navigation, but does not change the content in any way. No connection to a recovery catalog, a connection to the target but the target database is not open. Ensure that the standby instance is in NOMOUNT mode. Note: If you specify the SPFILE clause, then DUPLICATE DB_FILE_NAME_CONVERT overrides any conversion parameter specified in the SPFILE syntax. Different file systems for source and destination hosts. You cannot use the same database name for the source database and duplicate database when the duplicate database resides in the same Oracle home as the source database. First, prepare the pfile by using the following commands: Copy the existing standby password file and rename it to match the SID used See Also: "Prerequisites Specific to Active Database Duplication" for command prerequisites. RMAN connects to the auxiliary instance of the duplicate database on the destination host. First, start the RMAN client, CONNECT to database prod1 as TARGET, and connect to the recovery catalog. In some environments, manual transfer of backups is necessary because NFS performance is a bottleneck. If you are using backup-based duplication, and if the source database and auxiliary instances reside on different hosts, then you must decide how to make the backups of the source database available to the auxiliary instance. Uses the RMAN repository to select the backups for restoring the datafiles to the auxiliary instance. 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. Specifies that the duplicate database must not be opened after it is created. If PARAMETER_VALUE_CONVERT sets the file name specified by a parameter, and if SET sets the file name specified by the same parameter, then the SET value overrides the PARAMETER_VALUE_CONVERT setting. This clause can be used instead of TARGET DATABASE when RMAN is connected as TARGET to the source database. RMAN copies the live source database over the network to the auxiliary instance, thereby creating the duplicate database. The duplicate database (the copied database) functions entirely independently from the source database (the database being copied). It is invalid to specify INCARNATION when connected to a target database or when using BACKUP LOCATION. You are duplicating the entire database. If you must duplicate a database when some backups of the source database do not exist, then SKIP TABLESPACE is required. Although the directories are the same on the source and destination hosts, Oracle Database chooses the relative names for the duplicate files. When you connect RMAN to the source database as TARGET, you must specify a user name and password, even if RMAN uses operating system authentication. To transfer the backups from the source host to the destination host: Create a backup storage directory in either the source or destination host. In this case, RMAN copies the source database password file to the destination host and overwrites any existing password file for the auxiliary instance. See "Step 1: Choosing a Duplication Technique". Typically, duplicate databases are used for testing. If the source database is not open, then the database does not require instance recovery. For example, if you CONFIGURE automatic disk and tape channels, and if you run DUPLICATEDEVICE TYPE DISK, then RMAN allocates only disk channels. You create a text-based initialization parameter file for the auxiliary instance. The set of tablespaces to be duplicated must be self-contained. You must use the RMAN client on the same host as the initialization parameter file for the duplicate database. The auxiliary instance was not started with a server parameter file. The archived redo log files can be available either as image copies or backup sets. You must provide the name of the source database with the DATABASE clause. Copies the server parameter file from the source database to the duplicate database. Table 2-7 shows which files from the source database are duplicated. 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. Omitting this clause instructs RMAN to perform backup-based duplication. If you configure or manually allocate channels for active duplication with backup sets, ensure that the number of auxiliary channels is greater then or equal to the number of target channels. You do not set DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT because you are specifying names for data files and online logs in the RUN command itself. Some prerequisites are common to all duplication techniques, such as the following: The source and duplicate databases must be on the same platform. Specifies which tablespaces are included in the specified database. Example 2-90 Creating a Standby Database with the Same Directory Structure. However, you may want to increase the parallelism setting of your source database disk channels so that RMAN copies files over the network in parallel. Multiple databases can have tablespaces with the same name, so a qualifier before the name uniquely identifies the tablespace. Disables the RMAN ability to check that a set of tablespaces must be self-contained. Before starting the auxiliary instance, create a password file that has the same SYS and SYSBACKUP password as the source database. A standby database is a copy of the primary database that you update continually with archived log files from the primary database. The prerequisites vary depending on the type of duplication. You want to store the data files in desthost in the /oradata1 subdirectory, so you use SET NEWNAME FOR DATABASE to specify the file names stripped of directory paths. If the source database files are Oracle Managed Files, then the auxiliary instance must set DB_FILE_CREATE_DEST to the same directory location as the source database. Choose a strategy for naming the duplicate database files. The destination host must have access to the RMAN backups required to create the duplicate database. The principal advantage of active database duplication is that it does not require source database backups. Use the following steps to configure the static listener for the test Scripting on this page enhances content navigation, but does not change the content in any way. If you specify FROM ACTIVE DATABASE, then RMAN copies the data files from the primary to standby database. To ensure that the source database is in the proper state: If the source database instance is not mounted or open, then mount or open it. When you connect RMAN to the standby database and the recovery catalog in which the primary database is registered, RMAN recognizes the standby database and implicitly registers it. For example, if a source data file has the name '/oradata/prod/financial.dbf', then %b results in 'financial.dbf'. Specifies the backup location on disk where the backups and copies of the database to be duplicated have been placed. For example, enter the following commands: Alternatively, you may want to periodically synchronize a duplicate database with the original database that was duplicated. In the parameter file, set DB_NAME to an arbitrary value. You can perform the following tasks in a duplicate database: Test an upgrade to a new release of Oracle Database, Test the effect of applications on database performance. need pre-existing RMAN backups and copies. Creates a new control file, which then creates and stores the new DBID in the datafiles. Figure 24-1 shows the decision tree for the two duplication techniques. An error is displayed if backups for more than one database were found in the BACKUP LOCATION. In a CDB, specifies the whole CDB. Backup-based duplication uses pre-existing RMAN backups and copies. The DB_FILE_NAME_CONVERT parameter can convert the temp file names for the new database that are not Oracle-managed files (OMF). One way to do this is to exit RMAN, use SQL*Plus to reset the auxiliary instance to NOMOUNT mode, start RMAN and then repeat the DUPLICATE command. To duplicate PDBs, you must connect to the. The DUPLICATE SPFILE technique is easiest because during duplication RMAN automatically copies the server parameter file from the source database to the auxiliary instance or restores it from backup. The DBID is specified because the source database name prod is not unique in the recovery catalog. For example, use the BACKUP COPY OF DATABASE command to copy the backups in /dsk1/bkp on the source host to /dsk2/dup on the source host. For example, use FTP to transfer the backups from /dsk1/bkp on the source host to /dsk2/dup on the destination host, or use the cp command to copy the backups from /dsk1/bkp on the source host to /dsk2/dup on the source host. By default RMAN duplicates current read-only tablespaces. There are two ways to store specific data files or temp files in an Oracle-managed files destination that is independent of the locations of the rest of the database files. For example, you can duplicate the production database on host1 to host2, and then use the duplicate database on host2 to practice restoring and recovering this database while the production database on host1 operates as usual. If duplication is made with a connection to the target or the recovery catalog, then the backup files on the destination host must have the same file specification as they had on the source host. Specifies the name of the source database, which is the database to duplicate. The location and content of the initialization parameter file depend on your choice in "Step 2: Choosing a Strategy for Naming Duplicate Files". The name of the tablespace in a CDB. See the previous descriptions of TABLESPACE and UNDO TABLESPACE for general information about these parameters. RMAN can use the same channel configurations on the source database for duplication on the destination host. All tablespaces taken offline with an option other than NORMAL. The DUPDB database excludes tablespace TOOLS, but keeps all of the other tablespaces. This script is located in ORACLE_HOME/rdbms/admin on Linux and UNIX platforms. You must use the same SYSDBA password for both instances and must supply the net service name to connect to the AUXILIARY instance. It may also signal the following error: By default, RMAN creates a duplicate database and then opens it in RESETLOGS mode. The source host is the computer that hosts the source database. Enter the following command to create the standby database: RMAN automatically generates new OMF/ASM data file names for the restored data files. Copied from source database when FOR STANDBY specified; otherwise re-created, Copied from source database (unless excluded with a SKIP option), Restored from backups (unless excluded with a SKIP option), Re-created when FOR STANDBY specified and defined on primary database, Copied from source database, but only if needed for the duplication, Obtained from backups or cataloged copies, but only if needed for the duplication, Copied from source database (see SPFILE clause in dupOptionList), Restored from backup if SPFILE clause is specified (see dupOptionList), Copied by default for standby databases; for nonstandby databases, copied only if PASSWORD FILE option is specified, Backups and other files in fast recovery area. The source database is currently running in ARCHIVELOG mode but the backup was taken when the database was in NOARCHIVELOG mode. Also, you want the duplicate database to be in the state that the production database was in 24 hours ago, so you use DUPLICATE UNTIL TIME. Designates the database being duplicated as a standby database (see, Specifies the name of the duplicate database. You cannot increase the speed of duplication once the disks reach their maximum read/write rate. A disk backup location containing all the backups or copies for duplication must be available to the destination host.

For backup-based duplication of databases without a connection to the target database, RMAN cannot determine whether the source database was in NOARCHIVELOG mode. You decide to use SET NEWNAME commands to specify the file names because the duplicate data files will be spread across several directories. These channels perform the work of the duplication on the auxiliary database instance. Figure 24-3 illustrates backup-based duplication without a target connection. In this way, you avoid interfering with the source database. This section explains the shared disk technique. For a backup-based strategy, make the backups accessible to the auxiliary instance; otherwise, skip this step. If the names of the database files in the source database contain a path, then this path name must be the same in the duplicate database. How much disk space is available on the destination host? RMAN supports two basic types of duplication: active database duplication and backup-based duplication. Follow the link in each step for further instructions. any physical backups and we restored the target database to the latest archive Review the "Prerequisites" section of the DUPLICATE command entry in Oracle Database Backup and Recovery Reference for a complete list. The database instance associated with the duplicate database is called the auxiliary instance. Refer to, Replaces the first string with the second string in all matching initialization parameter values. This RESET functionality is equivalent to pausing the duplication after restoring the server parameter file and issuing ALTER SYSTEM RESET statements to change the initialization parameter file. If you must duplicate the database during a period of high user activity, then the loss of network throughput caused by active duplication may be a problem, making backup-based duplication a better choice. This example is a variation that uses CONFIGURE AUXNAME instead of SET NEWNAME to specify the new data file names. The following sample script creates the duplicate database. for the TEST database, or you can create a new password file on the target Consider the following questions: Are you familiar with the prerequisites for each duplication technique? If a tablespace is currently read/write, but you use untilClause to duplicate the database to an SCN at which the tablespace was read-only, then RMAN does not include the tablespace in the duplicate database. If not, then manually set this parameter to a unique value in the PFILE or SPFILE of the auxiliary instance. The DUPLICATE FOR STANDBY command creates the standby database by restoring a standby control file and mounting the standby control file. Backup-based duplication without a target connection. In the variation of Example 24-1, shown in Example 24-5, RMAN does not use a TARGET connection to the source database or a CATALOG connection to a recovery catalog. A duplicate database is useful for a variety of purposes, most of which involve testing. The DUPLICATE command requires one or more auxiliary channels. Database duplication copies the target database over the network to the Assume that you want to use tape backups to duplicate the source database prod on srchost to newdb on desthost. Active duplication can use image copies or backup sets. The connecting user must have the SYSDBA or SYSBACKUP privilege. Set the parameter DB_CREATE_FILE_DEST in the initialization parameter file of the auxiliary instance to the desired location. If the name of the source database is not unique in the recovery catalog, then you must also provide the database ID (DBID) in the DATABASE clause. You set the following parameters in the initialization parameter file for database standby1: Set DB_UNIQUE_NAME to the value standby1. In the standby database initialization parameter file, you set DB_UNIQUE_NAME to standby1. Assume that you want to create a standby database from database prod1 on a new host. Start the RMAN client, CONNECT to the source database as TARGET and connect to the auxiliary instance. Run the following script whenever you want to synchronize the duplicate with the source database. Set DB_FILE_CREATE_DEST to make all data files of the new database Oracle-managed files, except the files for which SET NEWNAME is used. SKIP TABLESPACE for these tablespaces. You cannot recover the duplicate database to the current point in time, that is, the most recent SCN. Active database duplication with image copies uses the auxiliary net service name to copy the source database over the network to the auxiliary instance on the destination host. To simplify administration of duplicate database, Oracle recommends that you use different names for the source and duplicate databases. If you do not connect to the target or recovery catalog, then you must designate a BACKUP LOCATION for the duplication. A recovery catalog connection is optional. To perform RMAN active duplication from physical standby you need the You want to create two online redo log groups, each with two members of size 200 KB, in the directory /duplogs on the destination host. Table 2-6 Prerequisites for Three Modes of Backup-Based Duplication. You want to store the data files in desthost in the /oradata1 through /oradata7 subdirectories. Specifies the database ID (DBID) of the source database. Specifies the file names and groups for the online redo log files. DB_NAME is the only required initialization parameter. Oracle Database Backup and Recovery User's Guide for information about duplicating CDBs and PDBs, (deviceSpecifier::=, fileNameConversionSpec::=, logSpec::=, setParameter::=, sizeSpec::=, untilClause::=). DUPLICATE requires the NOFILENAMECHECK option because the source database files have the same names as the duplicate database files. After the duplication is complete, you can clear the configured auxiliary names for the data files in the duplicate database, so that they are not overwritten by future operations. Example 2-82 Duplicating from an Active Database to a Host with the Same Directory Structure. RMAN must be connected as AUXILIARY to the instance of the duplicate database. This chapter contains the following topics: Placing the Source Database in the Proper State, Starting RMAN and Connecting to Databases, Configuring RMAN Channels for Use in Duplication. Sales Chat to chat now and start the conversation. The steps in this task are specific to your media manager configuration. database oracle connectivity restore sh The PASSWORD FILE option copies the password file to the destination host. For example, if the initialization parameter file setting is DB_FILE_NAME_CONVERT=('disk1','disk2'), but you execute DUPLICATE DB_FILE_NAME_CONVERT ('disk1','disk3'), then RMAN does not convert the disk1 substring to disk2. You want to store the duplicate database files in ASM disk group +DUPDSK. Backup sets offer several advantages, including usused block compression and encryption. You can use PASSWORD FILE to request that RMAN overwrite the existing password file with the password file from the source database. This option is necessary when you are creating a duplicate database in a different host that has the same disk configuration, directory structure, and file names as the host of the source database. server with the same source password. Duplicates all the PDBs within the CDB, except the ones specified in the comma-separated list, Excludes the specified tablespace from the duplicate database (see. The source database must be mounted or open. The auxiliary instance must have been started with an initialization parameter file that contains the declaration enable_pluggable_database=TRUE. Specifies an optional comment for the parameter setting. Note: The same restrictions that apply to untilClause also apply to TO RESTORE POINT. For example, if the backups are in /dsk1/bkp on the source host, then use FTP to transfer them to /dsk1/bkp on the destination host. The DUPLICATE command considers 32-bit and 64-bit versions of the same operating system as belonging to the same platform. Ensure that auxiliary channels on the destination host can access all datafile backups and archived redo log files (required to restore and recover the duplicate database to the desired point in time). As shown in the following sample script, you can also use SET NEWNAME to direct individual data files or temp files to a specific ASM disk group. See "Starting RMAN and Connecting to Databases". The new host has the same directory structure as the source host, so the files in the duplicate database can use the same names as the files in the source database. To establish Oracle Net connectivity and set up a static listener: Follow the instructions in Oracle Database Net Services Administrator's Guide to configure a client for connection to a database and add static service information for the listener.

Therefore, you must use the NOREDO option when the source database was in NOARCHIVELOG mode when the backups were taken. You have the following options: You can use shared disk to make backups available. Unlike SKIP TABLESPACE, which specifies which tablespaces are excluded from the duplicate database, this option specifies which tablespaces are included and then skips the remaining tablespaces. To create additional standby databases, connect RMAN to the original primary database and run DUPLICATE FOR STANDBY. The process is similar to that of duplicating non-CDBs. You want to place each data file in a different directory, except the USERS tablespace, which contains two data files that you intend to duplicate to /oradata7. The channel configuration depends on your duplication technique. 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.