在Oracle DataGuard部署过程中,如果操作不规范,可能遇到很多想不到的问题。有些问题是配置参数不到位,有些是操作不规范遗漏导致。
问题一
主库复制备库到备机时,rman远程登陆主库作为复制的目标库rman无法登陆备机备库,就是下面的命令执行报错:
rman target sys/oracle@dg_orclp auxiliary sys/oracle@dg_orcls
问题原始是从库的TNS配置不规范,缺少(UR=A),示例配置
DG_ORCLS =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.10.101.36)(PORT = 1521))
(LOAD_BALANCE = off)
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME =DG_ORCLS)
(UR=A)
)
)
问题二
主库复制备库到备机时,rman执行duplicat的时,duplicat过程执行报错ORA-17629&ORA-17627:
RMAN> duplicate target database for standby from active database nofilenamecheck;
Starting Duplicate Db at 2019-03-10 11:38:4
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=1811 instance=orcl1 device type=DISK
contents of Memory Script:
{
backup as copy reuse
targetfile '/oracle/app/oracle/product/11.2.0/dbs/orapworcl1' auxiliary format
'/oracle/app/oracle/product/11.2.0/dbs/orapworcl1' ;
}
executing Memory Script
Starting backup at 2019-03-10 11:38:43
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=4533 instance=orcl1 device type=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 03/10/2019 11:38:45
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 03/10/2019 11:38:45
ORA-17629: Cannot connect to the remote database server
ORA-17627: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
ORA-17629: Cannot connect to the remote database server
RMAN>
这个问题比较有趣,配置好TNS后,通过ttnsping和sqlplus sys/oracle@to_orcl as sysdba都正常,就是rman的dumplicat进行从库的复制时报错。该问题的原因是备库的TNS配置中的服务名和主库备库中的log_archive_config='dg_config=()'参数中配置的服务名不一致导致,或者是主库以alter system方式修改了log_archive_config='dg_config',数据库没有重启,因为log_archive_config参数是静态参数,需要重启数据库服务才能生效。
问题三
在备机通过rman复制主库的时,rman复制过程报错:RMAN-03009&ORA-17628:
Starting backup at 2019-03-10 12:56:20
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=+DGSYSTEM/orcl/datafile/undotbs1.261.876856357
output file name=+DGSYSTEM/orcl/datafile/undotbs1.340.1002545783 tag=TAG20190310T124734
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:55
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=+DGSYSTEM/orcl/datafile/undotbs2.263.876856383
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 03/10/2019 12:59:21
ORA-17628: Oracle error 19505 returned by remote Oracle server
continuing other job steps, job failed will not be re-run
该问题十分严重,通过job failed will not be re-run可以得知,此次的DG复制完全失败了。此问题的原因是存放数据文件相关的ASM磁盘组空间耗尽导致的,因此,在DG主备库开始配置之前,一定要评估好备库的存储并规划好,避免这种因存储空间问题导致DG复制失败的发生。
问题四
DG备库复制完主库后,备库alert日志告警登陆主库被拒绝,主库告警日志提示登陆备库失败。
--备库告警日志
Thu Mar 14 06:51:40 2019
RFS[252]: Assigned to RFS process 3408762
RFS[252]: Opened log for thread 2 sequence 23863 dbid -2091533043 branch 876856333
Thu Mar 14 06:51:42 2019
2019-03-14 06:51:42 logon denied from 172.10.101.61 5964584 oracle with oracle@orcl01 (TNS V1-V3) ¨C oracle@orcl01 (TNS V1-V3) ===username=
Thu Mar 14 06:51:42 2019
2019-03-14 06:51:42 logon denied from 172.10.101.61 13697046 oracle with oracle@orcl01 (TNS V1-V3) ¨C oracle@orcl01 (TNS V1-V3) ===username=
Thu Mar 14 06:51:43 2019
2019-03-14 06:51:43 logon denied from 172.10.101.61 10486550 oracle with oracle@orcl01 (TNS V1-V3) ¨C oracle@orcl01 (TNS V1-V3) ===username=
Thu Mar 14 06:51:43 2019
2019-03-14 06:51:43 logon denied from 172.10.101.61 7274758 oracle with oracle@orcl01 (TNS V1-V3) ¨C oracle@orcl01 (TNS V1-V3) ===username=
Thu Mar 14 06:51:43 2019
2019-03-14 06:51:43 logon denied from 172.10.101.61 14156172 oracle with oracle@orcl01 (TNS V1-V3) ¨C oracle@orcl01 (TNS V1-V3) ===username=