ORA-01110: data file

CASE1:

测试场insert 操作时报错。

ORA-01110: data file 4: '/home/XXX/data/XXX_01.dbf'

。先查看了下DB状态,是OPEN。DF,看空间大小,也没满。从dba_data_files中找出这个DBF对应的TABLESPACE,去dba_tablespaces中看了下它的状态。为READ ONLY!

有点慌。。快速查看了所有的表空间哪些是READ ONLY的。有140个!

跑个脚本改过来。


set head off pages 0 lines 200 feedback off
SPOOL alter_tablespaces.sql
select 'ALTER TABLESPACE ' || tablespace_name || ' READ WRITE;'
from dba_tablespaces
where status='READ ONLY';
SPOOL off
@alter_tablespaces



------------------------------

SQL> shutdown immediate;
ORA-01116: error in opening database file 8
ORA-01110: data file 8: '/home/oracle/ad_test/t1.dbf'
ORA-27041: unable to open file


SQL> SELECT name, error  FROM v$datafile  JOIN v$recover_file  USING (file#);


NAME
--------------------------------------------------------------------------------
ERROR
-----------------------------------------------------------------
/home/oracle/ad_test/t1.dbf
FILE NOT FOUND


alter database datafile 8 offline drop;


SQL> alter database datafile 8 offline drop;


Database altered.

SQL> startup force
ORACLE instance started.


Total System Global Area 2672361472 bytes
Fixed Size                  2256232 bytes
Variable Size            1392509592 bytes
Database Buffers         1258291200 bytes
Redo Buffers               19304448 bytes
Database mounted.
Database opened.


CASE2:

删除了一个DBFILE。

然后出错, 使用RMAN


Total System Global Area 2672361472 bytes
Fixed Size                  2256232 bytes
Variable Size            1392509592 bytes
Database Buffers         1258291200 bytes
Redo Buffers               19304448 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 7 - see DBWR trace file
ORA-01110: data file 7: '/home/oracle/adam/audit_tbs01.dbf'




SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
-bash-3.2$ rman target /


Recovery Manager: Release 11.2.0.4.0 - Production on Tue Apr 8 20:55:40 2014


Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.


connected to target database: AD_TEST (DBID=846030938, not open)


RMAN> list failure;


using target database control file instead of recovery catalog
List of Database Failures
=========================


Failure ID Priority Status    Time Detected        Summary
---------- -------- --------- -------------------- -------
26422      HIGH     OPEN      Mar-14-2014:14:59:24 One or more non-system datafiles are missing
26502      HIGH     OPEN      Mar-20-2014:20:39:09 One or more non-system datafiles are offline

Mandatory Manual Actions
========================
1. If file /home/oracle/ad_test/t1.dbf was unintentionally renamed or moved, restore it
2. If you have an export of tablespace GVVMC_DATA, open the database read/write, then drop and re-create the tablespace and import the data.
3. If file /home/oracle/adam/audit_tbs01.dbf was unintentionally renamed or moved, restore it
4. If you have an export of tablespace AUDIT_TBS, offline its data files, open the database read/write, then drop and re-create the tablespace and import the data.
5. A database state change is required to repair the following failures.
6. Open the database to validate and get repair advice for failure 26505: Datafile 8: '/home/oracle/ad_test/t1.dbf' is offline
7. Contact Oracle Support Services if the preceding recommendations cannot be used, or if they do not fix the failures selected for repair


Optional Manual Actions
=======================
no manual actions available


Automated Repair Options
========================
no automatic repair options available

不用使用REPAIR FAILURE...
SQL> alter database datafile 7 offline drop;


Database altered.


你可能感兴趣的:(ORA-ERR)