学习Mechanics of Datafile Restore Operations的注意点
来源:互联网 发布:c语言源代码 编辑:程序博客网 时间:2024/05/18 16:14
学习Mechanics of Datafile Restore Operations的注意点
When you issue a RESTORE command, RMAN directs a server session to restore a suitable backup to either:
The default location, overwriting the files with the same name currently there
A new location, which you can specify with the SET NEWNAME command
To restore a datafile, either mount the database, or keep it open and take the datafile to be restored offline. When RMAN performs a restore, it creates the restored files as datafile image copies and records them in the repository.
The following table describes the behavior of the RESTORE, SET NEWNAME, and SWITCH commands.
Run SET NEWNAME? | RESTORE Behavior | Run SWITCH? |
No | RMAN restores the files to their current path names. | N/A |
Yes | RMAN restores the files to the path names specified by SET NEWNAME and creates repository records for each datafile copy after the restore. | If yes, then RMAN replaces the current datafile names in the control file to the names of the restored files and current datafile names (if exists) are stored as datafile copies. If no, then RMAN doesn't update current datafile names and the restored file is retained as datafile copies. |
For example, if you restore datafile ?/oradata/trgt/tools01.dbf to its default location, then RMAN restores the file ?/oradata/trgt/tools01.dbf and overwrites any file that it finds with the same filename. If you run a SET NEWNAME command before you restore a file, then RMAN creates a datafile copy with the name that you specify. For example, assume that you run the following commands:
RUN {
SET NEWNAME FOR DATAFILE '/opt/oracle/oradata/ge02/users01.dbf' TO '/test/users01.dbf';
RESTORE DATAFILE '/opt/oracle/oradata/ge02/users01.dbf';
}
In this case, RMAN creates a datafile copy of ?/oradata/trgt/tools01.dbf named /tmp/tools01.dbf and records it in the repository. To update the control file to use the datafile copy at ?/oradata/trgt/tools01.dbf to /tmp/tools01.dbf as the datafile, use the SWITCH command as shown in the following example:
SWITCH DATAFILE 5 TO COPY;
或者
SWITCH DATAFILE '/opt/oracle/oradata/ge02/users01.dbf' TO COPY;
The SWITCH command is the RMAN equivalent of the SQL statement ALTER DATABASE RENAME FILE.
注意红色的部分,只有这样写才正确,如果象下面的写法,则会报错:
RMAN> SWITCH DATAFILE '/opt/oracle/oradata/ge02/users01.dbf' TO COPY '/test/users01.dbf' ;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "single-quoted-string": expecting one of: ";"
RMAN-01007: at line 1 column 66 file: standard input
RMAN> SWITCH DATAFILE 5 TO COPY '/test/users01.dbf' ;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "single-quoted-string": expecting one of: ";"
RMAN-01007: at line 1 column 29 file: standard input
如果是上面红色的写法,则步会报错:
RMAN> SWITCH DATAFILE 5 TO COPY;
datafile 5 switched to datafile copy "/test/users01.dbf"
starting full resync of recovery catalog
full resync complete
RMAN> SWITCH DATAFILE '/opt/oracle/oradata/ge02/users01.dbf' TO COPY;
datafile 5 switched to datafile copy "/test/users01.dbf"
starting full resync of recovery catalog
full resync complete
- 学习Mechanics of Datafile Restore Operations的注意点
- RMAN-06023 : no backup or copy of datafile found to restore 说明
- RMAN-06023 : no backup or copy of datafile found to restore 说明
- RMAN-06023: no backup or copy of datafile 6 found to restore
- RMAN-06023: no backup or copy of datafile 1 found to restore
- RMAN-06100: no channel to restore a backup or copy of datafile 681
- RMAN-06023 no backup or copy of datafile 1 found to restore
- RESTORE DATAFILE TO A NEW LOCATION
- 学习编程需要注意的几点
- 学习编程需要注意的几点
- 异常的学习以及一些注意点
- java学习笔记--封装的注意点
- Servlet学习应该注意的几点
- Mechanics of USB cable and connector
- vive 手柄的Grab Mechanics
- c++学习注意点
- ant学习-注意点
- Java学习注意点
- CSS样式
- H.264名词
- 《画皮》的原版故事
- Fox Toolkit应用程序内存出错浅析
- 怕寂寞
- 学习Mechanics of Datafile Restore Operations的注意点
- Hibernate基础知识
- AVS264_FAQ集锦
- 使用Jmagick压缩高质量图片
- 朋友们好!
- 求助一BCB的问题?
- VS竞技游戏平台辅助外挂制作实例
- 单链表的翻转
- Struts验证框架