首页 > 数据库技术 > 详细

ORA-01157: cannot identify/lock data file 6 - see DBWR trace file ORA-01110: 解决方法

时间:2017-03-17 15:05:33      阅读:334      评论:0      收藏:0      [点我收藏+]

查看数据库的启动状态

SQL> select open_mode from v$database;

OPEN_MODE
----------------------------------------
MOUNTED

 

出现ORA-01157错误之后数据库只能启动到mount阶段,因为丢失了数据文件解决方法如下:

先将错误文件脱机

SQL>alter database datafile 6 offline drop;

Database altered.

此时我们可以将数据库正常启动

SQL>alter database open;

Database altered.

 

SQL>select ts#,file#,name from v$datafile;


TS# FILE# NAME
---------- ---------- --------------------------------------------------
0 1 /u01/app/oracle/oradata/ORCL/system01.dbf
1 2 /u01/app/oracle/oradata/ORCL/undotbs01.dbf
2 3 /u01/app/oracle/oradata/ORCL/sysaux01.dbf
4 4 /u01/app/oracle/oradata/ORCL/users01.dbf
6 5 /u01/app/oracle/oradata/ORCL/example01.dbf
8 6 /u01/app/oracle/oradata/ORCL/tyger01.dbf

红色标注的时出现问题的文件,找到tablespace的名字对应删除然后重启数据库即可

SQL>select tablespace_name,status from dba_tablespaces;

TABLESPACE_NAME           STATUS
------------------------------ ---------
SYSTEM                              ONLINE
UNDOTBS1                         ONLINE
SYSAUX                              ONLINE
TEMP                                  ONLINE
USERS                                ONLINE
EXAMPLE                            ONLINE
TYGER                                ONLINE

 

SQL>drop tablespace tyger including contents and datafiles;

Tablespace dropped.

到此删除完成。重启数据库

SQL>shutdown immediate

Database closed.
Database dismounted.
ORACLE instance shut down.

SQL>startup

ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218992 bytes
Variable Size 130025040 bytes
Database Buffers 150994944 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.

问题是不是解决了呢。

 

ORA-01157: cannot identify/lock data file 6 - see DBWR trace file ORA-01110: 解决方法

原文:http://www.cnblogs.com/j839035067/p/6565621.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!