非catalog模式下:
control文件丢失的恢复:
startup nomount;
restore controlfile from autobackup; 或者restore controlfile from 'control的rman备份文件'
alter database mount;
recover database;
alter database open resetlogs;
spfile文件丢失的恢复:
startup nomount;
set dbid 9815108;
restore spfile from autobackup;
shutdown immediate;
set dbid 9815108;
startup;
Redolog 文件丢失的恢复:
#sqlplus / nolog
shutdown immediate;
startup mount;
//recover database until cancel;
alter database open resetlogs;
datafile文件丢失的恢复:
sql "alter datbase datafile *3 offline"; //*3表示指定的丢失文件的序号(在rman中用report schema查看)
restore datafile *3;
recover datafile *3;
sql "alter database datafile 3 online";
表空间文件丢失的恢复:
sql "alter tablespace users[表空间名字] offline (immediate)";
restore tablespace users[表空间名字] ;
recover tablespace users[表空间名字];
sql "alter tablespace users[表空间名字] online";
非catalog方式完全恢复:
(数据库出现问题):
startup nomount;
restore controlfile from autobackup;
alter database mount;
restore database;
recover database;
alter database open resetlogs;
基于时间点的恢复:
run
{
set until time "to_date('07/01/02 15:00:00','mm/dd/yy hh24:mi:ss')"
restore database;
recover database;
alter database open resetlogs;
}
基于SCN的恢复:
startup mount;
restore database UNTIL SCN 10000;
recover database UNTIL SCN 10000;
alter database open resetlogs;
基于日志序列的恢复:
startup mount;
restore database UNTIL SEQUENCE 100 thread 1;
recover database UNTIL SWQUENCE 100 thread 1;
alter database open resetlogs;
catalog模式:
创建catalog所用的表空间
SQL>create tablesapace rman_ts datafile ' ' size 20M;
创建rman用户并授权
SQL>create user rman identified by rman default
tablespace rman_ts quota unlimited on rman_ts;
SQL>grant recovery_catalog_owner to rman;
创建恢复目录:
rman catalog rman/rman
RMAN>create catalog tablespace rman_ts;
RMAN>register database;
连接方式:// rman target / catalog rman/rman
之后的备份和非catalog模式下的备份是一样的!!!
control文件丢失的恢复:
startup nomount;
restore controlfile from autobackup; 或者restore controlfile from 'control的rman备份文件'
alter database mount;
recover database;
alter database open resetlogs;
spfile文件丢失的恢复:
startup nomount;
set dbid 9815108;
restore spfile from autobackup;
shutdown immediate;
set dbid 9815108;
startup;
Redolog 文件丢失的恢复:
#sqlplus / nolog
shutdown immediate;
startup mount;
//recover database until cancel;
alter database open resetlogs;
datafile文件丢失的恢复:
sql "alter datbase datafile *3 offline"; //*3表示指定的丢失文件的序号(在rman中用report schema查看)
restore datafile *3;
recover datafile *3;
sql "alter database datafile 3 online";
表空间文件丢失的恢复:
sql "alter tablespace users[表空间名字] offline (immediate)";
restore tablespace users[表空间名字] ;
recover tablespace users[表空间名字];
sql "alter tablespace users[表空间名字] online";
非catalog方式完全恢复:
(数据库出现问题):
startup nomount;
restore controlfile from autobackup;
alter database mount;
restore database;
recover database;
alter database open resetlogs;
基于时间点的恢复:
run
{
set until time "to_date('07/01/02 15:00:00','mm/dd/yy hh24:mi:ss')"
restore database;
recover database;
alter database open resetlogs;
}
基于SCN的恢复:
startup mount;
restore database UNTIL SCN 10000;
recover database UNTIL SCN 10000;
alter database open resetlogs;
基于日志序列的恢复:
startup mount;
restore database UNTIL SEQUENCE 100 thread 1;
recover database UNTIL SWQUENCE 100 thread 1;
alter database open resetlogs;
catalog模式:
创建catalog所用的表空间
SQL>create tablesapace rman_ts datafile ' ' size 20M;
创建rman用户并授权
SQL>create user rman identified by rman default
tablespace rman_ts quota unlimited on rman_ts;
SQL>grant recovery_catalog_owner to rman;
创建恢复目录:
rman catalog rman/rman
RMAN>create catalog tablespace rman_ts;
RMAN>register database;
连接方式:// rman target / catalog rman/rman
之后的备份和非catalog模式下的备份是一样的!!!
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26366371/viewspace-2062123/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26366371/viewspace-2062123/