问题描述: 因为业务增长需求,需要在原来dataguard环境(一主两备)的基础上,新增一备库。 但通过grid control创建备库时失败,
问题描述:
因为业务增长需求,需要在原来dataguard环境(一主两备)的基础上,,新增一备库。
但通过grid control创建备库时失败,由于主库数据文件有100G左右,备份恢复到从库要半小时间左右(千兆网,50M/s)。
现象:
创建备库的作业失败
在主节点查看rman恢复日志,可用下面命令查看rman运行作业的日志
ps –ef|grep rman
会在/tmp目录下生成rman临时日志,可以看到数据库备份成功
在从节点查看日志:
[Oracle@hotel07 trace]$ tail -100f alert_htdb7.log
Thu Jul 25 15:21:01 2013
Using STANDBY_ARCHIVE_DEST parameter default value as USE_DB_RECOVERY_FILE_DEST
Thu Jul 25 15:21:01 2013
alter database flashback on
Errors in file /u01/app/ora11g/diag/rdbms/htdb7/htdb7/trace/htdb7_ora_13427.trc:
ORA-38706: 无法启用 FLASHBACK DATABASE 事件记录。
ORA-38788: 需要更多的备用数据库恢复
ORA-38706 signalled during: alter database flashback on...
Thu Jul 25 15:21:03 2013
恢复数据时到此为此。
查看从库状态:
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
MOUNTED
--尝试open数据库
SQL> alter database open;
alter database open
*
第 1 行出现错误:
ORA-10458: standby database requires recovery
ORA-01152: 文件 1 没有从过旧的备份中还原
ORA-01110: 数据文件 1: '+DATA/htdb7/datafile/system.272.821719041'
--再查看日志
[oracle@hotel07 trace]$ tail -100f alert_htdb7.log
alter database open
Data Guard Broker initializing...
Data Guard Broker initialization complete
Signalling error 1152 for datafile 1!
Beginning standby crash recovery.
Serial Media Recovery started
Managed Standby Recovery starting Real Time Apply
Media Recovery Waiting for thread 1 sequence 27106
FAL[client]: Error fetching gap sequence, no FAL server specified
Thu Jul 25 15:35:33 2013
FAL[client]: Failed to request gap sequence
GAP - SCN range: 0x000c.7af3d503 - 0x000c.7af3d503
DBID 1083719948 branch 759079182
FAL[client]: All defined FAL servers have been attempted.
-------------------------------------------------------------
Check that the CONTROL_FILE_RECORD_KEEP_TIME initialization
parameter is defined to a value that is sufficiently large
enough to maintain adequate log switch information to resolve
archivelog gaps.
-------------------------------------------------------------
Thu Jul 25 15:35:54 2013
Errors in file /u01/app/ora11g/diag/rdbms/htdb7/htdb7/trace/htdb7_m000_14915.trc:
ORA-01155: 正在打开, 关闭, 装载或卸装数据库
Thu Jul 25 15:36:23 2013
Standby crash recovery need archive log for thread 1 sequence 27106 to continue.
Please verify that primary database is transporting redo logs to the standby database.
Wait timeout: thread 1 sequence 27106
Standby crash recovery aborted due to error 16016.
Errors in file /u01/app/ora11g/diag/rdbms/htdb7/htdb7/trace/htdb7_ora_13883.trc:
ORA-16016: 线程 1 sequence# 27106 的归档日志不可用
Recovery interrupted!
Completed standby crash recovery.
看上去是应该缺少归档日志,不能继续进行数据库恢复。
再查看从库的关键参数,发现并没有被修改。
解决办法:
所以尝试手工修改备库的参数,再进行open数据库。
1.修改数据库参数:
htdb4主:
alter system set log_archive_config='dg_config=(htdb4,htdb5,htdb6,htdb7)';
alter system set fal_server='(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hotel06)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=htdb6)(SERVER=DEDICATED)))','(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hotel05)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=htdb5)(SERVER=DEDICATED)))','(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hotel07)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=htdb7)(SERVER=DEDICATED)))';
alter system set log_archive_dest_4='service="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hotel07)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=htdb7)(SERVER=DEDICATED)))"','LGWR SYNC AFFIRM delay=0 optional compression=disable max_failure=0 max_connections=1 reopen=300 db_unique_name="htdb7" net_timeout=30','valid_for=(all_logfiles,primary_role)';
alter system set log_archive_dest_state_4='ENABLE';
htdb7备:
alter system set log_archive_config='dg_config=(htdb4,htdb5,htdb6,htdb7)';
alter system set fal_server='(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hotel06)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=htdb6)(SERVER=DEDICATED)))','(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hotel05)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=htdb5)(SERVER=DEDICATED)))','(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hotel04)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=htdb4)(SERVER=DEDICATED)))';
alter system set log_archive_dest_2='service="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hotel04)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=htdb4)(SERVER=DEDICATED)))"','LGWR SYNC AFFIRM delay=0 optional compression=disable max_failure=0 max_connections=1 reopen=300 db_unique_name="htdb4" net_timeout=30','valid_for=(all_logfiles,primary_role)';
其它备库:
htdb6:
alter system set log_archive_config='dg_config=(htdb4,htdb5,htdb6,htdb7)';