标签:imm example byte tables name mode ora variable global
查看数据库的启动状态
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: 解决方法
标签:imm example byte tables name mode ora variable global
原文地址:http://www.cnblogs.com/j839035067/p/6565621.html