oracle資料檔案被刪除後,恢復

2021-08-30 18:34:16 字數 927 閱讀 6274

先將資料庫設定為歸檔模式

sql*plus

sqlplus system/system@orcl as sysdba

--建立實驗表空間

sql>create tablespace test datafile

'c:\test.ora' size 5m

/--建立實驗使用者

sql>create user test identified by test default tablespace test;

sql>grant connect,resource to test;

sql>conn test/test

sql>create table a(a number);

isql>nsert into a values(1);

commit;

--關閉資料庫

sql> shutdown immediate;

--作業系統下刪除test.ora檔案

--重新啟動資料庫

sql> startup

這時,可以mount上,但無法開啟,因為資料檔案test.ora不存在,

顯示錯誤如下:

ora-01157: ????/?????? 8 - ??? dbwr ????

ora-01110: ???? 8: 'c:\test.ora'

sql> startup mount

sql> alter database create datafile 'c:\test.ora';

ssql> set autorecovery on

sql> recover datafile 'c:\test.ora';

sql> alter database open;

sql>conn test/test

sql>select count(*) from a;

Oracle表資料被刪除後的恢復

在oracle資料庫使用過程中,會存在表中資料被誤刪除的情況,如果被刪除的資料有備份,則可從備份中獲取,若表資料被刪除至發現被刪除期間沒有進行備份,則可使用oracle閃回技術進行資料恢復 適用於短時間內被刪除的資料 可恢復資料的時間根據資料庫的配置有所不同 select from 表名 as of...

oracle刪除資料檔案

在我們詳細介紹之前,我們必須說清楚一點 oracle不提供如刪除表 檢視一樣刪除資料檔案的方法,資料檔案是表空間的一部分,所以不能 移走 表空間。一 使用offline資料檔案的方法 非歸檔模式使用 alter database datafile offline drop 歸檔模式使用 alter ...

oracle刪除資料檔案

在我們詳細介紹之前,我們必須說清楚一點 oracle不提供如刪除表 檢視一樣刪除資料檔案的方法,資料檔案是表空間的一部分,所以不能 移走 表空間。一 使用offline資料檔案的方法 非歸檔模式使用 alter database datafile offline drop 歸檔模式使用 alter ...