Oracle9i Recovery Manager User's Guide Release 2 (9.2) Part Number A96566-01 |
|
This chapter describes how to use the DUPLICATE
command to create a duplicate database for testing purposes. This chapter contains these topics:
See Also:
Oracle9i Data Guard Concepts and Administration to learn how to create a standby database using the |
You can use the RMAN DUPLICATE
command to create a duplicate database from target database backups while still retaining the original target database. The duplicate database can be either identical to the original database or contain only a subset of the original tablespaces. A duplicate database is a copy of the target database that you can run independently for a variety of purposes. For example, you can use it to:
For example, you can duplicate the production database on host1
to host2
, and then use the duplicate database on host2
to practice restore and recovery scenarios while the production database on host1
continues as usual.
A duplicate database is distinct from a standby database, although both types of databases are created with the DUPLICATE
command. A standby database is a copy of the primary database that you can update continually or periodically by using archived logs from the primary database. If the primary database is damaged or destroyed, then you can perform failover to the standby database and effectively transform it into the new primary database. A duplicate database, on the other hand, cannot be used in this way: it is not intended for failover scenarios and does not support the various standby recovery and failover options.
See Also:
Chapter 13, "Creating a Standby Database with Recovery Manager" to learn how to create a standby database with the |
To prepare for database duplication, you must first create an auxiliary instance as described in "Preparing the Auxiliary Instance for Duplication: Basic Steps". For the duplication to work, you must connect RMAN to both the target (primary) database and an auxiliary instance started in NOMOUNT
mode.
You must have at least one auxiliary channel allocated on the auxiliary instance. The principal work of the duplication is performed by the auxiliary channel, which starts a server session on the duplicate host. This channel then restores the necessary backups of the primary database, uses them to create the duplicate database, and initiates recovery.
So long as RMAN is able to connect to the primary and duplicate instances, the RMAN client can run on any machine. However, all backups, copies of datafiles, and archived logs used for creating and recovering the duplicate database must be accessible by the server session on the duplicate host. If the duplicate host is different from the primary host, then you must make backups and copies on the primary host disks available to the remote node with the same full path name as in the primary database. You can accomplish this goal in two ways:
In the case of tape backups, you must make the tapes containing the backups accessible to the remote node, either by physically moving the tape to the remote host or by using a network tape server.
As part of the duplicating operation, RMAN manages the following:
RESETLOGS
option after incomplete recovery to create the online redo logs (except when running DUPLICATE
...
FOR
STANDBY
, in which case RMAN does not open the database)DUPLICATE
...
FOR
STANDBY
, in which case RMAN does not create a unique DBID)During duplication, RMAN must perform incomplete recovery because the online redo logs in the target are not backed up and cannot be applied to the duplicate database. The farthest that RMAN can go in recovery of the duplicate database is the most recent redo log archived by the target database.
See Also:
Chapter 13, "Creating a Standby Database with Recovery Manager" to learn how to create a standby database with RMAN |
When duplicating a database, you can do the following:
DUPLICATE
command with or without a recovery catalogSKIP
READONLY
clause. Read-only tablespaces are included by default. If you omit them, then you can add them later.SKIP
TABLESPACE
clause. You cannot skip the SYSTEM
tablespace or tablespaces containing rollback or undo segments.NOFILENAMECHECK
option and reuse the target datafile filenames for the duplicate datafiles.SET
UNTIL
command or DUPLICATE
command with the UNTIL
clause when creating the duplicate database to recover it to a noncurrent time. By default, the DUPLICATE
command creates the database by using the most recent backups of the target database and then performs recovery to the most recent consistent point contained in the incremental backups and archived logs.
Note: If you copy the target database by means of operating system utilities, then the DBID of the copied database remains the same as the original database. To register the copy database in the same recovery catalog with the original, you must change the DBID with the DBNEWID utility (refer to Oracle9i Database Utilities). |
DB_NAME
differently from the target database DB_NAME
in some cases. If the duplicate database exists in the same Oracle home as the target, then the DB_NAME
initialization parameter must be different. If the duplicate database resides in a different Oracle home (on the same machine or on another machine), then its DB_NAME
setting just has to be different from other database names in the same Oracle home on the duplicate host.RMAN duplication involves a number of prerequisites, restrictions, and caveats. Review the restrictions section of the DUPLICATE
syntax entry before attempting duplication (see Oracle9i Recovery Manager Reference for DUPLICATE
syntax).
See Also:
Oracle9i Recovery Manager Reference for |
When duplicating a database, RMAN creates the required database files. This section describes these stages of file creation:
The DUPLICATE
command creates the control files by using the names listed in the initialization parameter file of the auxiliary instance. When choosing names for the duplicate database control files, make sure that you set the initialization parameter settings correctly so that you do not overwrite the production files at the target database.
Table 12-1 lists the options for creating the names of the duplicate online redo logs. The options appear in the order of precedence.
The order of precedence determines how RMAN renames the online redo logs. For example, if you specify both the LOGFILE
clause and the LOG_FILE_NAME_CONVERT
parameter, then RMAN uses the LOGFILE
clause. If you specify neither of the first two options, then RMAN uses the original target redo log filenames for the duplicate database files.
To have different filenames for the duplicate datafiles, you must use parameters or commands to specify them. Table 12-2 lists the options for renaming datafiles. The options appear in the order of precedence.
The order of precedence determines how RMAN names the files. For example, if you specify all the commands and the initialization parameter, then RMAN uses SET
NEWNAME
. If you run CONFIGURE
AUXNAME
and DB_FILE_NAME_CONVERT
, then RMAN uses CONFIGURE
AUXNAME
. If you do not specify any of the first three options, then RMAN uses the original target filenames for the duplicate file.
When you specify SKIP
READONLY
, RMAN does not duplicate the datafiles of read-only tablespaces. After duplication is complete, you can query the views in the duplicate database described in Table 12-3 and Table 12-4 to determine whether datafiles are read-only. The STATUS
and ENABLED
columns are the key to determining the current status of the duplicate datafile.
In the column ... | The value is ... |
---|---|
|
|
|
|
|
|
View | In the column ... | The value is ... |
---|---|---|
|
|
|
|
|
|
When tablespaces are taken offline with the OFFLINE
NORMAL
option, RMAN does not duplicate the datafiles of these tablespaces. After duplication, you can manually add or drop these tablespaces. Query the views in the duplicate database described in Table 12-5 and Table 12-6 to determine whether datafiles are offline. The STATUS
and ENABLED
columns are the key to determining the current status of the datafile.
In the column ... | The value is ... |
---|---|
|
|
|
|
|
|
View | In the column ... | The value is ... |
---|---|---|
|
|
|
|
|
|
When you take a tablespace offline with the IMMEDIATE
option, RMAN duplicates rather than skips the tablespace because this tablespace requires recovery. As with online tablespaces, RMAN requires a valid backup for duplication.
It is possible for a CONFIGURE
AUXNAME
, SET
NEWNAME
, or DB_FILE_NAME_CONVERT
to generate a name that is already in use in the target database. In this case, specify NOFILENAMECHECK
to avoid an error message. For example, assume that the host A database has two files: datafile 1
is named /oracle/data/file1.f
and datafile 2
is named /oracle/data/file2.f
. When duplicating to host B, you use a configured channel to duplicate as follows:
RUN { SET NEWNAME FOR DATAFILE 1 TO /oracle/data/file2.f; # rename datafile 1 as file2.f SET NEWNAME FOR DATAFILE 2 TO /oracle/data/file1.f; # rename datafile 2 as file1.f DUPLICATE TARGET DATABASE TO newdb; }
Even though you issued SET
NEWNAME
commands for all the datafiles, the DUPLICATE
command fails because the duplicate filenames are still in use in the target database. Although datafile 1
in the target is not using /oracle/data/file2.f
, and datafile 2
in the target is not using /oracle/data/file1.f
, the target filename is used by one of the duplicate datafiles and so you must specify NOFILENAMECHECK
to avoid an error.
Perform these tasks before performing RMAN duplication:
For instructions on how to create and maintain Oracle password files, refer to Oracle9i Database Administrator's Guide.
The auxiliary instance must be accessible through Oracle Net. Before proceeding, start SQL*Plus to ensure that you can establish a connection to the auxiliary instance. Note that you must connect to the auxiliary instance with SYSDBA
privileges, so a password file must exist.
Create a client-side initialization parameter file for the auxiliary instance, and set at least the parameters described in the following table.
Parameter | You must specify: |
---|---|
|
The same name used in the |
|
Refer to "Creating the Duplicate Control Files". |
Optionally, set the parameters described in the following table.
Parameter | You must specify: |
---|---|
|
Refer to "Naming the Duplicate Datafiles". |
|
Set other parameters, including the parameters that allow you to connect as SYSDBA
through Oracle Net, as needed. When duplicating to the same host or to a new host with a different file system, pay special attention to all parameters specifying path names. Verify that all paths are accessible on the host where the database is being duplicated.
Following are examples of the initialization parameter settings for the duplicate database:
DB_NAME=newdb CONTROL_FILES=(/dup/oracle/oradata/trgt/control01.ctl, /dup/oracle/oradata/trgt/control02.ctl) DB_FILE_NAME_CONVERT=(/oracle/oradata/trgt/,/dup/oracle/oradata/trgt/) LOG_FILE_NAME_CONVERT=(/oracle/oradata/trgt/redo,/dup/oracle/oradata/trgt/redo)
After you create the client-side initialization parameter file, you can run the CREATE
SPFILE
command from SQL*Plus to create a server-side initialization parameter file. You can run this command before or after instance startup. For example, you can create a server-side parameter file in the default location as follows, specifying the filename of the client-side initialization parameter file in the FROM
clause:
CREATE SPFILE FROM PFILE='/tmp/initDUPDB.ora';
A server-side parameter file in the default location is an advantage when duplicating a database because you do not need to specify the PFILE
parameter on the DUPLICATE
command. Because RMAN shuts down and restarts the auxiliary instance as part of the duplication process, you must tell RMAN which client-side file to use if you use a client-side parameter file. It is highly recommended that you create a server-side parameter file for use in database duplication.
Before beginning RMAN duplication, use SQL*Plus to connect to the auxiliary instance and start it in NOMOUNT
mode (specifying a client-side parameter file if necessary). In this example, oracle
is the password for the user with SYSDBA
authority and aux
is the net service name for the auxiliary instance:
CONNECT SYS/oracle@aux AS SYSDBA -- start instance with the server parameter file STARTUP FORCE NOMOUNT
Because the auxiliary instance does not yet have a control file, you can only start the instance in NOMOUNT
mode. Do not create a control file or try to mount or open the auxiliary instance.
RMAN shuts down and restarts the auxiliary instance as part of the duplication process. Hence, it is a good idea to create a server-side initialization parameter file for the auxiliary instance in the default location.
If you do not have a server-side initialization parameter file for the auxiliary instance in the default location, then you must specify the client-side initialization parameter file with the PFILE
parameter on the DUPLICATE
command. The client-side parameter file for the auxiliary instance must reside on the same host as the RMAN executable used to perform the duplication.
Before beginning RMAN duplication, connect SQL*Plus to the target database and mount or open tit--specifying a client-side parameter file if necessary--if it is not already mounted or open. For example, enter:
-- connect to target database
CONNECT SYS/oracle@trgt
-- mount or open target database
STARTUP
Make sure backups all target datafiles are available on the duplicate host. If you do not have backups of everything, then the duplicate operation fails. The database backup does not have to be a whole database backup: you can use a mix of full and incremental backups of individual datafiles.
Make sure that you meet either of the following conditions:
Start RMAN with a connection to the target database, the duplicate database, and (if you use one) the recovery catalog database. You can start the RMAN executable on any host so long as it can connect to all the instances. Note that if the duplicate instance requires a client-side initialization parameter file, then this file must exist on the same host that runs the RMAN executable.
In this example, a connection is established to three databases, all through the use of net service names:
% rman TARGET SYS/oracle@trgt CATALOG rman/cat@catdb AUXILIARY SYS/oracle@aux
If you do not have automatic channels configured, then before issuing the DUPLICATE
command, manually allocate at least one auxiliary channel within the same RUN
command. The channel type (DISK
or sbt
) must match the media where the backups of the target database are located. If the backups reside on disk, then the more channels you allocate, the faster the duplication will be. For tape backups, limit the number of channels to the number of devices available for the operation.
RUN { # to manually allocate a channel of type sbt issue: ALLOCATE AUXILIARY CHANNEL ch1 DEVICE TYPE sbt; # to manually allocate three auxiliary channels for disk issue (specifying whatever # channel id that you want): ALLOCATE AUXILIARY CHANNEL aux1 DEVICE TYPE DISK; ALLOCATE AUXILIARY CHANNEL aux2 DEVICE TYPE DISK; ALLOCATE AUXILIARY CHANNEL aux3 DEVICE TYPE DISK; . . . DUPLICATE ... }
When you create a duplicate database, the procedure differs depending on your configuration. This section contains these topics:
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.
DUPLICATE
command, making sure to do the following:
NOFILENAMECHECK
parameter on the DUPLICATE
command.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 executable used to perform the duplication.The following example assumes that the RMAN executable 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 executable) 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.
If you create the duplicate database on a host with a different file system, then you need to change several initialization parameters and generate new filenames for the duplicate database datafiles.
Use LOG_FILE_NAME_CONVERT
or the LOGFILE
clause to convert the online redo log filenames. Use DB_FILE_NAME_CONVERT
, the SET
NEWNAME
command, or the CONFIGURE
AUXNAME
command for the datafile filenames.
This section contains these topics:
See Also:
Table 12-2 for a table of the various datafile filename conversion options |
This procedure assumes that you set initialization parameters to rename the duplicate datafiles and log files.
_DEST
or _PATH
and specify a path name.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/
.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
.
PFILE
parameter.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; # Note that DUPLICATE DEVICE TYPE sbt works only if the sbt device is configured # with 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.
This procedure assumes that you set initialization parameters to rename the duplicate datafiles and the LOGFILE
clause to specify names and sizes for the online redo logs.
LOG_FILE_NAME_CONVERT
parameter.LOGFILE
clause.PFILE
parameter.The following example duplicates the database with an automatic channel and specifies an initialization parameter file as well as the LOGFILE
clause:
DUPLICATE TARGET DATABASE TO dupdb # specify client-side parameter file for auxiliary instance if necessary PFILE = /dup/oracle/dbs/initDUPDB.ora 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;
This procedure assumes that you use the SET
NEWNAME
command to rename the duplicate datafiles.
_DEST
or _PATH
and specify a path name.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.
This procedure assumes that you use the CONFIGURE
AUXNAME
command to rename the duplicate datafiles.
_DEST
or _PATH
and specify a path name.PFILE
parameter. The client-side parameter file must reside on the same host as the RMAN executable used to perform the duplication.The following example uses automatic channels and a client-side initialization parameter file for the database duplication, and uses the LOGFILE
clause to specify names and sizes for the online redo logs:
# run the DUPLICATE command DUPLICATE TARGET DATABASE TO dupdb # specify client-side parameter file for auxiliary instance if necessary PFILE = /dup/oracle/dbs/initDUPDB.ora . . . # 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 and then opens the database with the RESETLOGS
option to create the online redo logs.
# un-specify auxiliary names for the datafiles CONFIGURE AUXNAME FOR DATAFILE 1 CLEAR; CONFIGURE AUXNAME FOR DATAFILE 2 CLEAR; . . . CONFIGURE AUXNAME FOR DATAFILE n CLEAR;
When creating a duplicate database on the same host as the target database, follow the same procedure as for duplicating to a remote host with a different directory structure as described in "Duplicating a Database on a Remote Host with a Different Directory Structure".
Note that you can duplicate the database to the same Oracle home as the target database, but you must convert the filenames by means of the same methods used for conversion on a separate host.
Caution: Do not use the |
This section contains these topics:
This example assumes the following:
catdb
.trgt
is on host1
and contains eight datafiles.dupdb
on remote host host2
.host1
and host2
use different file systems.host2
in the ?/oradata/dup/
subdirectory.tools
from the duplicate database, but keep all of the other tablespaces.host1
to an appropriate location in host2
._DEST
or _PATH
and specify a path name.host2
by means of an operating system utility.sbt
. The media management device is accessible by host2
.PFILE
parameter is not necessary on the DUPLICATE
command).
CONNECT TARGET; CONNECT CATALOG rman/cat@catdb; CONNECT AUXILIARY SYS/oracle@dupdb; # note that a RUN command is necessary because you can only execute SET NEWNAME # within a RUN command RUN { # the DUPLICATE command uses an automatic sbt channel SET NEWNAME FOR DATAFILE 1 TO '?/oradata/dup/system01.dbf'; SET NEWNAME FOR DATAFILE 2 TO '?/oradata/dup/undotbs01.dbf'; SET NEWNAME FOR DATAFILE 3 TO '?/oradata/dup/cwmlite01.dbf'; SET NEWNAME FOR DATAFILE 4 TO '?/oradata/dup/drsys01'; SET NEWNAME FOR DATAFILE 5 TO '?/oradata/dup/example01.dbf'; SET NEWNAME FOR DATAFILE 6 TO '?/oradata/dup/indx01.dbf'; # do not set a newname for datafile 7, because it is in the tools tablespace, # and you are excluding tools from the duplicate database SET NEWNAME FOR DATAFILE 8 TO '?/oradata/dup/users01.dbf'; DUPLICATE TARGET DATABASE TO dupdb SKIP TABLESPACE tools LOGFILE GROUP 1 ('?/oradata/dup/redo01a.log', '?/oradata/dup/redo01b.log') SIZE 200K REUSE, GROUP 2 ('?/oradata/dup/redo02a.log', '?/oradata/dup/redo02b.log') SIZE 200K REUSE; }
This example makes the same assumptions as in "Setting New Filenames Manually: Example". Additionally, it assumes that you want to update the duplicate database daily so that it stays current with the target database.
# start RMAN and then connect to the databases CONNECT TARGET; CONNECT CATALOG rman/cat@catdb; CONNECT AUXILIARY SYS/oracle@dupdb; # configure auxiliary names for the datafiles only once CONFIGURE AUXNAME FOR DATAFILE 1 TO '?/oradata/dup/system01.dbf'; CONFIGURE AUXNAME FOR DATAFILE 2 TO '?/oradata/dup/undotbs01.dbf'; CONFIGURE AUXNAME FOR DATAFILE 3 TO '?/oradata/dup/cwmlite01.dbf'; CONFIGURE AUXNAME FOR DATAFILE 4 TO '?/oradata/dup/drsys01'; CONFIGURE AUXNAME FOR DATAFILE 5 TO '?/oradata/dup/example01.dbf'; CONFIGURE AUXNAME FOR DATAFILE 6 TO '?/oradata/dup/indx01.dbf'; # do not configure an auxiliary name for datafile 7, because it is in the tools # tablespace, and you are excluding tools from the duplicate database CONFIGURE AUXNAME FOR DATAFILE 8 TO '?/oradata/dup/users01.dbf'; # Create the duplicate database. Issue the same command daily # to re-create the database, thereby keeping the duplicate # in sync with the target. DUPLICATE TARGET DATABASE TO dupdb SKIP TABLESPACE tools LOGFILE GROUP 1 ('?/oradata/dup/redo01a.log', '?/oradata/dup/redo01b.log') SIZE 200K REUSE, GROUP 2 ('?/oradata/dup/redo02a.log', '?/oradata/dup/redo02b.log') SIZE 200K REUSE;
This duplication example assumes the following:
trgt
and duplicate database dupdb
are on different hosts but have exactly the same directory structure.prod1
as it appeared at that time.
CONNECT TARGET SYS/oracle@trgt CONNECT AUXILIARY SYS/oracle@dupdb RUN { SET UNTIL TIME 'SYSDATE-7'; ALLOCATE AUXILIARY CHANNEL dupdb1 DEVICE TYPE sbt; DUPLICATE TARGET DATABASE TO dupdb NOFILENAMECHECK; }
If you use a client-side initialization parameter file to start the auxiliary instance, then it must reside on the same host as the RMAN executable used to perform the duplication. Assume the following scenario:
host_tar
and the duplicate host is host_dup
host_dup
is named ?/dbs/initTEST.ora
.host_dup
and host_tar
are linked by a network.In this scenario, you can run the RMAN executable (that is, run the DUPLICATE
command in an RMAN session) either on host_tar
or host_dup
.
If you run the executable on host_dup
, you can duplicate the database as follows:
DUPLICATE TARGET DATABASE TO dupdb DEVICE TYPE sbt PFILE='?/dbs/initTEST.ora';
Because the initialization parameter file used by the auxiliary instance resides on the same node as the RMAN executable, you can reference the local filename of the parameter file.
In this scenario, you run RMAN on the same host as the target database rather than on the host with the duplicate database. Hence, the client-side initialization parameter file needed by the DUPLICATE
command is not located on the same node as the RMAN executable. You must do one of the following:
host_dup
to host_tar
.host_dup
directory containing the parameter file on the host_tar
file system.In this scenario, you manually copy the file from one host to another as follows:
% cp /net/host_dup/oracle/dbs/initTEST.ora /net/host_tar/tmp
Then, you can start RMAN on host_tar
and perform the duplication with the following shell script:
#!/usr/bin/sh rman TARGET SYS/oracle@trgt AUXILIARY SYS/oracle@dupdb <<EOF DUPLICATE TARGET DATABASE TO dupdb DEVICE TYPE sbt PFILE='/tmp/initTEST.ora'; EOF
In this scenario, you mount the host_dup
file system on the host_tar
file system by using /tmp
as the mount point. The /tmp/initTEST.ora
filename on host_tar
points to the ?/dbs/initTEST.ora
file residing on host_dup
. Then, you can run the duplication as follows:
DUPLICATE TARGET DATABASE TO dupdb DEVICE TYPE sbt PFILE='/tmp/initTEST.ora';
|
Copyright © 1996, 2002 Oracle Corporation. All Rights Reserved. |
|