在我的生产服务器中,我错误地删除了数据文件。当我尝试打开数据库时出现错误。这些文件并不重要,但数据库没有打开。
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
SQL> alter database open RESETLOGS;
alter database open RESETLOGS
*
ERROR at line 1:
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/u01/mars/oradata/MARS/system01.dbf'
Run Code Online (Sandbox Code Playgroud)
我尝试了很多方法来恢复,但它没有打开。喜欢
SQL> recover database until cancel;
ORA-00283: recovery session canceled due to errors
ORA-01610: recovery using the BACKUP CONTROLFILE option must be done
RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL ;
ORA-00283: recovery session canceled due to errors
ORA-01110: data file 5: '/u01/mars/oradata/MARS/example01.dbf'
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: '/u01/mars/oradata/MARS/example01.dbf'
Run Code Online (Sandbox Code Playgroud)
由于您不关心数据,您可以尝试以下操作,这将脱机并删除有问题的数据文件,从而允许您打开数据库。
SQL> startup
ORACLE instance started.
Total System Global Area 1720328192 bytes
Fixed Size 2255904 bytes
Variable Size 1275069408 bytes
Database Buffers 436207616 bytes
Redo Buffers 6795264 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
ORA-01110: data file 6: 'C:\ORACLE\ORADATA\ORCL\TRASHED01.DBF'
SQL> alter database datafile 6 offline drop;
Database altered.
SQL> alter database open;
Database altered.
SQL>
Run Code Online (Sandbox Code Playgroud)