oracle 恢复中的switch datafile all是什么意思。谢谢

sunnyxjl 2008-12-02 09:39:05
oracle 恢复中的switch datafile all是什么意思。谢谢
...全文
1591 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
jst143 2010-04-28
  • 打赏
  • 举报
回复
新人,学习中
skate 2009-06-10
  • 打赏
  • 举报
回复
不是很完整,谁能完整的介绍下
sunnyxjl 2008-12-03
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 zhpsam109 的回复:]
看看这本书:

http://download.oracle.com/docs/cd/B19306_01/backup.102/b14192/toc.htm
[/Quote]有没有中文版的啊? 看不懂英文啊? 谢谢
liuyi8903 2008-12-03
  • 打赏
  • 举报
回复
意思就是更新控制文件中记录的datafile的路径情况.
codearts 2008-12-03
  • 打赏
  • 举报
回复
控制文件里存有数据文件的路径,比如原来是c:\abc\1.dbf,现在恢复的时候想换到d:\abc\1.dbf, 那要怎么做呢?

run{
set newname for datafile 1 to 'd:\abc\1.dbf';
restore database;
--现在,rman已经在数据文件copy到d:\abc\1.dbf了,但控制文件里的路径还是c:\abc\1.dbf, 所以要更新控制文件洛
switch datafile all;
--好了,现在控制文件的路径也是d:\abc\1.dbf了
}
myplato 2008-12-03
  • 打赏
  • 举报
回复
恢复数据后,重建日志文件
zhpsam109 2008-12-02
  • 打赏
  • 举报
回复
看看这本书:

http://download.oracle.com/docs/cd/B19306_01/backup.102/b14192/toc.htm
zhpsam109 2008-12-02
  • 打赏
  • 举报
回复

After the RESTORE command but before the RECOVER command in your RUN
block, use a SWITCH command to update the control file with the new
filenames of the datafiles. The SWITCH command is equivalent to the
SQL statement ALTER DATABASE RENAME FILE. SWITCH DATAFILE ALL updates
the control file to reflect the new names for all datafiles for
which a SET NEWNAME has been issued in the RUN block.


RUN
{
SQL 'ALTER TABLESPACE users OFFLINE IMMEDIATE';
SQL 'ALTER TABLESPACE tools OFFLINE IMMEDIATE';
# specify the new location for each datafile
SET NEWNAME FOR DATAFILE '/olddisk/users01.dbf' TO
'/newdisk/users01.dbf';
SET NEWNAME FOR DATAFILE '/olddisk/tools01.dbf' TO
'/newdisk/tools01.dbf';
# to restore to an ASM disk group named dgroup, use:
# SET NEWNAME FOR DATAFILE '/olddisk/trgt/tools01.dbf'
# TO '+dgroup';
RESTORE TABLESPACE users, tools;
SWITCH DATAFILE ALL; # update control file with new filenames
RECOVER TABLESPACE users, tools;
}
sunnyxjl 2008-12-02
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 codearts 的回复:]
rman里面用的

run
{
set new datafile 1 to 'c:\new\1.dbf';
restore database;
--现在,需要把文件的新位置写到控制文件
sql 'alter database rename datafile 1 to ..';
--当然,如果有很多个,用:
switch datafile all;
}
[/Quote]有点不太明白,能否再解释详细点,谢谢!
codearts 2008-12-02
  • 打赏
  • 举报
回复
rman里面用的

run
{
set new datafile 1 to 'c:\new\1.dbf';
restore database;
--现在,需要把文件的新位置写到控制文件
sql 'alter database rename datafile 1 to ..';
--当然,如果有很多个,用:
switch datafile all;
}

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧