2個月以前使用swingbench的時候,cc這個user創建了17GB的測試數據(ccdata.dbf),後面測試完成後,
因為是測試機,空間不足,直接手動rm –rf /Data/oradata/ora11g/ccdata.dbf這個文件
之後因其他測試時重啟DB時碰到了ORA-01157錯誤,
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
ORA-01110: data file 6: '/Data/oradata/ora11g/ccdata.dbf'
root case:手動ccdata.dbf文件,既然問題已經知道,那就下手處理吧:
ora11g</Data/oradata/ora11g>$sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Fri Mar 27 08:28:41 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> startup force;
SQL> startup force;
ORACLE instance started.
Total System Global Area 7816675328 bytes
Fixed Size 2243712 bytes
Variable Size 4529849216 bytes
Database Buffers 3271557120 bytes
Redo Buffers 13025280 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
ORA-01110: data file 6: '/Data/oradata/ora11g/ccdata.dbf'
SQL> col file# for a10;
SQL> col name for a50;
SQL> select file#,name from v$datafile;
FILE# NAME
---------- --------------------------------------------------
1 /Data/oradata/ora11g/system01.dbf
2 /Data/oradata/ora11g/sysaux01.dbf
3 /Data/oradata/ora11g/undotbs01.dbf
4 /Data/oradata/ora11g/users01.dbf
5 /Data/oradata/ora11g/example01.dbf
6 /Data/oradata/ora11g/ccdata.dbf
7 /Data/oradata/datafile/dp01.dbf
SQL> alter database datafile 6 offline;
Database altered.
SQL> alter database open;
Database altered.
SQL> DROP TABLESPACE CCDATA INCLUDING CONTENTS AND DATAFILES;
Tablespace dropped.
SQL> col file_name for a35;
SQL> col tablespace_namefor a15;
SQL> select tablespace_name,file_name from dba_data_files
TABLESPACE FILE_NAME
---------- -----------------------------------
USERS /Data/oradata/ora11g/users01.dbf
UNDOTBS1 /Data/oradata/ora11g/undotbs01.dbf
SYSAUX /Data/oradata/ora11g/sysaux01.dbf
SYSTEM /Data/oradata/ora11g/system01.dbf
EXAMPLE /Data/oradata/ora11g/example01.dbf
DP_TABLE /Data/oradata/datafile/dp01.dbf
6 rows selected.
至此問題已經解決
測試庫,暫時用startup force啟動一次吧:
SQL> startup force;
ORACLE instance started.
Total System Global Area 7816675328 bytes
Fixed Size 2243712 bytes
Variable Size 4529849216 bytes
Database Buffers 3271557120 bytes
Redo Buffers 13025280 bytes
Database mounted.
Database opened.
警示:正式庫DB萬萬不要手動rm 數據文件