oracle 12c rman duplicate database from backup location


Names online redo log files in the duplicate database. It is recommended to use a server parameter file instead of a text-based initialization parameter file for duplication.

Note: For active database duplication, connection to the destination CDB must use password file authentication. Duplicating a PDB to an existing CDB is subject to certain restrictions. March 25, 2015. A recovery catalog connection is optional. The default location for the password file is $ORACLE_BASE\database on Windows and $ORACLE_BASE/dbs on Linux and UNIX.

When you perform duplication by using disk backups, disk space on the destination host can be an issue. Use one of the following methods to configure channels: Automatically allocate channels by using the CONFIGURE command, Manually allocate channels by using the ALLOCATE command. Plan the duplication, as described in "Planning to Duplicate a Database". If the auxiliary channels need special parameters (for example, to point to a different media manager), then you can configure an automatic channel with the AUXILIARY option of the CONFIGURE command. Depending on the duplication technique, RMAN uses either auxiliary channels or target channels. The backups of the target database are available to the auxiliary instance. Wanted! Excel-DB, Expert Oracle tips by Kamran Agayev Agamehdi & Aman Sharma In this example, the SET NEWNAME FOR DATABASE command specifies the location of the data files and control file. The duplicate database files use a directory structure that is different from that of the source database. The number of auxiliary channels must be greater than or equal to the number of target channels. strive to update our BC Oracle support information. 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. Use the DB_CREATE_FILE_DEST parameter to specify the disk group that is used to store the duplicate database files in the duplicate database. Server Oracle Cloud databases are always encrypted. See Methods of Generating Database File Names for the Duplicate Database in Oracle Database Backup and Recovery Users Guide. If the source database uses Oracle Managed Files, then you cannot use this method to specify alternative names for duplicate database files. To perform active database duplication, a connection to the target database is required. the most difficult Oracle performance and recovery issues. independently investigate their credentials and experience, and not rely on If RMAN is connected to the source database as TARGET, then the source database must be in a proper state for duplication. Create the auxiliary instance as a CDB. The primary task of duplication is performed by RMAN channels. Ensure that the base data files are stored in a protected storage and accessed using secured communications. Configuring additional channels improves the duplication performance. Ensure that you have completed Steps 1 to 4 in Duplicating a PDB to a New CDB. See Placing the Source Database in a Proper State. SQL> In this example, the backups of the data files and archived redo log files must be stored in /backups/db_files and the backups of the control files and server parameter file in /backups/cf on the destination host. This technique is applicable only if the source database uses a server parameter file. While duplicating an Oracle Real Application Clusters (Oracle RAC) database, set the CLUSTER_DATABASE initialization parameter on the auxiliary database to FALSE. For example, the following command duplicates the CDB on to cdb2: You can duplicate a PDB to a new multitenant container database (CDB) or an existing CDB.

Oracle Duplicate the PDB by using the DUPLICATE PLUGGABLE DATABASE command. A recovery catalog connection is optional. The database files of the duplicate database must be stored in the /app/oracle2/dbs directory. This section explains the shared disk technique. Commit complete.

Multiple techniques are available for performing backup-based duplication.

advertisements and self-proclaimed expertise. The source host and the destination host are different.

In this section, we will be cloning prod database to clone SID. In the parameter file, set the DB_NAME and DB_DOMAIN initialization parameters. For active database duplication using backup sets, you must connect to the source database as TARGET by using a net service name. The archived redo log files can be available either as image copies or backup sets. Restrictions on Duplicating a PDB to an Existing CDB. This example shows how to use a script to automate the process of duplicating a target database. The keystore password is set up by using the following command (where password is a placeholder for the actual password that you enter): A complete backup of the source database including the control files, data files, and archived redo log files is stored in the /oracle2/rman_backups directory. Place the source database in a proper state (if necessary). Place source database in a proper state, if necessary, as described in "Placing the Source Database in a Proper State". Use a comma-delimited list to specify multiple PDBs that must be excluded. If the destination CDB uses a password-based software keystore, then you must specify the password used to open this keystore.

The duplication process for a sparse database begins with an implicit restore and then completes duplicating the database containing sparse data files. In this example, you create the /oracle2/database directory to store the data files, control file, and server parameter file. Afterward, connect RMAN to the source database as TARGET and use the CATALOG command to update the RMAN repository with the location of the manually transferred backups. Make the tapes with the backups accessible to the destination host. To duplicate a target database by using backup-based duplication without a target connection: The following pfile, called init_dup.ora and located in the /home/oracle directory, sets the DB_NAME parameter. Each channel corresponds to an Oracle Database server session that performs the duplication tasks. qualifications. Duplicates the target database by using the target database backups and metadata in the RMAN recovery catalog. The client-side parameter file for the auxiliary instance must reside on the same host as the RMAN client that performs the duplication. Oracle PostersOracle Books SQL> Connect AS AUXILIARY to the root of the destination CDB as a common user with the SYSDBA or SYSBACKUP privilege. Set up Oracle Net Services connectivity between the source database and the auxiliary instance by using a static listener, as described in "Establishing Oracle Net Connectivity Between the Source Database and Auxiliary Instance".

Set the required environment variables, such as ORACLE_HOME and ORACLE_SID. In this section, we will be cloning, "TO_DATE('2021-01-07 14:27:17', 'YYYY-MM-DD HH24:MI:SS')".

The farthest point of recovery of the duplicate database is the most recent redo log file archived by the source database.

The service name of the source database dbsrc and that of the duplicate database is dbdup. If RMAN is connected to a recovery catalog, then RMAN obtains the backup metadata from the catalog. For tape backups, limit the number of channels to the number of devices that are available. Since the bandwidth between the source and destination is limited, active database duplication by using image copies is performed. If the performance degradation on a WAN is unacceptable, then backup-based duplication may be the only viable option. The following are some examples of duplicating tablespaces that are contained in PDBs: To duplicate the users tablespace that is part of PDB pdb1, use the following command: DUPLICATE DATABASE TO cdb1 TABLESPACE pdb1:users; To duplicate the PDB pdb1 and the users tablespace in PDB pdb2, use the following command: DUPLICATE DATABASE TO cdb1 PLUGGABLE DATABASE pdb1 TABLESPACE pdb2:users; Use the DUPLICATE command to duplicate an on-premise database to Oracle Cloud. For RMAN to use backup sets to perform active database duplication, the number of auxiliary channels must be equal to or greater than the number of target channels. The following table describes a subset of the possible initialization parameters for the auxiliary instance. The duplicate database is created by using preexisting RMAN backups or copies of the source database. Also note, the database file locations on target server will be same as our source server. Use this to create a standby database by duplicating the source database. The destination host can be the same as the source host or different. The steps to duplicate CDBs and PDBs are similar to those of duplicating non-CDBs with minor variations to the procedure for duplicating a non-CDB.

Do not create a database; install the software only. Use the following steps to create a duplicate database for the scenario that is described in this example: Plan the duplication, as described in "Planning to Duplicate a Database". How much disk space is available on the destination host? The source database's Fast Recovery Area is particularly well suited for use as a backup location because it almost always contains all the files that are required for the duplication. The database files include the data files, control files, online redo log files, and temp files. DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT initialization parameters. nofilenamecheck create Making Disk Backups Accessible Without Shared Disk describes this technique. To ensure that the source database is in a proper state: If the source database is open, then archiving must be enabled.



Duplicate the database by using the DUPLICATE command. To transfer the backups from the source host to the destination host: Create a backup storage directory in either the source or destination host.

servicesApplication This example describes how to perform duplication to a remote host by using backup-based duplication without a target connection or recovery catalog. Figure 25-3 illustrates backup-based duplication without connections to the target or to the recovery catalog database instance. The LOGFILE clause specifies the names and location of the online redo log files. SQL> The duplicate database files are stored in the duplicate database by using OMF-generated names. You can use the same directory structure and names only when duplicating to a remote host. If a recovery catalog exists, then you can perform backup-based duplication without connecting RMAN as TARGET to the source database. Depending on the technique used to specify alternate names for duplicate database files, include one or more of the following parameters in the initialization parameter file: CONTROL_FILES, DB_FILE_NAME_CONVERT, LOG_FILE_NAME_CONVERT, DB_CREATE_FILE_DEST, DB_CREATE_ONLINE_FILE_DEST_n, and RECOVERY_FILE_DEST. This block size must match the block size of the source database. The source database and the duplicate database use Oracle Managed Files (OMF) to create database files. The BACKUP LOCATION option is used to specify the location of the source database backups. Backup sets can be created in parallel, on the source database, by using multisection backups. On the auxiliary instance, open the Oracle keystore that was copied from the source Oracle Cloud database. In this example, backup-based duplication using a recovery catalog connection is performed. t values(1);

The DB_NAME of the source database is ora and its Net Service name is oradb.

oracle]$ export ORACLE_SID=test, RMAN> duplicate database to "test" The RMAN client is run from a host other than the destination host, The duplication technique chosen is active database duplication, The destination host is different from the source host. If you omit the name of the PDB, root is taken as the default. Therefore, no additional channels need to be configured to perform active database duplication by using image copies. You want to use multisection backups, compression, or encryption while duplicating your database. Both the source database and the duplicate database manage database files by using Oracle Managed Files (OMF). Configuring additional channels improves the duplication performance. Any user with a SYSDBA or SYSBACKUP privilege can perform duplication. DDATE If the source database parameter file contains a value for the DB_BLOCK_SIZE initialization parameter, then you must specify the same value for the auxiliary instance. To perform PITR to a different SID with different file locations, there are few more added steps.

Connect to the auxiliary instance as AUXILIARY. The remaining tablespaces are skipped.

This example describes how to use active database duplication to duplicate a PDB into an existing CDB. DBAOracle The initialization parameter file for the auxiliary instance must contain at least the DB_NAME and DB_DOMAIN initialization parameters. This example describes how to perform duplication to a remote host by using backup-based duplication with a recovery catalog. If you want to store the duplicate data files in a directory that is different from +DATA, then replace the value of db_create_file_dest in the dup_aux_db function with a value that is appropriate for your duplication scenario. Then copy all backup files from the target

The duplicate database uses a directory structure that is different from that of the source host to store database files. RMAN can use the same channel configurations on the source database for duplication on the destination host even if the source database channels do not specify the AUXILIARY option. table. In this example, the DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT initialization parameters are used to specify how the source database file names are converted to duplicate database file names. SQL> You must supply the net service name to connect to the AUXILIARY instance. Start RMAN and connect to the root as a user with the SYSDBA or SYSBACKUP privilege.

See "Using the LOG_FILE_NAME_CONVERT Parameter to Generate Names for Non-OMF or ASM Log Files". In this case, RMAN automatically catalogs the backups in the new location. Create the directories that will store the duplicate database files on the destination host. Use the USING COMPRESSED BACKUPSET clause of the DUPLICATE command to compress the backup sets that contain data which is required to perform active database duplication. The auxiliary instance then connects to the source database through Oracle Net Services and retrieves the required database files, over the network, from the source database.

Ensure that auxiliary channels on the destination host can access all data file backups and archived redo log files. Our source SID is prod and the clone database SID will also be prod. It contains the following entries: See "Creating an Initialization Parameter File for the Auxiliary Instance".

For OMF and ASM database files, you must use the SET NEWNAMETO NEW comand and not explicitly provide names for the database files. The source CDB and the destination CDB use local undo. Feel free to ask questions on our Configure additional auxiliary channels to improve the performance of the duplicate operation. The duplicate database control file is stored as +REDO/ORACLE_SID/CONTROLFILE/cf3.ctl and the data files are stored in the +DATA directory. To duplicate PDBs, you must log in to the root of the CDB as a user with the SYSDBA or SYSBACKUP privilege. Ensure that the prerequisites for active duplication and the additional prerequisites for duplicating a PDB to an existing CDB are met, as described in, Create the directories that will store the duplicate database files on the destination host, as described in. The destination host used OMF and has the Oracle Database software installed. Source database backups are encrypted by using transparent-mode encryption with the encryption key stored in a password-based software keystore. All legitimate Oracle experts

See "Configuring RMAN Channels for Use in Duplication". If necessary, install media management software on the destination host. Duplication does not involve a standby database, Server parameter files are not being duplicated, The auxiliary instance was not started with a server parameter file, The DUPLICATE entry in Oracle Database Backup and Recovery Reference for a complete list of which files are copied to the duplicate database. It contains the following entries: A password file is required because the duplicate database is being created on a remote host. With tape-based duplication, you can allocate only as many channels as the number of tape devices that are available.

Names of the backups used during duplication are stored in the RMAN repository or control file. When duplicating to a remote host, setting up a password file is mandatory. Both the source database and the duplicate database manage database files by using OMF. Location for Oracle managed online redo log files. Provides specific names for the duplicate database files.

Shut down and restarts the auxiliary database instance on the destination host in. commit; Channels perform the primary task of duplicating the database.

Replace the following placeholders (shown in Italics) with values appropriate to your duplication scenario: dup_db: SID and service name of the auxiliary instance, tgt_db: SID and service name of the target database, sys_pswd: Password for the SYS user of the target database, rman_cat_user: Name of the RMAN catalog user, cat_user_pswd: Password for the RMAN catalog user rman_cat_user, rman_catalog_db: SID of the RMAN catalog database, system_pswd: Password for the SYSTEM user in the target database.

If you find an error In this example, a connection is established to the source database and the auxiliary instance using net service names. If you are connecting to the auxiliary instance remotely or intend to use the PASSWORD FILE option of the DUPLICATE command, then connect to the auxiliary instance with a net service name. The steps to duplicate CDBs and PDBs have minor variations from the steps used for non-CDBs. In backup-based duplication, the primary work of duplicating the database is performed by auxiliary channels. This section contains examples on duplicating databases by using different duplication techniques. Use the SET command with the DECRYPTION WALLET OPEN IDENTIFIED BY clause to specify the password that must be used to open the keystore. For backup-based duplication, you can either create a password file or use operating system authentication to connect to the auxiliary instance. The DB_NAME of the source database is db12 and that of the duplicate database is dup.

You can use different techniques to duplicate a database by using backup-based duplication. Table created. will be restored. You can mix full and incremental backups of individual data files, but a full backup of every data file is required. insert into Figure 25-2 illustrates backup-based duplication without a target connection. By default, RMAN creates the control file in the default location in the duplicate database.

Create a minimal initialization parameter file for the auxiliary instance, as described in "Creating an Initialization Parameter File for the Auxiliary Instance". 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. The remaining tablespaces in the source database are self-contained and do not have links to the hr and sh tablespaces. UpgradesSQL A connection to the source database is not available, but a connection to the recovery catalog is available. until time "to_date('31-08-2010 13:31:18','dd-mm-yyyy When backup sets are used to perform active database duplication, RMAN can use backup compression to minimize the size of the backup sets that are used to transfer files from the source database to the destination host. The read-only tablespaces in the source database must be excluded from the duplicate database. When tablespaces are taken offline with the OFFLINE NORMAL option before duplication, RMAN does not duplicate the associated data files, and issues DROP TABLESPACE statement for these tablespaces on the duplicate database.