|
Страница 1 из 3 
The procedure to create a duplicate database depends on your configuration. This section contains the following topics:
Duplicating a Database on a Remote Host with the Same Directory Structure The simplest case is to duplicate the database to a different host and to use the same directory structure. In this case, you do not need to change the initialization parameter file or set new filenames for the duplicate datafiles. -
Follow the steps in "Preparing the Auxiliary Instance for Duplication: Basic Steps". -
Run the DUPLICATE command, making sure to do the following: -
If automatic channels are not configured, then allocate at least one auxiliary channel. -
Specify the NOFILENAMECHECK parameter on the DUPLICATE command. -
Specify the PFILE parameter if starting the auxiliary instance with a client-side parameter file. The client-side parameter file must exist on the same host as the RMAN client used to perform the duplication. The following example assumes that the RMAN client is running on the duplicate host. It duplicates the database with an automatic channel, specifies a client-side initialization parameter file, and specifies the NOFILENAMECHECK option: DUPLICATE TARGET DATABASE TO dupdb # specify client-side parameter file (on same host as RMAN client) for # auxiliary instance if necessary PFILE = /dup/oracle/dbs/initDUPDB.ora NOFILENAMECHECK; RMAN automatically allocates the configured channels, then uses all incremental backups, archived redo log backups, and archived redo logs to perform incomplete recovery. Finally, RMAN opens the database with the RESETLOGS option to create the online redo logs. Duplicating a Database on a Remote Host with a Different Directory Structure If you create the duplicate database on a host with a different directory structure, then you must change several initialization parameters in order to generate new filenames for the duplicate database datafiles on the new directory structure. The different techniques available are described in "Renaming Datafiles When Duplicating a Database". Converting Filenames with Only Initialization Parameters This procedure assumes that you use only initialization parameters to rename the duplicate datafiles and log files. -
Follow the steps in "Preparing the Auxiliary Instance for Duplication: Basic Steps". You can either create a client-side parameter file, or copy the parameter file from its location in the target host directory structure to the same location in the duplicate host directory structure using operating system utilities. Perform the following tasks: -
Review all initialization parameters that end in _DEST and specify a path name. Some may need to be changed. -
Set DB_FILE_NAME_CONVERT so that it captures all the target datafiles and converts them appropriately, for example, from /oracle/oradata/ to /dup/oracle/oradata/. -
Set LOG_FILE_NAME_CONVERT so that it captures all the online redo logs and converts them appropriately, for example, /oracle/oradata/redo to /dup/oracle/oradata/redo. | Note: You can set multiple conversion pairs in DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT. For example, you can specify that DB_FILE_NAME_CONVERT/disk1/dbs to /dup1/dbs and /disk2/dbs to /dub2/dbs. changes | While this scenario uses DB_FILE_NAME_CONVERT, you can use the CONFIGURE AUXNAME or SET NEWNAME commands to rename individual datafiles if you cannot easily generate all of your desired filenames using DB_FILE_NAME_CONVERT commands. As described in "Duplicating a Database to an Oracle Managed Files Storage Location", you can also duplicate your database to an Oracle Managed Files location and let the database generate names for your files. -
Perform the following operations when running the duplication: -
If automatic channels are not configured, then allocate at least one auxiliary channel. -
If using a client-side parameter file to start the auxiliary instance, specify the PFILE parameter. Converting Filenames with Only Initialization Parameters: Example The following example assumes that the duplicate host can access the same media manager as the primary database host. The example duplicates the database with an automatic sbt channel and uses a server-side parameter file located on the duplicate host to restart the auxiliary instance: DUPLICATE TARGET DATABASE TO dupdb DEVICE TYPE sbt # restores from tape backups; # DUPLICATE DEVICE TYPE sbt works only if the sbt device is configured # by CONFIGURE CHANNEL, CONFIGURE DEVICE TYPE, or CONFIGURE DEFAULT DEVICE. RMAN uses all incremental backups, archived redo log backups, and archived redo logs to perform incomplete recovery. RMAN then shuts down, starts, and opens the database with the RESETLOGS option to create the online redo logs. Converting Filenames with Only DUPLICATE Parameters This procedure assumes that you use the DB_FILE_NAME_CONVERT parameter of the DUPLICATE command to rename the duplicate datafiles, and the LOGFILE clause to specify names and sizes for the online redo logs. Perform the following operations when running the duplication: -
If automatic auxiliary channels are not configured, then allocate at least one auxiliary channel. -
Specify the names and sizes for the duplicate database redo logs in the LOGFILE clause. -
Specify new filenames for the duplicate database datafiles with the DB_FILE_NAME_CONVERT parameter. -
If using a client-side parameter file to start the auxiliary instance, specify the PFILE parameter. Converting Filenames with Only DUPLICATE Parameters: Example The following example duplicates the database with an automatic channel and specifies an initialization parameter file: DUPLICATE TARGET DATABASE TO dupdb # specify client-side parameter file for auxiliary instance if necessary PFILE = /dup/oracle/dbs/initDUPDB.ora DB_FILE_NAME_CONVERT=(/oracle/oradata/trgt/,/dup/oracle/oradata/trgt/) LOGFILE '/dup/oracle/oradata/trgt/redo01.log' SIZE 200K, '/dup/oracle/oradata/trgt/redo02.log' SIZE 200K, '/dup/oracle/oradata/trgt/redo03.log' SIZE 200K; Converting Filenames with SET NEWNAME This procedure assumes that you use the SET NEWNAME command to rename the duplicate datafiles. -
Follow the steps in "Preparing the Auxiliary Instance for Duplication: Basic Steps", making sure to use an operating system utility to copy the parameter file from its location in the target host directory structure to the same location in the duplicate host. Set all initialization parameters that end in _DEST and specify a path name. -
Perform the following operations when running the duplication: -
If automatic auxiliary channels are not configured, then allocate at least one auxiliary channel. -
If desired, specify the same number of redo log members and groups that are used in the target database. -
Specify new filenames for the duplicate database datafiles. -
If you use a client-side parameter file to start the auxiliary instance, then specify the PFILE parameter. The following example uses automatic channels and a default server-side initialization parameter file for the database duplication, and uses the LOGFILE clause to specify names and sizes for the online redo logs: RUN { # set new filenames for the datafiles SET NEWNAME FOR DATAFILE 1 TO '/dup/oracle/oradata/trgt/system01.dbf'; SET NEWNAME FOR DATAFILE 2 TO '/dup/oracle/oradata/trgt/undotbs01.dbf'; . . . # issue the duplicate command DUPLICATE TARGET DATABASE TO dupdb # create at least two online redo log groups LOGFILE GROUP1 ( '/dup/oracle/oradata/trgt/redo01a.log', '/dup/oracle/oradata/trgt/redo01b.log', '/dup/oracle/oradata/trgt/redo01c.log'; ) SIZE 200K, GROUP2 ( '/dup/oracle/oradata/trgt/redo02a.log', '/dup/oracle/oradata/trgt/redo02b.log', '/dup/oracle/oradata/trgt/redo02c.log'; ) SIZE 200K, GROUP3 ( '/dup/oracle/oradata/trgt/redo03a.log', '/dup/oracle/oradata/trgt/redo03b.log', '/dup/oracle/oradata/trgt/redo03c.log'; ) SIZE 200K; RMAN uses all incremental backups, archived redo log backups, and archived redo logs to perform incomplete recovery. RMAN shuts down, starts up, and then opens the database with the RESETLOGS option to create the online logs.
|