删除数据文件后恢复——小实验
2011-11-25 09:29
260 查看
SYS@orcl> create tablespace testspace datafile 'D:\testdatafile' size 10M
SYS@orcl> create table scott.testtable(id varchar2(16)) tablespace testspace;
SYS@orcl> insert into scott.testTable(id) values(1234567);
SYS@orcl> insert into scott.testTable(id) values(123456789);
SYS@orcl> commit;
SYS@orcl> select * from scott.testtable;
ID
----------------
1234567
123456789
SYS@orcl> alter tablespace testspace offline;
删除D:\testdatafile数据文件
SYS@orcl> recover tablespace testspace;
ORA-00283: recovery session canceled due to errors
ORA-01110: data file 7: 'D:\TESTDATAFILE'
ORA-01157: cannot identify/lock data file 7 - see DBWR trace file
ORA-01110: data file 7: 'D:\TESTDATAFILE'
SYS@orcl> alter database create datafile 7;
SYS@orcl> recover datafile 7;
SYS@orcl> select * from scott.testtable;
select * from scott.testtable
*
ERROR at line 1:
ORA-00376: file 7 cannot be read at this time
ORA-01110: data file 7: 'D:\TESTDATAFILE'
SYS@orcl> alter tablespace testspace online;
SYS@orcl> select * from scott.testtable;
ID
----------------
1234567
123456789
SYS@orcl>
SYS@orcl> create table scott.testtable(id varchar2(16)) tablespace testspace;
SYS@orcl> insert into scott.testTable(id) values(1234567);
SYS@orcl> insert into scott.testTable(id) values(123456789);
SYS@orcl> commit;
SYS@orcl> select * from scott.testtable;
ID
----------------
1234567
123456789
SYS@orcl> alter tablespace testspace offline;
删除D:\testdatafile数据文件
SYS@orcl> recover tablespace testspace;
ORA-00283: recovery session canceled due to errors
ORA-01110: data file 7: 'D:\TESTDATAFILE'
ORA-01157: cannot identify/lock data file 7 - see DBWR trace file
ORA-01110: data file 7: 'D:\TESTDATAFILE'
SYS@orcl> alter database create datafile 7;
SYS@orcl> recover datafile 7;
SYS@orcl> select * from scott.testtable;
select * from scott.testtable
*
ERROR at line 1:
ORA-00376: file 7 cannot be read at this time
ORA-01110: data file 7: 'D:\TESTDATAFILE'
SYS@orcl> alter tablespace testspace online;
SYS@orcl> select * from scott.testtable;
ID
----------------
1234567
123456789
SYS@orcl>
相关文章推荐
- 使用日志恢复误删除的数据文件
- 使用linux文件句柄恢复误删除的Oracle数据文件
- 文件系统管理 之 有关ext2文件系统下反删除(Undelete)操作恢复数据的文档
- 在没有备份情况下误删除数据文件的恢复
- 网上删除所有数据文件的恢复情况
- oracle实验记录 (恢复,备份-含坏块数据文件)
- 【转载】Oracle数据恢复 - Linux / Unix 误删除的文件恢复
- Oracle恢复实验一:使用添加数据文件之前的控制文件
- 如何用数据恢复软件找回删除的文件
- Oracle意外删除数据文件恢复方法
- 使用linux文件句柄恢复误删除的Oracle数据文件
- 恢复被rm意外删除数据文件
- log view for sql server (一款通过解析MSSql2008日志文件恢复表数据删除的工具软件)
- opensuse 12.3 使用extundelete恢复ext3,ext4文件系统下被rm删除的数据
- 误删除数据文件、控制文件的非RMAN恢复方法
- oracle数据文件被误操作删除了恢复方法
- 恢复删除了数据文件的表<MyISAM>
- reiserfs文件系统反删除(Undelete)数据恢复操作的实践
- Linux 下Oracle 数据文件被物理误删除的恢复
- 误删除数据文件的物理文件,如何恢复(归档开启)