如果表的許多分區被意外drop
◆首先需要用logminer查出刪除語句
uncompress /oracle/oradata/xxx/xxx
begin
sys
end;
begin sys
create table xsb_logminer_
select timestamp
from V$LOGMNR_CONTENTS
where seg_owner=
BEGIN sys
◆然後在生產庫上創建pfile
create pfile=
需要從帶庫上恢復rman備份集至生產機上
在測試機上創建與生產機上相同目錄
在測試機上創建新實例
然後修改pfile文件內容
◆啟動新實例
export ORACLE_SID=xxx
sqlplus / as sysdba
startup nomount pfile=
create spfile from pfile=
exit
RMAN target sys/xxx
restore controlfile from
startup mount
list backup;
run
{
set newname for datafile
set newname for datafile
set newname for datafile
set newname for datafile
restore datafile
restore datafile
restore datafile
restore datafile
}
(注
sql
shutdown immediate;
exit
然後修改controlfile文件內容
◆不完全恢復數據庫:
sqlplus / as sysdba
startup nomount;
◆重建控制文件
CREATE CONTROLFILE REUSE DATABASE
MAXLOGFILES
MAXLOGMEMBERS
MAXDATAFILES
MAXINSTANCES
MAXLOGHISTORY
LOGFILE
GROUP
) SIZE
GROUP
) SIZE
DATAFILE
CHARACTER SET ZHS
;
recover database until cancel using backup controlfile;
alter database open resetlogs;
◆做數據恢復操作: create table xxx as select xxx from xxx where xxx;
exp
也可以如下所示
recover database using backup controlfile until cancel;
alter database open resetlogs;
END!!!
From:http://tw.wingwit.com/Article/program/Oracle/201311/17984.html