oracle没有备份,丢失数据文件的恢复

--创建表空间
SQL> create tablespace myspace datafile 'D:ORACLE_BASEdatafilesmyspace.dbf'size 10M;

Tablespace created.
--建立测试数据,位于myspace表空间
SQL> CREATE TABLE MYTEST(ROW_ID INT) tablespace myspace;

Table created.

SQL> INSERT INTO MYTEST VALUES(1);

1 row created.

SQL> INSERT INTO MYTEST VALUES(2);

1 row created.

SQL> COMMIT;

Commit complete.

SQL> SHUTDOWN ABORT;
ORACLE instance shut down.
SQL> EXIT
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production

--删除D:ORACLE_BASEdatafilesmyspace.dbf数据文件
C:Documents and Settingsluochun.BSCY>sqlplus /nolog

SQL*Plus: Release 9.2.0.1.0 - Production on Mon Nov 14 10:55:08 2005

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

SQL> connect / as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.

Total System Global Area 529604068 bytes
Fixed Size 454116 bytes
Variable Size 318767104 bytes
Database Buffers 209715200 bytes
Redo Buffers 667648 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 3 - see DBWR trace file
ORA-01110: data file 3: 'D:ORACLE_BASEDATAFILESMYSPACE.DBF'

--重新创建文件,号码是3
SQL> alter database create datafile 3;

Database altered.

--恢复
SQL> reover datafile 3;
SP2-0734: unknown command beginning "reover dat..." - rest of line ignored.
SQL> recover datafile 3;
Media recovery complete.
SQL> alter database open;

Database altered.

SQL> select * from mytest;

ROW_ID
----------
1
2

SQL>

我的数据库还是非归档的,但建立数据文件,后续操作的日志都还停留在联机日志中,没有切换,
所以是可以恢复的,至于归档模式,只要上诉的日志是连续的,恢复也没什么问题
[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12482/viewspace-810063/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/12482/viewspace-810063/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值