Oracle tablespace recovery
If the test. dbf data file of test in a tablespace is deleted by mistake, and the database cannot be opened the next time you restart the database ),
Always reports an error: SQL> alter database open;
Alter database open *
ERROR at line 1:
ORA-01157: cannot identify/lock data file 6-see DBWRtrace file
ORA-01110: data file 6: '/u01/app/Oracle/oradata/orcl/test. dbf'
Solution:
1. Create a test. dbf file in the path/u01/app/oracle/oradata/orcl;
2. Use sqlplus/as sysdba to log on to the database startup force. However, an error is reported at this time;
3. Execute:
SQL> alter database datafile '/u01/app/oracle/oradata/orcl/test. dbf' offline drop;
Database altered.
4. Run the following command:
SQL> startupforce
ORACLE instance started.
Total System Global Area 1570009088 bytes
Fixed Size 2253584 bytes
Variable Size 973081840 bytes
Database Buffers 587202560 bytes
Redo Buffers 7471104 bytes
Database mounted.
Database opened.
5. After the above steps, the database will be open.