|
|
 |
|
 |
没有备份、只有归档日志,如何恢复数据文件? |
★★★ |
|
|
|
| 没有备份、只有归档日志,如何恢复数据文件? |
|
|
| 作者:佚名 文章来源:本站整理 更新时间:2008-9-24 9:44:54 |
|
|
|
|
没有备份、只有归档日志,如何恢复数据文件?
来源:不详 作者 佚名 点击数: 录入时间:07-12-19 21:29:56
没有备份、只有归档日志,如何恢复数据文件? 系统环境: 1、操作系统:Windows 2000 Server,机器内存128M 2、数据库: Oracle 8i R2 (8.1.6) for NT 企业版 3、安装路径:C:\ORACLE 模拟现象: 可通过重建数据文件来恢复,前提是归档日志文件保存完整先将数据库设置为归档模式SQL*Plusconn system/manager--创建实验表空间create tablespace test datafile'c:\test.ora' size 5MAUTOEXTEND ON NEXT 1M MAXSIZE UNLIMITEDdefault storage (initial 128K next 1M pctincrease 0)/--创建实验用户 drop user test cascade;create user test identified by test default tablespace test;grant connect,resource to test;conn test/testcreate table a(a number);insert into a values(1);insert into a select * from a;--反复插入,达到100万条commit;--关闭数据库SVRMGR> connect internalSVRMGR> alter system switch logfile;--强制归档SVRMGR> alter system switch logfile;SVRMGR> alter system switch logfile;SVRMGR> shutdown--操作系统下删除test.ora文件--重新启动数据库SVRMGR> connect internalSVRMGR> startup这时,可以mount上,但无法打开,因为数据文件test.ora不存在,显示错误如下:ORA-01157: ????/?????? 8 - ??? DBWR ????ORA-01110: ???? 8: 'C:\TEST.ORA'SVRMGR> connect internalSVRMGR> startup mountSVRMGR> alter database create datafile 'c:\test.ora';SVRMGR> set autorecovery onSVRMGR> recover datafile 'c:\test.ora';SVRMGR> alter database open;conn test/testselect count(*) from a;--数据又恢复到100万条--删除实验表空间conn system/manageralter tablespace test offline;drop tablespace test INCLUDING CONTENTS;drop user test;--如果是非[1] [2] 下一页
|
|
|
|
| 文章录入:admin 责任编辑:admin |
|
|
上一篇文章: 联机热备份失败后,如何打开数据库? 下一篇文章: 电信企业参与竞争的利器-数据仓库和数据挖掘 |
|
|
|
|
|
|
|
|
|
|
|
|