Home >Database >Mysql Tutorial >误删除Oracle datafile 无法打开数据库

误删除Oracle datafile 无法打开数据库

WBOY
WBOYOriginal
2016-06-07 17:25:351103browse

在oracle open方式下,直接从OS上删除了datafile文件。

1、在Oracle open方式下,直接从OS上删除了datafile文件。

rm /u02/rmants.dbf

2、数据库关闭后,无法打开数据库,,只能到mount状态。

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01157: cannot identify/lock data file 7 - see DBWR trace file
ORA-01110: data file 7: '/u02/rmants.dbf'
3、在mount状态下,删除被误的数据文件。

alter database datafile '/u02/rmants.dbf' offline drop;

4、打开数据库

alter database open;

5、验证状态

select open_mode from v$database


OPEN_MODE
--------------------
READ WRITE

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn