打回滚点:
3 | 生产环境 | 检查FRA参数设置是否正确 | show parameter db_recovery_file_dest(手册中写出具体值) db_recovery_file_dest string db_recovery_file_dest_size big integer 95G |
4 | 生产环境 | 停止生产监听 | lsnrctl stop $ORACLE_HOME |
5 | 生产环境 | 复核生产监听已经停止 | 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; startup |
7 | 生产环境 | 获取当前日志的SEQUENCE | select 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_rdg |
12 | 生产环境 | 生产库重启并创建回滚点 | 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_HOME |
14 | 生产环境 | 复核生产回滚点已经设置 | select name from v$restore_point; --输出为point_prd |
15 | 复核客户端连通性检查 |
NO | 执行环境 | 步骤 | 具体操作 |
1 | 生产环境(针对有创建回滚点的库) | 删除RESTORE POINT | drop restore point point_prd; select count(*) from v$restore_point; |
3 | 远程DG(远程DG有创建回滚点的库) | 删除RESTORE POINT,起RECOVERY | drop 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 | 生产环境 | FLASHBACK | startup mount; FLASHBACK DATABASE TO RESTORE POINT POINT_PRD; |
3 | 生产环境 | 起库 | alter database open resetlogs; cp crontab_bak_2014 .cron_file crontab .cron_file |
6 | 远程DG | FLASHBACK 库并恢复CRON | sqlplus '/ 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_file |
7 | 生产环境 | 数据库全备 | 立即发起一个数据库全备 |