| Oracle® Data Guard Concepts and Administratio
n 10g Release 1 (10.1) Part Number B10823-01 |
|
|
View PDF font> |
This appendix describes h ow to use Oracle Recovery Manager to create a physical standby database. This appendix contains the following topics:
There are sev eral advantages to using RMAN to create a standby database:
The procedure for preparing a standby database with RMAN is basically the same as for preparing a duplicate databas e. Nevertheless, you need to amend the duplication procedures described in Oracle Database Backup and Recovery Advanced User's Guide to account for the issues specific to a standby database.
Familiarize yourself with how to create a physical standby database in Chapter 3 before you attempt the RMAN creation procedures described in th is chapter.
This section contains these topics:
You can use either manual method
s or the Recovery Manager DUPLICATE command to create a standby database from backups of your primary database. Before y
ou perform the creation procedure, you must prepare the standby instance. You can use RMAN to do the preparation tasks described in <
a href="rcmbackp.htm#636472">Table D-1.
| Task | Procedure |
|---|---|
| <
a name="636480">
Make a backup of the primary database to use to create a standby database. |
Use the normal backup procedure for your primary database as documented in Oracle Database Backup and Recovery Basics. |
|
Create a backup of the prima ry control file that is usable as a standby control file (if you do not have one). |
See Section D.1.2, "Creating the Standby Control File with RMAN". |
|
Choose filenames for the stand by datafiles. |
See Section D.1.3, "Naming the Standby Database Datafiles When Using RMAN". |
|
Choose filenames for the standby database archived redo log files and standby redo log fi les. |
See Section D.1.4, "Naming t he Standby Database Log Files When Using RMAN". |
In addition to the RMAN tasks described in Table D-1, you must also perform the following additional tasks t o set up your standby database:
See Chapter 3 for a complete discussion of physical standby database preparation, including initialization pa rameter settings. You must perform all necessary preparation tasks described in these chapters before RMAN can successfully create th e standby database files and mount the standby database.
You can create the standby control file using either the RMAN BACKUP or COPY com
mands by performing the following steps:
Connect to the primary database and, if desired, th e recovery catalog database. For example, enter:
% rman TARGET SYS/oracle@trgt CATALOG rman/ cat@catdb
Use either of the following commands to create the standby control file. The on
ly difference between BACKUP and COPY commands is that the file format of the backup file is different.
BACKUP command
Mount the primary database and create the standby control file with the BACKUP CURRENT FOR STANDBY command. The following example uses a configured channel to create the st
andby control file. Then open the database, archive all unarchived redo log files, and back up any log files that have not yet been b
acked up at least once:
STARTUP MOUNT BACKUP CURRENT CONTROLFILE FOR S TANDBY; SQL> ALTER DATABASE OPEN; SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT'; # so backup i s consistent and recoverable BACKUP ARCHIVELOG ALL NOT BACKED UP 1 TIMES;
COPY command
Copy
the current primary control file. Specify the FOR STANDBY option of the COPY CURRENT CONTROLFILE command to make a copy of the current control file that is usable as a standby control file. For example
:
COPY CURRENT CONTROLFILE FOR STANDBY TO '/tmp/sby_control01.ctl';
If desired, issue a LIST command to see a listing of the backup sets and pieces, or
issue a LIST COPY command to see a listing of the image copies.
|
Note: If you already created a sta
ndby control file with the SQL
|
A standby database can reside either on the same host as the primary database or on a different host. The following table illustrates the implications for renaming the stan dby database datafiles depending on if the directory structures on the hosts are the same or different.
Same host as primary
Different from primary host
Necessary.
Same host as primary
Same as primary host
Illegal. The standby database dataf iles cannot exist in the same directories as the primary database datafiles on the same host.
Different host from primary
Same as primary host
No t necessary.
Different host from primary
Different from primary host
Necessary.
When the directory structures are different for the primary and standby hosts, you have these options for naming the standby datafi les:
DB_FILE_NAME_CONVERTDB_FILE_NAME_CONVERT opt
ion of the RMAN DUPLICATE commandCONFIGUR
E AUXNAME or SET NEWNAME command when creating the standby databaseWhen the directory structures are the same for the primary and standby hosts, then you have these naming options:
DB_FILE_NAME_CONVERT or issuing a CONFIGURE AUXNAME or S
ET NEWNAME command) and specifying the NOFILENAMECHECK option of the DUPLICATE command<
/li>
DB_FILE_NAME_CONVERT parameter, or the CONFIGUR
E AUXNAME or SET NEWNAME commands to rename the standby datafilesNote that when you use DB_FILE_NAME_CONVERT, the format is as follows:
DB_FILE_NAME_CONVERT = 'oldstring1', 'newstring1', 'oldstring2', 'newstring2', ...
Fo
r example, you can specify the DB_FILE_NAME_CONVERT initialization parameter as follows:
DB_FILE_NAME_CONVERT = '/dbs/t1/', '/dbs/t1/s_', '/dbs/t2/', '/dbs/t2/s_'< /a>
Because you can specify datafile filenames in the standby control file in multiple ways, a method for prioritizing settings is necessary. Table D-2 specifies the hierarchy for the naming of datafiles in the st andby database.
| Method of Standby Da tafile Naming | Requirement | |
|---|---|---|
|
1 |
Issue |
You must issue this comm
and in the |
|
2 |
Use the
|
a>
None. |
|
3 |
Issue |
You must be connected to a recovery catalog, and an |
|
4 |
Datafile filename as currently specified in the standby control file. The standby filename is identical to the primary filename or is
named with the |
If the
filename is different, then the |
See Oracle Database Reference for more information about how to use DB_FILE_NAME_CONVERT to nam
e standby files.
Red o log files are not created on the standby database by RMAN. However, as described in Chapter 3, log files can be created by other actions that you perform on the standby database. After the log files are created, they are main tained and archived according to the normal rules for log files.
The only option when naming
the redo log files on the standby database is the filenames for the log files, as specified in the standby control file. If the log
filenames on the standby must be different from the primary filenames, then one option is to specify filenames for the redo logs by s
etting LOG_FILE_NAME_CONVERT in the standby initialization parameter file.
Note these restrictions when specifying filenames for the redo log files on the standby database:
LOG_FILE_NAME_CONVERT parameter to name the redo log files if the primar
y and standby databases use different naming conventions for the log files.NEWNAME or CONFIGURE AUXNAME commands to rename the redo log files.LOGFILE clause of the DUPLICATE command to specify fi
lenames for the redo log files.NOFILENAMECHECK clause of the When you create a standby datab ase, the procedure differs depending on whether the standby database is on the same host as the primary database or on a different ho st. The procedures in this chapter assume that you have already completed the standby setup and preparation as outlined in Chapter 3. Do not attempt these procedures until you have made all necessary initialization parameter se ttings and network configuration changes.
After you have performed the steps necessary for p
reparing the standby instance, run the Recovery Manager DUPLICATE ... FOR STANDBY
command to create the standby database out of backups of the primary database. Note that a standby database, unlike a duplicate data
base created by DUPLICATE without the FOR STANDBY OPTION,
does not get a new DBID. Hence, you should not register the standby database with your recovery catalog.
The steps for creating the standby database differ depending on whether or not you specify that RMAN should recover the standby database after creating it.
See Oracle Database Backup and Recovery Advanced User's Guide to learn how to use the DUP
LICATE command to create a duplicate database that is not a standby database.
By default, RMAN does not recover the standby database after creating it. If you do
not specify the DORECOVER option of the DUPLICATE command, then RMAN automates these steps of the standby
creation procedure during duplication:
If yo
u do specify the DORECOVER option of the DUPLICATE command, then RMAN performs the same Steps 1-5 in Section D.2.1. Instead of Step 6, it performs these steps:
|
Note: After RMAN creates the standby database, you must resolve any gap sequence before placing it in manual or managed recovery mode, or opening it in read-only mode. Section 5.8 discusses gap sequence resolution in detail. |
If you want RMAN t o recover the standby database after creating it, then the standby control file must be usable for the desired recovery. Thus, these conditions must be met:
One way to ensure these conditions are met is to issue the ALTER SYSTEM ARCHIVE LOG CURRENT statement after creating the standby control file.
This statement archives the online redo log files of the primary database. Then, either back up the most recent archived redo log fi
le with RMAN or move the archived redo log file to the standby site.
|
Note: The procedures in this chapter assume that you ar e using RMAN backups to create the standby database. If you are using RMAN image copies, then refer to Section D.7. |
See Oracle Database Recovery Manager Reference for the list of DUPLICATE restrictions for creating a standby database with RMAN.
No matter which standby creation scenario you choose, you must first start the stand by instance and then connect RMAN to this instance. The details of this procedure vary depending on whether or not the standby and pr imary sites have a different directory structure.
To start the standby instance:
_DEST and _PATH and specify a path
nameDB_FILE_NAME_CONVERT so that it captures
all the target datafiles and converts them appropriately, for example, from tbs_* to sbytbs_*LOG_FILE_NAME_CONVERT so that it captures all the
redo log files and converts them appropriately, for example, log_* to sbylog_*For example, the following are sample parameter settings in the standby database initialization parameter file: p>
STANDBY_ARCHIVE_DEST = /fs3/arc_dest/ LOG_ARCHIVE_FORMAT = log%d_%t_%s_ %r.arc DB_FILE_NAME_CONVERT = '/oracle', '/fs3/oracle', '/dbf', '/fs3/oracle' LOG_FILE_NAME _CONVERT = '/oracle', '/fs3/oracle'
sbdb1 as
SYS (who has SYSDBA privileges) and start the database:
SQL> CONNECT SY S/sys_pwd@sbdb1 AS SYSDBA SQL> STARTUP NOMOUNT PFILE=initSBDB1.ora
prod1 as SYS and open the database:
< a name="636827">SQL> CONNECT SYS/sys_pwd@prod1 AS SYSDBA SQL> STARTUP PFILE=initPROD1.ora
Ensure the recovery catalog database is open. For example, enter the following
to connect to catdb as SYS and open the recovery catalog database:
< /a>SQL> CONNECT SYS/oracle@catdb AS SYSDBA SQL> STARTUP PFILE=initCATDB.ora< /li>
SYSDBA privileges, so a password file must exist.TARGET keyword and the standby instance with th
e AUXILIARY keyword.
In the following example, connection is established wi thout a recovery catalog by using operating system authentication:
% rman TARGET / AUXILIAR Y SYS/sys_pwd@sbdb1
The simplest case is to create the standby database on a different host and to use the same directory structure. I
n this case, you do not need to set the DB_FILE_NAME_CONVERT or LOG_FILE_NAME_CONVERT parameters in the standby initialization parameter file or set new filenames for the standby datafiles. The primary and standby da
tafiles and log files have the same filenames.
To create the standby database without performing recovery, do not specify the DORECOVER
option on the DUPLICATE command. By default, RMAN leaves the standby database mounted and does not recover it.
To create a standby database without performing recovery:
NOFILENAMECHECK in the DUPLICATE command. The NOFILENAMECHECK option is required whe
n the standby and primary datafiles and log files have the same names. Otherwise, RMAN returns an error.For example, run the following command to create the standby database:
DUPLICATE TARGET DATABASE FOR STANDBY NOFILENAMECHECK;
To create the standby database and perform recovery, specify
the DORECOVER option on the DUPLICATE command.
To create a standby database and perform recovery:
SET command to s
pecify the end time, SCN, or log sequence number for incomplete recovery.NOFILENAMECHECK parameter in the DUPLICATE command, and use the DORECOVER o
ption.For example, enter the following at the RMAN prompt to use a configured channe l to create the standby database:
# If desired, issue a LIST command to determine the SCN o f the standby control file. # The SCN to which you recover must be greater than or equal to the standby contro l # file SCN. LIST BACKUP OF CONTROLFILE; LIST COPY OF CONTROLFILE; < a name="636874"> RUN { # If desired, issue a SET command to term inate recovery at a specified point. # SET UNTIL SCN 143508; DUPLICATE TARGET DATABAS E FOR STANDBY NOFILENAMECHECK DORECOVER; } < /a>
RMAN uses all incremental backups, archived redo log file backups, and archived redo log files to perform incomplete recovery. The standby database is left mounted.
If you create the standby database on a host with a d ifferent directory structure, you need to specify new filenames for the standby database datafiles and redo log files. You can do the following:
LOG_FILE_NAME_CONVERT paramete
r in the standby initialization parameter file to name the redo log files on the standby database. If you do not set LOG_FILE_N
AME_CONVERT, then you must use the NOFILENAMECHECK option of the DUPLICATE command.DB_FILE_NAME_CONVERT parameter in the standby initialization parameter fil
e to name the standby datafiles.SET NEWNAME command or the CONFIGURE AUXNAME command when using the RMAN DUPLICATE command to name the d
atafiles.When creating the standby database on a host with a different directory stru cture, follow one of the procedures in the following sections:
See Oracle Database Backup and Reco
very Advanced User's Guide to learn about the difference between SET NEWNAME and CONFIGURE
code> AUXNAME, and Chapter 3 for a complete discussion of physical standby databa
se preparation and creation.
In this procedure, you use the DB_FILE_NAME_CONVERT parameter to name the standby datafiles and the LOG
_FILE_NAME_CONVERT parameter to name the redo log files on the standby database. See Section&nbs
p;3.1.3 for examples of how to use the DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT parameters to nam
e standby database files.
To create the standby database without performing recovery, do not specify the DORECOVER option on the DUPLICATE command. By default, RMAN leaves the standby database mounted and does not recover it.
DUPLICATE command. For example, run the following:
DU PLICATE TARGET DATABASE FOR STANDBY;
After restoring the backups, RMAN leaves the standby database mounted.
After using the DB_FILE_NAME_CONVERT parameter to name the standby datafiles and the <
code>LOG_FILE_NAME_CONVERT parameter to name the log files on the standby database, specify the DORECOVER option
on the DUPLICATE command to create the standby database and perform recovery. The steps in the procedure are the same as
for Section D.4.2.
In this procedure, you use SET NEWNAME commands to name the standby datafil
es.
To create
the standby database without performing recovery, do not specify the DORECOVER option on the DUPLICATE comm
and. By default, RMAN leaves the standby database mounted and does not recover it.
To name standby database files with the SET NEWNAME command without performing recovery:
DUPLICATE command. Perform the following steps:
SET DUPLICATE command.The following example uses a configured channel to create the standby database:
RUN { # set new filenames for the datafiles a> SET NEWNAME FOR DATAFILE 1 TO '?/dbs/standby_data_01.f'; SET NEWNAME FOR DATAFILE 2 TO '?/dbs/standby_dat a_02.f'; . . . # run the DUPLICATE comma nd DUPLICATE TARGET DATABASE FOR STANDBY; }
To create the standby database and perform recover
y, specify the DORECOVER option on the DUPLICATE command.
To use the SET NEWNAME command to name standby database files and perform recovery:
DUPLICATE command. Follow these steps:
SET command to specify the end time, SC
N, or log sequence number for incomplete recovery.DUPLICATE command
with the DORECOVER option.For example, enter the following at the RMAN prompt to use a configured channel to create the standby database:
# If desired, issue a L IST command to determine the SCN of the standby control file. # The SCN to which you recover must be greater th an or equal to the control file SCN. LIST BACKUP OF CONTROLFILE; LIS T COPY OF CONTROLFILE; RUN { # If desired, issue a SET command to te rminate recovery at a specified point. # SET UNTIL TIME 'SYSDATE-7'; < /a> # Set new filenames for the datafiles SET NEWNAME FOR DATAFILE 1 TO '?/dbs/standby_data_01.f'; SET NEWNAME FOR DATAFILE 2 TO '?/dbs/standby_data_02.f'; . . . DUPLICATE TARGET DATABASE FOR STANDBY DORECOVER; }
RMAN uses all incremental backups, archived redo log file backups , and archived redo log files to perform incomplete recovery. The standby database is left mounted.
In this procedure, you use CONFIGURE
code> AUXNAME commands to name the standby datafiles.
To create the standby database without performing recovery, do not specify the <
code>DORECOVER option on the DUPLICATE command. By default, RMAN leaves the standby database mounted and does not
recover it.
To use CONFIGURE AUXNAME to name standby database files wi thout performing recovery:
# set auxiliary names for the datafiles CONFIGURE AUXNA ME FOR DATAFILE 1 TO '/oracle/auxfiles/aux_1.f'; CONFIGURE AUXNAME FOR DATAFILE 2 TO '/oracle/auxfiles/aux_2.f' ; . . . CONFIGURE AUXNAME FOR DATAFILE n TO '/oracle/auxfiles/aux_n.f';
DUPLICATE command. If automatic channels are not configured, manually allocate at
least one auxiliary channel before issuing the DUPLICATE command, as in the following example:
RUN { # allocate at least one auxiliary channel of type DISK or sbt ALLOCATE AUXILIARY CHANNEL standby1 DEVICE TYPE sbt; . . . # issue the DUPLICATE command DUPLICATE TARGET DATABASE FOR STANDBY; }
# un-specify auxiliary names for the datafiles CONFIGURE AUXNAME FOR DATAFILE 1 CLE AR; CONFIGURE AUXNAME FOR DATAFILE 2 CLEAR; . . . CONFIGURE AUXNAME FOR DATAFILE n CLEAR;
To create the standby database and perform recove
ry, specify the DORECOVER option on the DUPLICATE command.
To use CONFIGURE AUXNAME to name standby files and perform recovery:
# set auxiliary n ames for the datafiles CONFIGURE AUXNAME FOR DATAFILE 1 TO '/oracle/auxfiles/aux_1.f'; a>CONFIGURE AUXNAME FOR DATAFILE 2 TO '/oracle/auxfiles/aux_2.f'; . . . CONFIGURE AUXNAME FOR DATAFILE n TO '/oracle/auxfiles/aux_n.f ';
DUPLICATE command
. Follow these steps:
SET command to specify the end time, SCN, or log sequence number for incomplete recovery.DUPLICATE TARGET DATABASE
for standby command.For example, enter the following at the RMAN prompt to use a con figured channel to create the standby database:
# If desired, issue a LIST command to deter mine the SCN of the standby control file. # The SCN to which you recover must be greater than or equal to the c ontrol file SCN. LIST BACKUP OF CONTROLFILE; LIST COPY OF CONTROLFILE; a> DUPLICATE TARGET DATABASE FOR STANDBY DORECOVER;
RMAN uses all incremental backups, archived redo log file backups, and archived redo log files to perfo rm incomplete recovery. The standby database is left mounted.
# un-specify auxiliary names for the datafiles CONFIGURE AUXNA ME FOR DATAFILE 1 CLEAR; CONFIGURE AUXNAME FOR DATAFILE 2 CLEAR; . . . CONFIGURE AUXNAME FOR DATAFILE n CLEAR;
When creating a standby database on the same host as the primary database, follow the same procedure as for duplicating to a remote host with a different directory structure as described in Section D.5.
Note the following rest rictions when creating a standby database on the same host as the primary database:
DB_UNIQUE_NAME initialization parameter on both databases.
This section contains these topics:
The main restriction when
using RMAN image copies to create the standby datafiles is that the image copy filenames for datafiles and archived redo log files o
n the primary and standby hosts must be the same. For example, assume that datafile 1 is named /oracle/dbs/df1.f on the
primary host. If you use the RMAN COPY command to copy this datafile to /data/df1.f, then this image copy m
ust exist on the standby host with the same filename of /data/df1.f. Otherwise, RMAN cannot locate the metadata for the
standby image copy in its repository.
You have two main ways of populating the standby host with the image copies:
ft
p or some other utilityWhen you use the NFS method, you can cre
ate a directory on the primary host that maps to a directory on the standby host. If you use this method, then the NFS mount point on
both machines must have the same directory name. For example, you can map /data on the primary host to /data on the standby host, but you cannot map /data on the primary host to /dir on the standby host (unless yo
u use functionality such as symbolic links in UNIX or logical drives on Windows NT).
The fil
ename of the image copy on the standby host must be the same as the filename of the image copy on the primary host. Nevertheless, you
can specify a different path name for the standby datafile by using SET NEWNAME commands or the DB_F
ILE_NAME_CONVERT initialization parameter.
For example, although the image copy of da
tafile 1 is named /data/df1.f on the standby host, you can specify the path name /oracle/sb/df1.f in the st
andby control file by using initialization parameters or RMAN commands. Note that you do not manually rename the physical image copy.
When you run the DUPLICATE command, RMAN restores the image copy /data/df1.f and creates the standby dataf
ile 1 as /oracle/sb/df1.f based on the information in the initialization parameters or RMAN commands.
Table D-3 illustrates two scenarios for using NFS to create a standby d atabase with one datafile.
| NFS Mount Point | Primary Datafile Filename | Image Copy Filename< /th> | |
Procedure |
|---|---|---|---|---|
|
(sa me on both hosts) |
|
|
(same path name as image copy) |
See Section D.7.2, "When Copies and Datafiles Use the Same Names" a> |
|
(same on both hosts) |
|
|
(different p ath name from image copy) |
See Section& nbsp;D.7.3, "When Copies and Datafiles Use Different Names" |
Table D-3 assumes that the standby directory structure is mounted on the primary host, and that
the mount point is /data on both hosts. Because the primary host mounts the standby host directory structure, when you c
reate the image copy /data/df1.f on the primary host, you are actually creating the image copy /data/df1.f
on the standby host.
In the first scenario, you name the standby datafiles with the same fil
enames as the image copies. This case is the simplest because you do not need to use RMAN at all to create the standby database. Firs
t, set the DB_FILE_NAME_CONVERT parameter in the standby initialization parameter file to convert the primary datafile f
ilename /oracle/dbs/df1.f to the standby filename /data/df1.f. Then, copy the files to the standby host, an
d mount the standby database.
In the second scenario, you use different filenames for the st
andby datafiles and the image copies. To create this standby database, run the DUPLICATE command. The DUPLICATE command restores the image copy of datafile 1 and renames it according to either the SET NEWNAME comma
nds or the DB_FILE_NAME_CONVERT initialization parameter.
This procedure assumes that you are using the same filenames for the standby datafiles and the image copies of the primary datafiles.
To create a standby database when the copies and standby datafiles have the same names:
RMAN> STARTUP MOUNT PFILE=init.ora;
DB_FILE_NAME_CONVERT in the standby initialization parameter file so that standby datafile fi
lenames are translated from the primary datafile filenames. For example:
DB_FILE_NAME_CONVERT = '/oracle/dbs', '/dsk2/oracle'
COPY DATAFILE 1 TO '/dsk2/oracle/df_1.f', DATAFILE 2 TO '/dsk2/oracle/df_2.f', DATAFILE 3 T O '/dsk2/oracle/df_3.f', DATAFILE 4 to '/dsk2/oracle/df_4.f', DATAFILE 5 TO '/dsk2/orac le/df_5.f', DATAFILE 6 TO '/dsk2/oracle/df_6.f', DATAFILE 7 TO '/dsk2/oracle/df_7.f', < a name="637222"> DATAFILE 8 to '/dsk2/oracle/df_8.f', DATAFILE 9 TO '/dsk2/oracle/df_9.f', DATAFILE 10 TO '/dsk2/oracle/df_10.f', DATAFILE 11 TO '/dsk2/oracle/df_11.f', DATAFILE 12 to '/dsk2/oracle/df_12.f', CURRENT CONTROLFILE FOR STANDBY TO '/dsk2/oracle/cf.f';
SQL> STARTUP NOMOUNT PFILE=/dsk2/oracle/dbs/in itSTANDBY1.ora SQL> ALTER DATABASE MOUNT;
This procedure assumes that you use different filenames for the standby datafiles and the image copies of the primary datafiles.
To create the standby database without performing recovery, you do not need to run the DUPLICA
TE command. By default, RMAN leaves the standby database mounted and does not recover it.
To create a standby database when the copies and standby datafiles have different names without performing recovery:
% r man TARGET sys/sys_pwd@prod1 AUXILIARY sys/sys_pwd@sbdb1 CATALOG rman/cat@catdb
STARTUP MOUNT PFILE=initPROD1.orali>
DB_FILE_NAME_CONVERT in the standby initializatio
n parameter file so that standby datafile filenames are translated from the primary datafile filenames, or issue SET DB_FILE_NAME_CONVERT parameter as follows:
DB_FILE_NAME_CONVERT = '/oracle/dbs', '/dsk2/oracle'
COPY command to copy all of the datafiles and the standby control file. For example, issue
the following commands:
COPY DATAFILE 1 TO '/dsk2/oracle/df_1.f', DATAFILE 2 TO '/dsk2/oracle/df_2.f', DATAFILE 3 TO '/dsk2/oracle/df_3.f', DATAFILE 4 to '/dsk2/oracle/df_4.f', DATAFILE 5 TO '/dsk2/oracle/df_5.f', DATAFI LE 6 TO '/dsk2/oracle/df_6.f', DATAFILE 7 TO '/dsk2/oracle/df_7.f', DATAFILE 8 to '/dsk 2/oracle/df_8.f', DATAFILE 9 TO '/dsk2/oracle/df_9.f', DATAFILE 10 TO '/dsk2/oracle/df_ 10.f', DATAFILE 11 TO '/dsk2/oracle/df_11.f', DATAFILE 12 to '/dsk2/oracle/df_12.f', CURRENT CONTROLFILE FOR STANDBY TO '/dsk2/oracle/cf.f'; # To ensure the control file checkp oint is archived, archive the # current redo log file SQL 'ALTER SYSTEM ARCHIVE LOG CURREN T';
SQL> STARTUP MOUNT PFILE =/dsk2/oracle/dbs/initSTANDBY1.ora
To create the standby database and perform recovery, specify the DORECOVER option on the <
code>DUPLICATE command.
To create a standby database when the co pies and standby datafiles have different names and perform recovery:
% rman TARGET sys/sys_pwd@prod1 AUXILIARY sys/sys_pwd@sbdb1 CATALOG rman/ca t@catdb
START UP MOUNT PFILE=initPROD1.ora
SET NEWNAME commands. For example, set the DB_FILE_NAME_CONVE
RT parameter as follows:
DB_FILE_NAME_CONVERT = '/oracle/dbs', '/dsk2/oracle'
DUPLICATE command. Follow these steps:
SET command to specify the end time, SCN, or log sequence number for recovery.DUPLICATE command with the DORECOVER option.For example, enter the following:
COPY DATAFILE 1 TO '/dsk2 /oracle/df_1.f', DATAFILE 2 TO '/dsk2/oracle/df_2.f', DATAFILE 3 TO '/dsk2/oracle/df_3. f', DATAFILE 4 to '/dsk2/oracle/df_4.f', DATAFILE 5 TO '/dsk2/oracle/df_5.f', DATAFILE 6 TO '/dsk2/oracle/df_6.f', DATAFILE 7 TO '/dsk2/oracle/df_7.f', DATAFILE 8 to '/dsk2/oracle/df_8.f', DATAFILE 9 TO '/dsk2/oracle/df_9.f', DATAFILE 10 TO '/dsk2/oracle/df_10.f', DATAFILE 11 TO '/dsk2/oracle/df_11.f', DATAFILE 12 to '/dsk2 /oracle/df_12.f', CURRENT CONTROLFILE FOR STANDBY TO '/dsk2/oracle/cf.f'; SQL 'ALTER SY STEM ARCHIVE LOG CURRENT'; DUPLICATE TARGET DATABASE FOR STANDBY DORECOVER;
RMAN uses all incremental backups, archived redo log file backups, and arc hived redo log files to perform incomplete recovery. The standby database is left mounted.