转载于:ORA-01157: cannot identify/lock data file 6 - see DBWR trace file ORA-01110: 解决方法 (gxlcms.com)
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file ORA-01110: 解决方法
时间:2021-07-01 10:21:17 帮助过:217人阅读
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: 解决方法