我的问题原因是服务器重启,导致数据文件丢失。Oracle启动无法找到文件报错
1、进入dba
sqlplus / as sysdba
2、启动数据库,并找到有问题的数据文件
startup
ORA-01157: cannot identify/lock data file 9 - see DBWR trace file
ORA-01110: data file 9: \'/tmp/oradata/xx/rpx.dbf\'
3、启动数据库,无挂载
startup nomount
alter database mount;
alter database datafile ‘/tmp/oradata/xx/rpx.dbf’ offline drop; # 将有问题的文件下线
alter database open;
select file_id,tablespace_name from dba_data_files;
select file_name,file_id,TABLESPACE_NAME,STATUS,ONLINE_STATUS from dba_data_files;
drop tablespace rpx including contents; # 删除表空间
select file_name,file_id,TABLESPACE_NAME,STATUS,ONLINE_STATUS from dba_data_files;
4、重启数据库
shut immediate
startup