检查dmon的情况
SQL> !ps -ef|grep dmon_test11g
oracle 8129 1 0 11:25 ? 00:00:00 ora_dmon_test11g
oracle 8138 8108 0 11:25 pts/0 00:00:00 /bin/bash -c ps -ef|grep dmon_test11g
oracle 8140 8138 0 11:25 pts/0 00:00:00 grep dmon_test11g
查看dg broker的日志,开始的时候没有配置文件,会重新创建。
DMON: cannot open configuration file "/DATA/app/oracle/product/11.2.0.4/dbs/dr2test11g.dat"
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
DMON: cannot open configuration file "/DATA/app/oracle/product/11.2.0.4/dbs/dr2test11g.dat"
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Configuration does not exist, Data Guard broker ready
数据库alert日志:
Mon Jul 27 11:25:15 2015
DMON started with pid=26, OS id=8129
Starting Data Guard Broker (DMON)
Mon Jul 27 11:25:23 2015
接着拷贝密码文件,参数文件(spfile)到备库
在备库生成pfile,然后修改下面的参数
修改db_unique_name为stest11g
修改local_listener为stest11g
配置 db_file_name_convert
log_file_name_convert
db_file_name_convert='/DATA/app/oracle/oradata/test11g','/DATA/app/oracle/oradata/test11g','/DATA/app/oracle/fast_recovery_area/test11g','/DATA/app/oracle/fast_recovery_area/test11g' log_file_name_convert='/DATA/app/oracle/oradata/test11g','/DATA/app/oracle/oradata/test11g','/DATA/app/oracle/fast_recovery_area/test11g','/DATA/app/oracle/fast_recovery_area/test11g'
检查db_recovery_file_dest 和其它的文件路径是否有效(adump,oradata)
fal_server
fal_client
生成spfile
这个时候被库的工作就基本完成了,剩下的就是使用rman来恢复,dg broker来配置了。
数据复制恢复
启动备库到nomount阶段
SQL> create spfile from pfile;
File created.
SQL> startup nomount
SQL> !ps -ef|grep dmon_test11g
oracle 17773 1 0 11:44 ? 00:00:00 ora_dmon_test11g
oracle 17779 17733 0 11:44 pts/0 00:00:00 /bin/bash -c ps -ef|grep dmon_test11g
oracle 17781 17779 0 11:44 pts/0 00:00:00 grep dmon_test11g
检查参数是否生效
备库通过rman复制数据文件
$ rman target sys/xxxx@test11g auxiliary sys/xxxxx@stest11g nocatalog
Recovery Manager: Release 11.2.0.4.0 - Production on Mon Jul 27 11:46:23 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: TEST11G (DBID=1038061657)
using target database control file instead of recovery catalog
connected to auxiliary database: TEST11G (not mounted)
RMAN> duplicate target database for standby from active database nofilenamecheck;
配置完成,数据复制工作就告一段落。
开始配置dg broker
主库执行:
$ dgmgrl /
DGMGRL for Linux: Version 11.2.0.4.0 - 64bit Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected.
DGMGRL> create configuration dg_test11g as
> primary database is test11g
> connect identifier is test11g;
Configuration "dg_test11g" created with primary database "test11g"
DGMGRL> add database stest11g as
> connect identifier is stest11g
> maintained as physical;
Database "stest11g" added
这个时候配置还没有生效
DGMGRL> show configuration;
Configuration - dg_test11g
Protection Mode: MaxPerformance
Databases:
test11g - Primary database
stest11g - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
DISABLED
启用配置
DGMGRL> enable configuration;
然后再次查看,如果配置没有问题,就会生效。
DGMGRL> show configuration;
Configuration - dg_test11g
Protection Mode: MaxPerformance
Databases:
test11g - Primary database
stest11g - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
接着进行再次验证
DGMGRL> enable database test11g;
Enabled.
DGMGRL> enable database stest11g;
Enabled.
DGMGRL>
DGMGRL> show configuration;
Configuration - dg_test11g
Protection Mode: MaxPerformance
Databases:
test11g - Primary database
stest11g - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS