这 10 点主要是面向 10g R2 以后的 DG 部署
① 主库设置为force logging模式
idle> select force_logging from v$database;
idle> alter database force logging;
② 主库设置为归档模式
idle> archive log list;
idle> shutdown immediate;
idle> startup mount;
idle> alter database archivelog;
idle> archive log list;
③ 配置Standby Redo Log
配置 standby redo log
④ 创建密匙文件(如果不存在的话)
先看文档的解释:
You must have SYSDBA system privileges for the user accounts that you use to manage the primary and standby database instances
Furthermore, the SYS user must have the same password on all databases in the configuration.
如果密码不一致会怎样?
案例如下:
Error 1031 received logging on to the standby
Errors in file /u01/app/oracle/diag/rdbms/pri/orcl/trace/orcl_arcf_5769.trc:
ORA-01031: insufficient privileges
PING[ARCf]: Heartbeat failed to connect to standby 'std'. Error is 1031.
显然、抛出 ORA-01031: insufficient privileges
使用 DBCA 建库会在 $ORACLE_HOME/dbs 下自动创建密匙文件
如若没有、可使用 orapwd 命令行工具、其 file 和 password 为必填参数、
例如(假设当前目录是 $ORACLE_HOME/dbs ):
orapwd file=orapworcl password=oracle entries=30 (Linux/Unix 平台命名规则:orapw[sid])
⑤ 设置初始化参数
DG 初始化参数列表
⑥ 数据库的版本要一致
官方文档提到:
You must install the same release of Oracle Database Enterprise Edition for the primary database and all standby databases in your Data Guard configuration
⑦ 独立的控制文件
摘自官网:
The primary database and each standby database must have their own control files.
可通过下列语句为备库创建控制文件:
alter database create standby controlfile as '/home/oracle/dg01.ctl';
控制文件通常需要多份、要么手工将上述文件 cp 几份、要么用命令多创建几个出来
需要注意的是、如果选择多次执行上述命令创建出多份、务必确保执行创建时数据库处于 MOUNT 状态
否则、几个控制文件的 SCN 号可能并不匹配、导致 备库 无法正常启动到 MOUNT 状态
另外、创建完控制文件之后到备库创建完成这段时间内(比如max(sequence#一样大))、要保证主库不再有结构上的变化(如:增加表空间等)
⑧ 统一的存储或文件管理
摘自官网:
If any databases use ASM and/or OMF, all should use the same combination
⑨ 启动物理备库以及 Redo 应用
完成对 物理备库的配置之后、就可以启动该备库、不过、某些情况下可以以 read only 模式打开
但、多数情况、应该启动到 mount 状态
如果直接执行 startup缺省会以 read only 模式打开
Oracle 会根据 控制文件判断是否为物理备库、如果是、默认启动到 read only 模式
所以、通常、我们只需:
startup mount;
进入 mount 之后、物理备库就开始接收主库发送的 redo 、然后、你可以继续通过一些命令应用这些 redo :
比如,启动 redo 应用:
alter database recover managed standby database disconnect from session;
或者附加 using current logfile 子句启动实时应用:
alter database recover managed standby database using current logfile disconnect from session;
实时、需要 LGWR sync 或者 async模式
⑩ 停止 物理备库
正常情况下、停止 物理备库之前、应该首先停止 主库
如果直接停止备库、轻则主库的alert 告警、重则、主库直接 shutdown
分享到:
相关推荐
大牛出手,全是干货,Oracle 11gR2使用Active Data Guard 搭建物理 Data Guard。 注:文档打开密码见压缩包注释 看不到注释的 文档打开密码 tianlesoftware
ORACLE之Data Guard部署培训讲学.pdf
同一台主机部署Oracle 11g物理Active Data Guard详细过程
Oracle 物理Standby 和 逻辑Standby 部署
oracle data guard文档
医院信息系统中Oracle Data Guard部署与实践.pdf
Oracle Data Guard 11g完全参考手册 oracle press
大牛出手Oracle 11.2.0.3 RAC 与 RAC 之间搭建Data Guard 案例 -- Aative Data Guard 案例
详细描述Oracle10g Data Guard的安装配置步骤
Oracle Data Guard 概念和管理10g 版本2
Data Guard中主数据库与物理备⽤数据库(Redo Apply)之间可以有什么差别?
Oracle 11gR2 使用copy 数据文件搭建物理 Data Guard
oracle 11g data guard
data guard for oracle database
Oracle 12c Data Guard的部署参考文档。
Oracle RAC系列之_10gR2 RAC(ASM) Data Guard容灾配置手册_mfkqwyc86.pdf
详细介绍有关 Data Guard DG的一些资料,堪比三思
Linux虚拟机下 配置ORACLE Data Guard (phycial-backup) ufida
Data guard因为技术简单成熟,成本低廉(Oracle自带的功能,不需要单独购买),是广泛采用的一种数据库的高性能与容灾方案。 Oracle Data Guard 确保企业数据的高可用性、数据保护以及灾难恢复。