一个表空间下有两个数据库文件,删除时,表空间已经不存在了(不知道是drop了还是rm了),就rm掉了数据文件,现在数据库启动之后无法打开。
创建表空间create tablespace adm_index datafile '/opt/oracle/oradata/adm_index.dbf' size 10M的时候提示:ORA-01109: database not open,
下线数据库文件alter database datafiles '/opt/oracle/oradata/adm_index.dbf' offline drop的时候提示:missing or invalid option to ALTER DATABASE
打开数据库alter database open;提示:ORA-03114: not connected to ORACLE跪求高手解答
创建表空间create tablespace adm_index datafile '/opt/oracle/oradata/adm_index.dbf' size 10M的时候提示:ORA-01109: database not open,
下线数据库文件alter database datafiles '/opt/oracle/oradata/adm_index.dbf' offline drop的时候提示:missing or invalid option to ALTER DATABASE
打开数据库alter database open;提示:ORA-03114: not connected to ORACLE跪求高手解答
startup;-- 先要连接到空闲会话,才能打开数据库!
1.删除表空间和内容,不删除数据文件
drop tablespace test including contents;
2.删除表空间内容和数据文件
drop tablespace test including contents and datafiles;
3.如果删除出错,或者先误删了数据文件而没有删掉表空间
首先要停止监听:cd $ORACLE_HOME/bin/lsnrctl stop
1.停掉数据库:shutdown immediate;/强制停止:shutdown abort;
2.此时启动会报错,可执行命令将丢失的数据文件从控制文件中删除:
--如果数据库运行在noarchivelog模式下,损坏的数据文件不能修复
alter database datafile '/opt/oracle/11.0/db/test.dbf' offline drop;
--如果数据库运行在archivelog模式下,损坏的数据文件可恢复
alter database datafile '/opt/oracle/11.0/db/test.dbf' offline;
3.然后命令查看控制文件中是否还有已丢失的数据文件:alter database open;(在启动数据库之前)
已连接到空闲例程。
idle> startup
ORACLE 例程已经启动。Total System Global Area 612368384 bytes
Fixed Size 1250428 bytes
Variable Size 213912452 bytes
Database Buffers 390070272 bytes
Redo Buffers 7135232 bytes
数据库装载完毕。
数据库已经打开。-- 删除表间,还不是一句话的事情?