ITPub博客

首页 > 数据库 > Oracle > oracle没有备份,丢失数据文件的恢复

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

原创 Oracle 作者:yuantong 时间:2005-11-14 15:02:29 0 删除 编辑
--创建表空间
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/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-12-07

  • 博文量
    61
  • 访问量
    792771