从rman全备恢复数据库的步骤

来源:互联网 发布:微众银行程序员工资 编辑:程序博客网 时间:2024/05/16 00:57

1.1 恢复spfile
根据rman备份的log确认dbid以及spfile在哪个备份中

set dbid=2494162093RMAN> startup nomountRMAN> restore spfile from /home/oracle/rman11204/RAC_20160311_11_1_dbfull;

生成pfile,修改sga,pga,audit_trail,instance_number,db_create_file_dest, db_create_online_log_dest_1等参数,生成新的spfile。
1.2 恢复controlfile

RMAN> restore controlfile from /home/oracle/rman11204/RAC_20160311_11_1_dbfull;

1.3 恢复数据文件

RMAN> alter database mount;rman target / nocatalog log /home/oracle/rman_restore.log append << EOFrun{allocate channel c1 type disk;allocate channel c2 type disk;allocate channel c3 type disk;allocate channel c4 type disk;allocate channel c5 type disk;allocate channel c6 type disk;allocate channel c7 type disk;allocate channel c8 type disk;set newname for database  to '+DATA';restore database;switch datafile all;release channel c1;release channel c2;release channel c3;release channel c4;release channel c5;release channel c6;release channel c7;release channel c8;}EOF

1.4 Recover数据库并open

RMAN> catalog start with '/home/oracle/rman11204';RMAN> recover database;SQL> alter database open resetlogs;

添加新temp文件,删除旧temp文件:

alter tablespace temp add tempfile '' size 30G;
alter database tempfile '' drop;

1 0
原创粉丝点击