ORACLE异机增量备份恢复

PROD异机增量备份恢复验证实施文档

准备工作:
source 源库:
PROD数据库备份策略:周日0级RMAN备份,周一至周六1级差异增量备份
0 4 * * 0 /data/rmanlev0.sh > /data/logs/rmanlev0.log 2>&1
0 4 * * 1,2,3,4,5,6 /data/rmanlev1.sh > /data/logs/rmanlev1.log 2>&1

target 异地机器:
备份目录:/backup/PROD/
备份文件如下
[oracle@prod ~]$ ll /backup/PROD/
total 20
drwxr-xr-x 2 oracle oinstall 4096 Oct 18 17:38 rman0_20181014
drwxr-xr-x 2 oracle oinstall 4096 Oct 18 17:24 rman1_20181015
drwxr-xr-x 2 oracle oinstall 4096 Oct 18 17:25 rman1_20181016
drwxr-xr-x 2 oracle oinstall 4096 Oct 18 17:27 rman1_20181017
drwxr-xr-x 2 oracle oinstall 4096 Oct 18 17:27 rman1_20181018
drwxr-xr-x 2 oracle oinstall 4096 Oct 18 17:28 rman1_20181019
drwxr-xr-x 2 oracle oinstall 4096 Oct 18 17:28 rman1_20181020
安装与源库同版本的数据库软件,编辑环境变量$ORACLE_BASE $ORACLE_HOME等

实施流程:


******利用10月14日0级备份、10月15日1级备份,恢复数据库到10月15日备份时刻4点的数据库状态******

1:在10月14日0级备份恢复初始化参数文件spfile
SQL> startup nomount force
RMAN>restore spfile from ‘/backup/PROD/rman0_20181014/c-75913496-20181014-00.ctl‘

SQL> shutdown immediate
SQL> startup nomount
SQL> create pfile from spfile
SQL> shutdown immediate

编辑pfile文件,补充源库的文件目录,调整SGA、PGA等内存设置等,用编辑好的pfile文件起库

SQL>startup nomount from ‘/data/app/oracle/product/12.1.0/db_1/dbs/initPROD.ora‘

SQL>create spfile from pfile;
用spfile 起库
SQL>startup nomount force

2:恢复控制文件
RMAN>restore controlfile from ‘/backup/PROD/rman0_20181014/c-75913496-20181014-00.ctl‘
3:转储恢复数据库
RMAN>restore database;

RMAN>recover database;

检查是否缺少归档日志
RMAN>list archivelog all;
RMAN>list backup of archivelog all;

4:从catalog恢复10月15日1级备份
RMAN>catalog start with ‘/backup/PROD/rman1_20181015/‘;

5:恢复1级备份
RMAN>recover database;

检查是否缺少归档日志
RMAN>list archivelog all;
RMAN>list backup of archivelog all;


6:开库
RMAN>alter database open resetlogs;


验证:
SQL> select checkpoint_change# from v$database;

CHECKPOINT_CHANGE#
------------------
11693764350
SQL> select checkpoint_change# from v$datafile;
CHECKPOINT_CHANGE#
------------------
11693764350
11693764350
11693764350
11693764350
11693764350
11693764350
11693764350
11693764350
11693764350
11693764350
11693764350
SQL> select checkpoint_change# from v$datafile_header;
CHECKPOINT_CHANGE#
------------------
11693764350
11693764350
11693764350
11693764350
11693764350
当前日志组的SCN
SQL>select GROUP#,sequence#,STATUS,FIRST_CHANGE#,to_char(FIRST_TIME,‘yyyy/mm/dd:hh24:mi:ss‘) firsttime,NEXT_CHANGE#,to_char(NEXT_TIME,‘yyyy/mm/dd:hh24:mi:ss‘) nexttime from v$log;

 

https://www.cnblogs.com/elontian/p/9854672.html

ORACLE异机增量备份恢复

上一篇:NodeJS连接MongoDB数据库


下一篇:深入了解promise,手写实现promise