配置DATAGUARD 时关于 LOG_FILE_NAME_CONVERT配置错误的解决


RAC: 双节点,存储使用ASM.

DATAGUARD : 单实例,使用本地目录文件。

构建RAC-单实例 的DATAGUARD时,遇到以下问题:

在使用RMAN 复制文件到 STANDBY 库时,出错,
STANDBY 无法MOUNT.

以下是RMAN 及STANDBY 端的ALERT.LOG.


-------------------------------------------------------------------------------------------------------

[oracle@ract1 dbs]$ rman target sys/sa@tdb auxiliary sys/sa@tdg nocatalog

Recovery Manager: Release 11.2.0.1.0 - Production on Wed Aug 14 15:29:38 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: TDB (DBID=2450705824)
using target database control file instead of recovery catalog
connected to auxiliary database: TDB (not mounted)

RMAN> duplicate target database for standby from active database nofilenamecheck;

Starting Duplicate Db at 2013-08-14 15:31:46
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=10 device type=DISK

contents of Memory Script:
{
   backup as copy reuse
   targetfile  '/opt/app/oracle/product/11.2.0/dbs/orapwtdb1' auxiliary format
'/opt/app/oracle/product/11.2.0/dbs/orapwtdg'   ;
}
executing Memory Script

Starting backup at 2013-08-14 15:31:58
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=46 instance=tdb1 device type=DISK
Finished backup at 2013-08-14 15:32:24

contents of Memory Script:
{
   backup as copy current controlfile for standby auxiliary format  '/opt/app/oracle/oradata/tdg/control01.ctl';
   restore clone controlfile to  '/opt/app/oracle/flash_recovery_area/tdg/control02.ctl' from
'/opt/app/oracle/oradata/tdg/control01.ctl';
}
executing Memory Script

Starting backup at 2013-08-14 15:32:24
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying standby control file
output file name=/opt/app/oracle/product/11.2.0/dbs/snapcf_tdb1.f tag=TAG20130814T153224 RECID=6 STAMP=823447956
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
Finished backup at 2013-08-14 15:32:50

Starting restore at 2013-08-14 15:32:50
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 2013-08-14 15:32:53

contents of Memory Script:
{
   sql clone 'alter database mount standby database';
}
executing Memory Script
.......
"/opt/app/oracle/oradata/tdg/system.259.823282257"   datafile
2 auxiliary format
"/opt/app/oracle/oradata/tdg/sysaux.260.823282317"   datafile
3 auxiliary format
"/opt/app/oracle/oradata/tdg/undotbs1.261.823282361"   datafile
4 auxiliary format
"/opt/app/oracle/oradata/tdg/undotbs2.263.823282545"   datafile
5 auxiliary format
"/opt/app/oracle/oradata/tdg/users.264.823282567"   ;
   sql 'alter system archive log current';
}
executing Memory Script

executing command: SET NEWNAME

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00601: fatal error in recovery manager
RMAN-03004: fatal error during execution of command
RMAN-04006: error from auxiliary database: ORA-12537: TNS:connection closed
RMAN-03002: failure of Duplicate Db command at 08/14/2013 15:33:04
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of switch command on clone_default channel at 08/14/2013 15:33:04
ORA-03113: end-of-file on communication channel
[oracle@ract1 dbs]$



---------------------------------------STANDBY ALERT.LOG----------------------------------------------------------------

Physical Standby Database mounted.
Lost write protection disabled
Wed Aug 14 15:32:59 2013
ARC1 started with pid=24, OS id=13762
Completed: alter database mount standby database
Wed Aug 14 15:32:59 2013
.......
ERROR: slave communication error with ASM; terminating process 13510
Errors in file /opt/app/oracle/diag/rdbms/tdg/tdg/trace/tdg_lgwr_13510.trc:
ORA-00312: online log 5 thread 1: '/opt/app/oracle/flash_recovery_area/tdg/onlinelog/group_5.268.823442397'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
Wed Aug 14 15:33:00 2013
ARC4 started with pid=28, OS id=13770
Wed Aug 14 15:33:01 2013
.......
PMON (ospid: 13488): terminating the instance due to error 470
Instance terminated by PMON, pid = 13488

---------------------primary pfile ---------------------
*.db_file_name_convert='/opt/app/oracle/oradata/tdg','+DATA/tdb/datafile','/opt/app/oracle/oradata/tdg/tempfile','+DATA/tdb/tempfile'
*.LOG_FILE_NAME_CONVERT='/opt/app/oracle/flash_recovery_area/tdg/onlinelog','+DATA/tdb/onlinelog','/opt/app/oracle/flash_recovery_area/tdg/onlinelog' ,'+RECOVERY/tdb/archivelog'
*.log_archive_config='DG_CONFIG=(tdg,tdb)'
*.log_archive_dest_2='SERVICE=tdg LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=tdg'

*.log_archive_dest_state_2='ENABLE'

---------------------standby pfile ---------------------
*.db_file_name_convert='+DATA/tdb/datafile','/opt/app/oracle/oradata/tdg','+DATA/tdb/tempfile','/opt/app/oracle/oradata/tdg/tempfile'
*.log_file_name_convert='+DATA/tdb/onlinelog','/opt/app/oracle/flash_recovery_area/tdg/onlinelog','+RECOVERY/tdb/archivelog','/opt/app/oracle/flash_recovery_area/tdg/onlinelog'
*.log_archive_config='DG_CONFIG=(tdb,tdg)'
*.log_archive_dest_1='LOCATION=/opt/app/oracle/flash_recovery_area/tdg/onlinelog'
*.log_archive_dest_2='SERVICE=tdb LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=tdb'
*.log_archive_dest_state_2='ENABLE'

-------------------------------------------
经和朋友分析后,发现问题出在 log_file_name_convert 参数中的: '+RECOVERY/tdb/archivelog'


在修改参数时,确实没有理解这里同步的是在线重做日志REDO文件。把一个目录修改成了归档日志目录: archivelog了。

在RAC 开启了使用了RECOVERY后,需要把两个地方的REDO都指定同步的目录,比如这里的:

+DATA/tdb/onlinelog

+RECOVERY/tdb/onlinelog

其实这是一对。




这个是PRIMARY 端 RAC1 的参数:

*.LOG_FILE_NAME_CONVERT='/opt/app/oracle/flash_recovery_area/tdg/onlinelog','+DATA/tdb/onlinelog','/opt/app/oracle/flash_recovery_area/tdg/onlinelog' ,'+RECOVERY/tdb/archivelog'

修改后:
*.log_file_name_convert='/opt/app/oracle/flash_recovery_area/tdg/onlinelog','+DATA/tdb/onlinelog','/opt/app/oracle/flash_recovery_area/tdg/onlinelog' ,'+RECOVERY/tdb/onlinelog'


同时也修改了STANDBY端的参数(在RMAN 复制时起作用的还是STANDBY端的参数设置):
*.log_file_name_convert='+DATA/tdb/onlinelog','/opt/app/oracle/flash_recovery_area/tdg/onlinelog' ,'+RECOVERY/tdb/archivelog','/opt/app/oracle/flash_recovery_area/tdg/onlinelog'
修改后的:

*.log_file_name_convert='+DATA/tdb/onlinelog','/opt/app/oracle/flash_recovery_area/tdg/onlinelog', '+RECOVERY/tdb/onlinelog','/opt/app/oracle/flash_recovery_area/tdg/onlinelog'

你可能感兴趣的:(管理,oracle)