数据文件丢失---ora-01110

数据库处于归档模式,新建的表空间数据文件被删除了,没有该数据文件的备份,如何进行恢复?
SQL> startup
ORACLE instance started.
 
Total System Global Area  580395008 bytes
Fixed Size            2255392 bytes
Variable Size          427820512 bytes
Database Buffers      146800640 bytes
Redo Buffers            3518464 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
ORA-01110: data file 6: '/u01/app/oracle/oradata/ANDREA/test.dbf'
数据恢复的步骤包括:restore 和recover两个主要过程。
restore 需要通过已有的备份对丢失的文件进行重建,recover通过应用online redo log  archived  redo log   undo data使丢失的数据文件恢复到一定的状态。
先查看数据库目前的状态:
SQL> select status from v$instance;
STATUS
------------
MOUNTED

 
SQL> select  * from v$recover_file;
 
     FILE# ONLINE  ONLINE_ ERROR                                CHANGE# TIME
---------- ------- ------- ----------------------------------------------------------------- ---------- ---------
     6 ONLINE  ONLINE  FILE NOT FOUND                                  0
数据库处于mount状态,数据文件6已丢失且没有备份文件,先使用下面的命令来"restore"丢失的文件
SQL> alter database create datafile '/u01/app/oracle/oradata/ANDREA/test.dbf';
然后就可进行recover了。
sql> recover datafile 6;

SQL> alter database open;
 
Database altered.
-------------------------------------------------

Use the CREATE DATAFILE clause to create a new empty data file in place of an old one. You can use this clause to re-create a data file that was lost with no backup. The filename or filenumber must identify a file that is or was once part of the database. If you identify the file by number, then filenumber is an integer representing the number found in the FILE# column of the V$DATAFILE dynamic performance view or in the FILE_ID column of the DBA_DATA_FILES data dictionary view.

  • Specify AS NEW to create an Oracle-managed data file with a system-generated filename, the same size as the file being replaced, in the default file system location for data files.

  • Specify AS file_specification to assign a file name (and optional size) to the new data file. Use the datafile_tempfile_spec form of file_specification (see file_specification) to list regular data files and temp files in an operating system file system or to list Oracle Automatic Storage Management (Oracle ASM) disk group files.

If the original file (filename or filenumber) is an existing Oracle-managed data file, then Oracle Database attempts to delete the original file after creating the new file. If the original file is an existing user-managed data file, then Oracle Database does not attempt to delete the original file.

If you omit the AS clause entirely, then Oracle Database creates the new file with the same name and size as the file specified by filename or filenumber.

During recovery, all archived redo logs written to since the original data file was created must be applied to the new, empty version of the lost data file.

Oracle Database creates the new file in the same state as the old file when it was created. You must perform media recovery on the new file to return it to the state of the old file at the time it was lost.

Restrictions on Creating New Data Files The creation of new data files is subject to the following restrictions:

  • You cannot create a new file based on the first data file of the SYSTEM tablespace.

  • You cannot specify the autoextend_clause of datafile_tempfile_spec in this CREATE DATAFILE clause.











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

转载于:http://blog.itpub.net/21754115/viewspace-1063617/

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值