没有合适的资源?快使用搜索试试~ 我知道了~
首页Oracle 12c 部署Data Guard,Switchover和Failover
资源详情
资源评论
资源推荐
目录
1. 序 ....................................................................................................................................................................... 4
2. 准备实验环境 ................................................................................................................................................... 4
2.1 查看 OS 与 DB 版本信息 .................................................................................................................... 4
2.2 Primary 和 Standby 的 hosts 里添加主备库信息 ............................................................................. 4
2.3 Primary 和 Standby 的环境变量 ........................................................................................................ 4
2.4 在 Primary 构造测试数据 ................................................................................................................... 5
3. 搭建 Active Data Guard .................................................................................................................................. 7
3.1 Primary 开启 FORCE LOGGING .................................................................................................... 7
3.2 添加 standby logfile ............................................................................................................................. 7
3.3 令 Primary 运行于归档模式 ............................................................................................................... 8
3.4 Primary 网络配置 ................................................................................................................................ 8
3.5 配置 Standby ...................................................................................................................................... 10
3.5.1 创建初始化参数和口令文件 ................................................................................................. 10
3.5.2 创建必要的目录 ..................................................................................................................... 10
3.5.3 配置 Standby 网络 ................................................................................................................. 10
3.5.4 启动监听 ................................................................................................................................. 11
3.5.5 Standby 实例启动到 NOMOUNT 状态 ............................................................................... 11
3.5.6 在 Primary 进行连接测试 ..................................................................................................... 12
3.6 编写脚本并执行 ................................................................................................................................. 12
3.6.1 编写 rman duplicate 命令脚本 ............................................................................................. 12
3.6.2 解锁 sysbackup 用户 .............................................................................................................. 12
3.6.3 口令文件重新复制到 Standby .............................................................................................. 14
3.6.4 执行脚本 ................................................................................................................................. 14
3.7 Primary 修改参数 .............................................................................................................................. 23
3.8 查看主备库状态信息 ......................................................................................................................... 23
4. 配置 Broker .................................................................................................................................................... 24
4.1 启用 Broker 功能并使用 ................................................................................................................... 24
4.1.1 启用 Broker 功能 ................................................................................................................... 24
4.1.2 Standby 库启动到 Read Only ............................................................................................... 24
4.1.3 主备库打开 PDB 库 ............................................................................................................... 24
4.1.4 使用 Broker 创建主备库 ....................................................................................................... 24
4.1.5 查看主备库详细信息 ............................................................................................................. 25
4.1.6 ADG 实时应用测试 ............................................................................................................... 28
4.2 Data Guard 保护模式 ........................................................................................................................ 29
4.3 SWITCHOVER ................................................................................................................................. 30
4.3.1 进行 switchover ...................................................................................................................... 30
4.3.2 Switchover 之后进行确认 ..................................................................................................... 30
4.3.3 测试 ......................................................................................................................................... 31
4.4 Failover ............................................................................................................................................... 32
4.4.1 配置并启动 FSFO(FastStartFailover) ................................................................................. 32
4.4.2 开启 flashback db 功能.......................................................................................................... 33
4.4.3 启用 FSFO .............................................................................................................................. 33
4.4.4 进行故障转移 ......................................................................................................................... 35
5. 逻辑备用数据库 ............................................................................................................................................. 37
5.1 搭建逻辑备用数据库 ......................................................................................................................... 37
5.1.1 确认不支持对象 ..................................................................................................................... 37
5.1.2 停止备用数据库的日志应用 ................................................................................................. 37
5.1.3 构建 LogMiner 字典 .............................................................................................................. 37
5.1.4 通知 MRP 应用重做日志 ...................................................................................................... 37
5.1.5 备用数据库重启,RESETLOGS 打开 ................................................................................ 38
5.1.6 启动 SQL Apply ..................................................................................................................... 38
5.1.7 数据测试 ................................................................................................................................. 38
5.2 重新配置 Broker ................................................................................................................................ 39
5.2.1 切换到最高性能模式并删除备库信息 ................................................................................. 39
5.2.2 重新以逻辑方式添加备库 ..................................................................................................... 39
5.2.3 激活配置 ................................................................................................................................. 40
5.3 测试 Switchover ................................................................................................................................. 40
1. 序
最近测试了下 Oracle Database 12c 的 Data Guard,测试的内容有部署 ADG、Broker 配置、三种模式间
切换、ADG Switchover 和 Failover、部署逻辑备用数据库以及 Switchover。
Oracle Database 12c 引入 Far Sync Instance 的特性,官方介绍如下:
Far Sync is used to extend zero data loss protection to a remote standby database and avoid the imp
act to primary database performance of WAN network latency. A primary database ships synchronously t
o a light-weight instance referred to as a far sync instance (a control file and log files, no data files an
d no media recovery). The far sync instance then forwards the redo asynchronously to a remote standby
database that is the failover target. Additional Far Sync features include the ability to directly service u
p to 29 remote destinations, and the ability to utilize Oracle Advanced Compression to compress redo fo
r efficient transmission across a WAN. Far Sync is transparent to the administrator with regards to Data
Guard role transitions. The same switchover or failover command used for any Data Guard configuratio
n will transition any remote standby databases served by a far sync instance to the primary production r
ole.
Zero data loss protection can be achieved across long distances. The far sync instance is located with
in a distance of the primary database where synchronous transport does not impact application performan
ce. Far Sync handles all communication with remote standby databases and is transparent when executing
a zero data loss failover. Far Sync also offloads the production database of the overhead of servicing
multiple remote destinations and redo transport compression.
大致就是在 Primary 和 Standby 之间弄一个中转站,把 Primary 的 redo 以 sync 方式接收,然后以 async
方式发送到 Standby 上。这个特性我本次没有做实验,待以后找时间再体验下。
ADG 的部署还好,采用 RMAN 的 Active Duplicate 方式,只是和 11g 有所不同的地方是,需要使用 sy
sbackup 权限来进行操作。
2. 准备实验环境
2.1 查看 OS 与 DB 版本信息
OS Version:
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.4 (Santiago)
Primary:
Oracle Database 12c on Linux 6(OEL 6.4),DB_NAME=luocs12c,DB_UNIQUE_NAME=luocs12c
Standby:
Oracle Database 12c on Linux 6(OEL 6.4),DB_NAME=luocs12c,DB_UNIQUE_NAME=standby12c
2.2 Primary 和 Standby 的 hosts 里添加主备库信息
# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.35 12c.luocs.com 12c
192.168.1.37 standby.luocs.com standby
2.3 Primary 和 Standby 的环境变量
Primary:
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=12c.luocs.com
export ORACLE_UNQNAME=luocs12c
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1
export ORACLE_SID=luocs12c
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
alias sqlplus="rlwrap sqlplus"
alias rman="rlwrap rman"
alias dgmgrl="rlwrap dgmgrl"
Standby:
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=standby.luocs.com
export ORACLE_UNQNAME=standby12c
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1
export ORACLE_SID=standby12c
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
alias sqlplus="rlwrap sqlplus"
alias rman="rlwrap rman"
alias dgmgrl="rlwrap dgmgrl"
2.4 在 Primary 构造测试数据
SQL> select con_id,dbid,NAME,OPEN_MODE from v$pdbs;
CON_ID DBID NAME OPEN_MODE
---------- ---------- ------------------------------ ----------
2 4061779419 PDB$SEED READ ONLY
3 1641907796 PDBLUOCS12C MOUNTED
SQL> alter pluggable database pdbluocs12c open;
Pluggable database altered.
SQL> alter session set container=pdbluocs12c;
Session altered.
SQL> select name from v$datafile;
NAME
剩余40页未读,继续阅读
ORA-600
- 粉丝: 2
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
- SPC统计方法基础知识.pptx
- MW全能培训汽轮机调节保安系统PPT教学课件.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0