用我自己的土话讲就是,用restore先把备份文件拷贝到数据库目录下进行替换,再用recover经过一些处理,数据库就恢复正常了。
1、restore 命令:用于还原已经备份的数据文件。
(1)、restore database 还原所有的数据文件。
(2)、restore tablespace 还原特定表空间的数据文件。
(3)、restore datafile 还原特定的数据文件。
(4)、restore controlfile 还原控制文件。
(5)、restore archivelog 还原归档日志文件。
2、recover 命令:当数据库需要应用归档日志文件恢复数据文件时,使用recover命令。使用该命令数据库系统会自动应用归档的日志文件。
(1)、recover database 恢复所有的数据文件。
(2)、recover tablespace 恢复特定表空间的数据文件。
(3)、recover datafile 恢复特定的数据文件。
3、restore archivelog 的其它用法
restore archivelog all; 还原全部归档日志文件
restore archivelog from logseq 27 ; 还原log sequence为27之后的所有归档日志
restore archivelog from logseq 27 until logseq 29; 还原log sequence为27到29这几个归档日志
restore archivelog from time 'sysdate-7'; 还原七天以内的归档日志
restore archivelog until logseq 29; 还原到seqence 为29的日志文件为止
set archivelog destination to '/u01/database/sybo5/arch';设定还原日志文件到新路径,如
run{
set archivelog destination to '/u01/database/sybo5/arch';
restore archivelog low logseq 27;}