Rman 恢复

1.       口令文件丢失

Orapwd file=orapwsid password=pass entries=5

2.       spfile文件丢失

startup nomount;

set dbid 9815108;

restore spfile from autobackup;  or from ‘具体路径加文件名

shutdown immediate;

set dbid 9815108

startup;

3.       controlfile丢失

startup nomount;

restore controlfile from autobackup;  or from ‘具体路径加文件名

alter database mount;

recover database;

alter database open resetlogs;

4.       redolog 丢失

startup mount;

recover database  until cancel;  此句在sqlplus 中执行

alter database open resetlogs;

5.       数据文件丢失

Sql  “alter database datafile 5 offline”;

Restore datafile 5;

Recover datafile 5;

Sql  “alter database datafile 5 online”;

6.       表空间丢失

Sql “alter tablespace users offline immediate”;

Restore tablespace users;

Recover tablespace users;

Sql  “alter tablespace users online”;

 

7 非catalog方式完全恢复

startup nomount;
restore controlfile from autobackup;
alter database mount;
restore database;
recover database;
alter database open resetlogs;

vi initesheng.ora
add _allow_resetlogs_corruption=true /*许可没有online redo可以恢复*/

 

8,基于时间点不完全恢复:

a.    RUN{
SET UNTIL TIME  "to_date('2012-02-21:21:08:18','YYYY-MM-DD:hh24:mi:ss')";
RESTORE DATABASE;
RECOVER DATABASE;
ALTER DATABASE OPEN RESETLOGS;
}

 

b.  $export NLS_DATE_FORMAT='YYYY-MM-DD:HH24:MI:SS'
RUN{
SET UNTIL TIME='2012-02-21:19:44:00';
RESTORE DATABASE;
RECOVER DATABASE;
ALTER DATABASE OPEN RESETLOGS;
}

 

9.基于SCN不完全恢复
startup mount;
restore database UNTIL SCN 10000;
recover database UNTIL SCN 10000;
alter database open resetlogs;

10. 基于日志序列的恢复:
startup mount;
restore database UNTIL SEQUENCE 100 thread 1;
recover database UNTIL SEQUENCE 100 thread 1;
alter database open resetlogs;