[20170207]RMAN-06820 WARNING failed to archive current log at primary database.txt
--//生产系统越来越大,备份的时间窗口越来越长,现在生产系统全备从晚上11点开始,基本到第2天早上8点多才结束.
--//有点影响业务的正常运行,我试着多打开一个并行,效果也不是很理想,也就是提前1个小时结束.节前跟朋友聊天建议移到dataguard做
--//备份.从以后的业务考虑,我先在测试环境测试看看.
1.环境:
SYS@book> @ &r/ver1
PORT_STRING VERSION BANNER
------------------- -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
--为了测试没问题还特地更新口令文件,拷贝口令文件并测试日志能传输与应用.
2.在dg上备份:
--//我在dg上执行:
RMAN> backup as compressed backupset database tag='full 20170207' format '/u01/backup/full_%u'
plus archivelog not backed up 1 times tag='archivelog 20170207' format '/u01/backup/full_%U';
Starting backup at 2017-02-07 16:23:16
using target database control file instead of recovery catalog
RMAN-06820: WARNING: failed to archive current log at primary database
ORACLE error from target database:
ORA-17629: Cannot connect to the remote database server
ORA-17627: ORA-00942: table or view does not exist
....
channel ORA_DISK_1: finished piece 1 at 2017-02-07 16:24:58
piece handle=/u01/backup/full_53rs08vr tag=FULL 20170207 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:35
Finished backup at 2017-02-07 16:24:58
Starting backup at 2017-02-07 16:24:59
RMAN-06820: WARNING: failed to archive current log at primary database
ORACLE error from target database:
ORA-17629: Cannot connect to the remote database server
ORA-17627: ORA-00942: table or view does not exist
--//在开始与结束都出现RMAN-06820: WARNING: failed to archive current log at primary database,很容易想到问题做这种备份:
1.alter system archive log current ;
2.备份archivelog;
3.备份数据库文件
4.alter system archive log current ;
5.备份剩下的archivelog备份.
--//链接: http://blog.itpub.net/267265/viewspace-2130267/
--//很明显在dg上做这种备份存在问题,我的第一感觉使用catalog数据库也许可以(可惜我们备份几乎不用这种模式).我google看一些文档:
http://blog.itpub.net/17203031/viewspace-1814880/
--//按照提示可以加入sys用户与口令,还是测试看看:
$ rlwrap rman target sys/oracle
RMAN> delete backupset ;
....
RMAN> backup as compressed backupset database tag='full 20170207' format '/u01/backup/full_%u'
plus archivelog not backed up 1 times tag='archivelog 20170207' format '/u01/backup/full_%U';
Starting backup at 2017-02-07 16:33:00
current log archived at primary database
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=391 RECID=226 STAMP=935334305
input archived log thread=1 sequence=392 RECID=227 STAMP=935338863
...
channel ORA_DISK_1: finished piece 1 at 2017-02-07 16:34:40
piece handle=/u01/backup/full_59rs09i0 tag=FULL 20170207 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:36
Finished backup at 2017-02-07 16:34:40
Starting backup at 2017-02-07 16:34:40
current log archived at primary database
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=395 RECID=230 STAMP=935339681
channel ORA_DISK_1: starting piece 1 at 2017-02-07 16:34:42
channel ORA_DISK_1: finished piece 1 at 2017-02-07 16:34:43
piece handle=/u01/backup/full_5crs09l2_1_1 tag=ARCHIVELOG 20170207 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2017-02-07 16:34:43
Starting Control File and SPFILE Autobackup at 2017-02-07 16:34:44
piece handle=/u01/app/oracle/fast_recovery_area/BOOKDG/autobackup/2017_02_07/o1_mf_s_935339580_d9m1o54s_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 2017-02-07 16:34:47
--//OK.这种没有问题.
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- ------------------- ------- ------- ---------- ---
146 B A A DISK 2017-02-07 16:33:03 1 1 YES ARCHIVELOG 20170207
147 B A A DISK 2017-02-07 16:33:03 1 1 YES ARCHIVELOG 20170207
148 B F A DISK 2017-02-07 16:33:19 1 1 YES FULL 20170207
149 B F A DISK 2017-02-07 16:34:27 1 1 YES FULL 20170207
150 B F A DISK 2017-02-07 16:34:31 1 1 YES FULL 20170207
151 B A A DISK 2017-02-07 16:34:42 1 1 YES ARCHIVELOG 20170207
152 B F A DISK 2017-02-07 16:34:45 1 1 NO TAG20170207T163444
--//检查主库alert文件,可以发现如下信息:
ALTER SYSTEM ARCHIVE LOG
Tue Feb 07 16:33:00 2017
Beginning log switch checkpoint up to RBA [0x18b.2.10], SCN: 13275830558
Thread 1 advanced to log sequence 395 (LGWR switch)
Current log# 1 seq# 395 mem# 0: /mnt/ramdisk/book/redo01.log
Archived Log entry 625 added for thread 1 sequence 394 ID 0x4fb7d86e dest 1:
Tue Feb 07 16:33:01 2017
LNS: Standby redo logfile selected for thread 1 sequence 395 for destination LOG_ARCHIVE_DEST_2
Tue Feb 07 16:34:40 2017
ALTER SYSTEM ARCHIVE LOG
Tue Feb 07 16:34:40 2017
Beginning log switch checkpoint up to RBA [0x18c.2.10], SCN: 13275830665
Thread 1 advanced to log sequence 396 (LGWR switch)
Current log# 2 seq# 396 mem# 0: /mnt/ramdisk/book/redo02.log
Archived Log entry 627 added for thread 1 sequence 395 ID 0x4fb7d86e dest 1:
Tue Feb 07 16:34:41 2017
LNS: Standby redo logfile selected for thread 1 sequence 396 for destination LOG_ARCHIVE_DEST_2
--按照链接提示:
http://blog.itpub.net/17203031/viewspace-1814880/
这个问题很不合理,看似应该是Oracle Bug之类的情况。查询MOS,发现了对应的Bug信息:RMAN-06820 ORA-17629 During Backup at
Standby Site (文档 ID 1616074.1)。
根据文章信息,该问题Oracle一个未发布的bug,编号为Bug 8740124。当Oracle尝试访问主库过程中,需要连带将全部的standby log获
取到。当连接失败的时候,就会发生报错。
要解决该问题,Oracle提供了一个变通的办法,就是不要使用target /匿名方式登录,而是使用sysdba用户的用户名和密码信息进行直接
连接。