Oracle® Database Recovery Manager Reference 10g Release 1 (10.1) Part Number B10770-01 |
|
|
View PDF |
switch::=
switchFile::=
Text description of switchFile
To specify that a datafile copy is now the current datafile, that is, the datafile pointed to by the control file. A SWITCH
is equivalent to using the PL/SQL ALTER
DATABASE
RENAME
FILE
statement: the names of the files in the RMAN repository are updated, but the database does not actually rename the files at the operating system level. Note that this command deletes the records for the datafile copy from the recovery catalog and updates the control file records to status DELETED
.
SWITCH
in the switch
syntax diagram outside of a RUN block. Execute the forms of SWITCH
in the switchFile
syntax diagram within a RUN
block.SWITCH
adds the datafile to the control file if it is not there already. You can only add datafiles through SWITCH
that were created after the backup control file was created.Syntax Element | Description |
---|---|
|
Renames the datafiles and control files to use the filenames of image copies of these files. RMAN switches to the latest image copy of each file. After a database switch, RMAN considers the previous database files as datafile copies. |
|
Specifies the datafile that you wish to rename. As with After the switch, the control file no longer considers the specified file as current. |
|
Switches all datafiles within the tablespace, as with |
Syntax Element | Description |
---|---|
|
Specifies the datafile that you wish to rename. After the switch, the control file no longer considers the specified file as current. For example, this command points the control file from SWITCH DATAFILE '?/dbs/tbs_1.f' TO DATAFILECOPY '?/dbs/copies/cp1.f'; If you do not specify a The filename or tag provided in the SWITCH DATAFILE 2 TO DATAFILECOPY '?/dbs/df2.copy'; Note that if you specify a tag and more than one copy uses this tag name, then RMAN uses the most current copy, that is, the one needing the least recovery. The following command switches datafile SWITCH DATAFILE 3 TO DATAFILECOPY TAG mondayPMcopy; |
|
Specifies that all datafiles for which a |
This example allocates one disk device and one tape device to allow RMAN to restore from disk and tape.
RUN { ALLOCATE CHANNEL dev1 DEVICE TYPE DISK; ALLOCATE CHANNEL dev2 DEVICE TYPE sbt; SQL "ALTER TABLESPACE tbs_1 OFFLINE IMMEDIATE"; SET NEWNAME FOR DATAFILE '/disk7/oracle/tbs11.f' TO '/disk9/oracle/tbs11.f'; RESTORE TABLESPACE tbs_1; SWITCH DATAFILE ALL; RECOVER TABLESPACE tbs_1; SQL "ALTER TABLESPACE tbs_1 ONLINE"; }