oracle下实现恢复一个丢失的数据文件的代码
程序员文章站
2023-12-03 12:38:46
如果您目前拥有一个冷备份,但是缺少了其中的一个数据文件,但你目前存在所有的归档,如果您要恢复数据文件,可以参考以下的示例: 复制代码 代码如下:[or...
如果您目前拥有一个冷备份,但是缺少了其中的一个数据文件,但你目前存在所有的归档,如果您要恢复数据文件,可以参考以下的示例:
[oracle@jumper eygle]$ sqlplus "/ as sysdba"
sql*plus: release 9.2.0.4.0 - production on sun aug 20 01:22:50 2006
copyright (c) 1982, 2002, oracle corporation. all rights reserved.
connected to an idle instance.
sql> startup mount
oracle instance started.
total system global area 252777592 bytes
fixed size 451704 bytes
variable size 134217728 bytes
database buffers 117440512 bytes
redo buffers 667648 bytes
database mounted.
sql> alter database open;
alter database open
*
error at line 1:
ora-01157: cannot identify/lock data file 3 - see dbwr trace file
ora-01110: data file 3: '/opt/oracle/oradata/eygle/eygle02.dbf'
sql> alter database create datafile 3 as '/opt/oracle/oradata/eygle/eygle02.dbf';
database altered.
sql> select name from v$datafile;
name
-------------------------------------------------------
/opt/oracle/oradata/eygle/system01.dbf
/opt/oracle/oradata/eygle/undotbs01.dbf
/opt/oracle/oradata/eygle/eygle02.dbf
/opt/oracle/oradata/eygle/eygle01.dbf
sql> alter database open;
alter database open
*
error at line 1:
ora-01113: file 3 needs media recovery
ora-01110: data file 3: '/opt/oracle/oradata/eygle/eygle02.dbf'
sql> recover datafile 3;
media recovery complete.
sql> alter database open;
database altered.
sql>
复制代码 代码如下:
[oracle@jumper eygle]$ sqlplus "/ as sysdba"
sql*plus: release 9.2.0.4.0 - production on sun aug 20 01:22:50 2006
copyright (c) 1982, 2002, oracle corporation. all rights reserved.
connected to an idle instance.
sql> startup mount
oracle instance started.
total system global area 252777592 bytes
fixed size 451704 bytes
variable size 134217728 bytes
database buffers 117440512 bytes
redo buffers 667648 bytes
database mounted.
sql> alter database open;
alter database open
*
error at line 1:
ora-01157: cannot identify/lock data file 3 - see dbwr trace file
ora-01110: data file 3: '/opt/oracle/oradata/eygle/eygle02.dbf'
sql> alter database create datafile 3 as '/opt/oracle/oradata/eygle/eygle02.dbf';
database altered.
sql> select name from v$datafile;
name
-------------------------------------------------------
/opt/oracle/oradata/eygle/system01.dbf
/opt/oracle/oradata/eygle/undotbs01.dbf
/opt/oracle/oradata/eygle/eygle02.dbf
/opt/oracle/oradata/eygle/eygle01.dbf
sql> alter database open;
alter database open
*
error at line 1:
ora-01113: file 3 needs media recovery
ora-01110: data file 3: '/opt/oracle/oradata/eygle/eygle02.dbf'
sql> recover datafile 3;
media recovery complete.
sql> alter database open;
database altered.
sql>
上一篇: Oracle下时间转换在几种语言中的实现
下一篇: oracle命令行删除与创建用户的代码
推荐阅读
-
oracle下实现恢复一个丢失的数据文件的代码
-
oracle下实现恢复一个丢失的数据文件的代码
-
Oracle在丢失控制文件的情况下,如何恢复数据库重建控制文件?
-
oracle数据库在onlne redo丢失的情况下,恢复时两个重要的参数
-
oracle下实现恢复一个丢失的数据文件的代码
-
误删除/丢失/损坏的SYSTEM表空间且无备份情况下的Oracle数据恢复
-
Oracle在丢失控制文件的情况下,如何恢复数据库重建控制文件?
-
Oracle数据库正常关闭状态下丢失undo文件的恢复
-
Oracle归档模式下恢复一个被offline drop的datafile的方法
-
Oracle表空间数据文件丢失的恢复