根据Oracle最佳实践,主库Primary是可以不进行直接的备份,核心备份操作可以放在Standby端进行操作,这样不仅可以节省备份资源,还可以有效的将备份的性能消耗转移到Standby端进行。
本文记录了笔者在Physical Standby端进行RMAN备份的时候,遇到错误信息的问题解决。记录下来,留待需要的朋友待查。
1、环境说明
笔者使用Oracle 11gR2进行测试,具体版本为11.2.0.4。Data Guard Primary和Standby采用的版本完全相同。
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE? ? 11.2.0.4.0? ? Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 – Production
在Standby端,是采用Active Data Guard只读应用状态。
SQL> select open_mode, database_role from v$database;
OPEN_MODE? ? ? ? ? ? DATABASE_ROLE
-------------------- ----------------
READ ONLY WITH APPLY PHYSICAL STANDBY
2、问题故障
在standby端,使用RMAN进行备份动作。进行全库备份和归档日志备份,备份之后尝试删除掉已经备份的日志文件。
[oracle@vLIFE-URE-OT-DB-STANDBY trace]$ rman nocatalog
Recovery Manager: Release 11.2.0.4.0 - Production on Sun Oct 18 13:44:54 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates.? All rights reserved.
RMAN> connect target /
connected to target database: VLIFE (DBID=4207470439)
using target database control file instead of recovery catalog
进行RMAN备份。
RMAN> backup database plus archivelog delete input;
Starting backup at 18-OCT-15
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
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=204 device type=DISK
specification does not match any archived log in the repository
backup cancelled because there are no files to backup
Finished backup at 18-OCT-15
Starting backup at 18-OCT-15
(篇幅原因,有省略……)
handle=/u01/app/oracle/fast_recovery_area/VLIFESB/autobackup/2015_10_18/o1_mf_s_893423697_c26dj5nb_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 18-OCT-15
在备份过程中出现错误,错误提示上好像是要访问Primary端数据库,之后由于权限问题没有能够访问。其他备份动作看似正常,备份集合显示正确。
RMAN> list backup;
List of Backup Sets
===================
BS Key? Size? ? ? Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
6? ? ? 27.46M? ? DISK? ? ? ? 00:00:00? ? 18-OCT-15? ? ?
? ? ? ? BP Key: 7? Status: AVAILABLE? Compressed: NO? Tag: TAG20151018T133946
? ? ? ? Piece Name: /u01/app/oracle/fast_recovery_area/VLIFESB/backupset/2015_10_18/o1_mf_annnn_TAG20151018T133946_c26d52kd_.bkp
? List of Archived Logs in backup set 6
? Thrd Seq? ? Low SCN? ? Low Time? Next SCN? Next Time
? ---- ------- ---------- --------- ---------- ---------
? 1? ? 22? ? ? 1290925? ? 18-OCT-15 1298642? ? 18-OCT-15
? 1? ? 23? ? ? 1298642? ? 18-OCT-15 1298901? ? 18-OCT-15
? 1? ? 24? ? ? 1298901? ? 18-OCT-15 1299107? ? 18-OCT-15
? 1? ? 25? ? ? 1299107? ? 18-OCT-15 1299528? ? 18-OCT-15
? 1? ? 26? ? ? 1299528? ? 18-OCT-15 1301585? ? 18-OCT-15
? 1? ? 27? ? ? 1301585? ? 18-OCT-15 1301853? ? 18-OCT-15
? 1? ? 28? ? ? 1301853? ? 18-OCT-15 1302226? ? 18-OCT-15
? 1? ? 29? ? ? 1302226? ? 18-OCT-15 1303310? ? 18-OCT-15
? 1? ? 30? ? ? 1303310? ? 18-OCT-15 1303858? ? 18-OCT-15
? 1? ? 31? ? ? 1303858? ? 18-OCT-15 1308314? ? 18-OCT-15
BS Key? Type LV Size? ? ? Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
11? ? ? Full? ? 1.11G? ? ? DISK? ? ? ? 00:00:08? ? 18-OCT-15? ? ?
? ? ? ? BP Key: 12? Status: AVAILABLE? Compressed: NO? Tag: TAG20151018T13