Oracle資料表空間恢複

來源:互聯網
上載者:User

Oracle資料表空間恢複

如果誤刪除了一個資料表空間中test的資料檔案test.dbf,然後下次重新啟動資料庫的時候發      資料庫不能開啟了(open),
老是報錯: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'

解決方案:
1、 在路徑/u01/app/oracle/oradata/orcl/建立一個test.dbf檔案;
2、  以sqlplus  / as sysdba登入資料庫startup force;不過此時還會報錯,沒關係;
3、  執行:
SQL> alter database datafile'/u01/app/oracle/oradata/orcl/test.dbf' offline drop;
Database altered.
 
4、接著執行:
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、經過上述的步驟,就將資料庫open了。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.