oracle数据库通过回滚点方式做重大版本部署回退方案

来源:互联网 发布:北京海隆软件 编辑:程序博客网 时间:2024/06/06 06:32

打回滚点:

3生产环境检查FRA参数设置是否正确
show parameter db_recovery_file_dest(手册中写出具体值)
db_recovery_file_dest                string        
db_recovery_file_dest_size         big integer   95G4生产环境停止生产监听lsnrctl stop $ORACLE_HOME5生产环境复核生产监听已经停止ps -ef|grep tns|grep <ORACLE_SID>6生产环境重启数据库屏蔽JOB:
show parameter job_queue_processes             --记录下原值为:10  
修改:
 alter system set job_queue_processes=0 ;
复核:
show parameter job_queue_processes              --应为0

alter system switch logfile;
--跑group数次
alter system archive log current;
alter system checkpoint;
shutdown immediate;
startup7生产环境获取当前日志的SEQUENCEselect to_char(checkpoint_change#) from v$database;--记录SYSTEM CHANGE NUMBER
将结果记录在操作手册上

alter system switch logfile;
--跑3次,
获取当前日志的SEQUENCE
select max(sequence#), to_char(max(first_time),'yyyy-mm-dd hh24:mi:ss') from v$log_history where thread#=1
and RESETLOGS_TIME = (select max(a.RESETLOGS_TIME) from v$log_history a);


RAC库还要执行这个查询语句
select max(sequence#), to_char(max(first_time),'yyyy-mm-dd hh24:mi:ss') from v$log_history where thread#=2
and RESETLOGS_TIME = (select max(a.RESETLOGS_TIME) from v$log_history a);8远程DG检查RDG的FRA参数设置
show parameter db_recovery_file_dest(手册中写出具体值)
db_recovery_file_dest                string          
db_recovery_file_dest_size         big integer   90000M

--检查目录是否存在, 空间是否足够9远程DG追到当前日志并创建回滚点
不起MRP0
select to_char(checkpoint_change#) from v$database;
--该步骤检查出的SCN 必须大于第6步的SYSTEM CHANGE NUMBER,否则手工恢复
select max(sequence#) from v$log_history;后续完善
alter database recover managed standby database cancel;
create restore point point_rdg guarantee flashback database;    11远程DG复核回滚点已经设置select name from v$restore_point;
--输出为point_rdg12生产环境生产库重启并创建回滚点shutdown immediate;
startup mount;
create restore point point_prd guarantee flashback database;13生产环境生产库重启并创建回滚点shutdown immediate;
startup mount;
create restore point point_prd guarantee flashback database;
alter database open;
lsnrctl start $ORACLE_HOME14生产环境复核生产回滚点已经设置select name from v$restore_point;
--输出为point_prd15复核客户端连通性检查环境恢复:

NO执行环境步骤具体操作1生产环境(针对有创建回滚点的库)删除RESTORE POINTdrop restore point point_prd;
select count(*) from v$restore_point;3远程DG(远程DG有创建回滚点的库)删除RESTORE POINT,起RECOVERYdrop restore point point_rdg;
select count(*) from v$restore_point;
--输出为0
recover managed standby database parallel 6 disconnect;4生产环境恢复JOB修改:
 alter system set job_queue_processes=10 ;
复核:
show parameter job_queue_processes              --应为10
回滚

NO执行环境操作内容具体操作说明1生产环境停库sqlplus '/ as sysdba'
alter system switch logfile;
alter system archive log current;
shutdown immediate;2生产环境FLASHBACKstartup mount;
FLASHBACK DATABASE TO RESTORE POINT POINT_PRD;3生产环境起库alter database open resetlogs;
cp crontab_bak_2014 .cron_file
crontab .cron_file6远程DGFLASHBACK 库并恢复CRONsqlplus '/ as sysdba'
flashback database to restore point point_ldg
shutdown immediate;
startup mount;
recover managed standby database parallel 6 disconnect;\
恢复cron
cp crontab_bak_2014 .cron_file
crontab .cron_file7生产环境数据库全备立即发起一个数据库全备

原创粉丝点击