码迷,mamicode.com
首页 > 数据库 > 详细

数据库恢复

时间:2019-03-17 00:53:41      阅读:216      评论:0      收藏:0      [点我收藏+]

标签:rod   pen   数据库   auto   数据库恢复   using   tar   name   back   

--若选用PROD1为catalog目录库
sqlplus sys/oracle@prod1 as sysdba
create user catalog identified by oracle;
grant connect,recovery_catalog_owner to catalog;
alter user catalog unlimited tablespace onusers;
rman catalog catalog/oracle@prod1
create catalog;

--a、先恢复spfile
vi initPROD2.ora
db_name=PROD2

sqlplus sys/oracle@prod2 as sysdba
startup nomount;

rman target sys/oracle@prod2 catalog catalog/oracle@prod1

RMAN> list backup of spfile;
RMAN>restore spfile from ‘/u01/app/oracle/FRA/PROD2/backupset/2016_11_19/o1_mf_nnsnf_TAG20161119T220145_d30ptbhz_.bkp‘;
RMAN> list backup of controlfile;
RMAN>restore controlfile from ‘/u01/app/oracle/FRA/PROD2/backupset/2016_11_19/o1_mf_ncnnf_TAG20161119T220114_d30psdfq_.bkp‘;

--可以在rman中执行 by zhuyj
alter database mount;

--恢复数据库,须先恢复controlfile后到mount状态
---或者用(list failure须controlfile存在,然后执行alter database open或alter database open然后执行list failure;)
--list failure;
--advise failure;
--然后执行生成的恢复脚本
restore database;
SQL>recover database using backup controlfile until cancel;
--先输入auto,执行完毕以后。
--再次执行:recover database using backup controlfile until cancel;
--当问你要联机日志文件的日志序列号的时候,输入 cancel

alter database open resetlogs;

数据库恢复

标签:rod   pen   数据库   auto   数据库恢复   using   tar   name   back   

原文地址:https://www.cnblogs.com/buffercache/p/10544974.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!