oracle 如何删除被误删物理文件的表空间
如何删除alter database ... offline drop掉文件的表空间?
QL> connect / as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 336662768 bytes
Fixed Size 450800 bytes
Variable Size 117440512 bytes
Database Buffers 218103808 bytes
Redo Buffers 667648 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 3 - see DBWR trace file
ORA-01110: data file 3: '/home/oracle/oradata/esal/ts_cybercafe01.dbf'
SQL> alter tablespace cybercafe offline;
alter tablespace cybercafe offline
*
ERROR at line 1:
ORA-01109: database not open
SQL> alter database datafile '/home/oracle/oradata/esal/ts_cybercafe01.dbf' offline drop;
Database altered.
SQL> alter database open;
Database altered.
//如果还提示文件不存在的话,那就继续执行datafile的drop命令,直到数据库可以open为止;
SQL> select * from v$tablespace;
TS# NAME INC
---------- ------------------------------ ---
0 SYSTEM YES
1 UNDOTBS1 YES
2 TEMP YES
3 INDX YES