在pub上看到一个朋友问这样一个问题,standby环境中,在主库上做rman的全备份,备份完毕要执行删除归档日志的操作,但是如果把归档日志删除了,而恰好这些归档日志还没有传到备库应用,这样的话,主备库不就不一致了嘛,肯定要出现gap的?
刚一想,这还真是个问题,于是做了测试,结果是无需担心rman会删除主库没有传到备库的归档日志,因为如果主库的某些归档日志如果没有传到备库的话,rman根本不会删除这些归档。
具体测试如下:
1:模拟主库传送归档失败:
www.ixdba.net
首先停止备库的监听,然后重新启动主库,(因为如果不重新启动主库的话,就算停掉备库的监听,主库也是认不到的。)在主库上执行日志切换操作:
[oracle@gaojf dbs]$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Dec 6 09:27:26 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> alter system switch logfile;
System altered.
SQL> /
System altered.
SQL> /
System altered.
SQL> /
System altered.
SQL> /
此时主库日志信息类似如下:主库归档不能传输到备库了。
Wed Dec 6 09:57:33 2006
Thread 1 advanced to log sequence 298
Current log# 2 seq# 298 mem# 0: /free/oracle/oradata/orcl/redo02.log
Wed Dec 6 09:57:33 2006
Error 12541 received logging on to the standby
Check whether the listener is up and running.
Wed Dec 6 09:57:33 2006
Errors in file /free/oracle/admin/orcl/bdump/orcl_arc0_11916.trc:
ORA-12541: TNS:no listener
FAL[server, ARC0]: Error 12541 creating remote archivelog file 'STANDBY'
FAL[server, ARC0]: FAL archive failed, see trace file.
Wed Dec 6 09:57:33 2006
Errors in file /free/oracle/admin/orcl/bdump/orcl_arc0_11916.trc:
ORA-16055: FAL request rejected
ARCH: FAL archive failed. Archiver continuing
Wed Dec 6 09:57:33 2006
ORACLE Instance orcl - Archival Error. Archiver continuing.
Wed Dec 6 09:58:07 2006
Thread 1 cannot allocate new log, sequence 299
Checkpoint not complete
Current log# 2 seq# 298 mem# 0: /free/oracle/oradata/orcl/redo02.log
Thread 1 advanced to log sequence 299
Current log# 3 seq# 299 mem# 0: /free/oracle/oradata/orcl/redo03.log
Wed Dec 6 09:58:11 2006
Error 12541 received logging on to the standby
Check whether the listener is up and running.
Wed Dec 6 09:58:11 2006
Errors in file /free/oracle/admin/orcl/bdump/orcl_arc0_11916.trc:
ORA-12541: TNS:no listener
FAL[server, ARC0]: Error 12541 creating remote archivelog file 'STANDBY'
FAL[server, ARC0]: FAL archive failed, see trace file.
Wed Dec 6 09:58:11 2006
Errors in file /free/oracle/admin/orcl/bdump/orcl_arc0_11916.trc:
ORA-16055: FAL request rejected
ARCH: FAL archive failed. Archiver continuing
Wed Dec 6 09:58:11 2006
ORACLE Instance orcl - Archival Error. Archiver continuing.
Wed Dec 6 09:58:37 2006
Error 12541 received logging on to the standby
Check whether the listener is up and running.
Wed Dec 6 09:58:37 2006
Errors in file /free/oracle/admin/orcl/bdump/orcl_arc0_11916.trc:
ORA-12541: TNS:no listener
PING[ARC0]: Heartbeat failed to connect to standby 'STANDBY'. Error is 12541.
Wed Dec 6 09:59:37 2006
Error 12541 received logging on to the standby
Check whether the listener is up and running.
Wed Dec 6 09:59:37 2006
Errors in file /free/oracle/admin/orcl/bdump/orcl_arc0_11916.trc:
ORA-12541: TNS:no listener
PING[ARC0]: Heartbeat failed to connect to standby 'STANDBY'. Error is 12541.
Wed Dec 6 10:00:37 2006
Error 12541 received logging on to the standby
Check whether the listener is up and running.
Wed Dec 6 10:00:37 2006
Errors in file /free/oracle/admin/orcl/bdump/orcl_arc0_11916.trc:
ORA-12541: TNS:no listener
PING[ARC0]: Heartbeat failed to connect to standby 'STANDBY'. Error is 12541.
Wed Dec 6 10:01:37 2006
Error 12541 received logging on to the standby
Check whether the listener is up and running.
Wed Dec 6 10:01:37 2006
Errors in file /free/oracle/admin/orcl/bdump/orcl_arc0_11916.trc:
ORA-12541: TNS:no listener
PING[ARC0]: Heartbeat failed to connect to standby 'STANDBY'. Error is 12541.
Wed Dec 6 10:02:37 2006
Shutting down archive processes
Wed Dec 6 10:02:42 2006
ARCH shutting down
ARC2: Archival stopped
Wed Dec 6 10:02:42 2006
Error 12541 received logging on to the standby
Check whether the listener is up and running.
Wed Dec 6 10:02:42 2006
Errors in file /free/oracle/admin/orcl/bdump/orcl_arc0_11916.trc:
ORA-12541: TNS:no listener
PING[ARC0]: Heartbeat failed to connect to standby 'STANDBY'. Error is 12541.
Wed Dec 6 10:02:43 2006
Thread 1 advanced to log sequence 300
Current log# 1 seq# 300 mem# 0: /free/oracle/oradata/orcl/redo01.log
Wed Dec 6 10:03:42 2006
Error 12541 received logging on to the standby
Check whether the listener is up and running.
Wed Dec 6 10:03:42 2006
Errors in file /free/oracle/admin/orcl/bdump/orcl_arc0_11916.trc:
ORA-12541: TNS:no listener
PING[ARC0]: Heartbeat failed to connect to standby 'STANDBY'. Error is 12541.
Wed Dec 6 10:03:50 2006
Thread 1 cannot allocate new log, sequence 301
Checkpoint not complete
Current log# 1 seq# 300 mem# 0: /free/oracle/oradata/orcl/redo01.log
Thread 1 advanced to log sequence 301
Current log# 2 seq# 301 mem# 0: /free/oracle/oradata/orcl/redo02.log
Wed Dec 6 10:03:53 2006
Error 12541 received logging on to the standby
Check whether the listener is up and running.
Wed Dec 6 10:03:53 2006
Errors in file /free/oracle/admin/orcl/bdump/orcl_arc0_11916.trc:
ORA-12541: TNS:no listener
FAL[server, ARC0]: Error 12541 creating remote archivelog file 'STANDBY'
FAL[server, ARC0]: FAL archive failed, see trace file.
Wed Dec 6 10:03:53 2006
Errors in file /free/oracle/admin/orcl/bdump/orcl_arc0_11916.trc:
ORA-16055: FAL request rejected
ARCH: FAL archive failed. Archiver continuing
Wed Dec 6 10:03:53 2006
ORACLE Instance orcl - Archival Error. Archiver continuing.
Wed Dec 6 10:04:42 2006
Error 12541 received logging on to the standby
Check whether the listener is up and running.
Wed Dec 6 10:04:42 2006
Errors in file /free/oracle/admin/orcl/bdump/orcl_arc0_11916.trc:
ORA-12541: TNS:no listener
PING[ARC0]: Heartbeat failed to connect to standby 'STANDBY'. Error is 12541.
Wed Dec 6 10:05:42 2006
Error 12541 received logging on to the standby
Check whether the listener is up and running.
Wed Dec 6 10:05:42 2006
Errors in file /free/oracle/admin/orcl/bdump/orcl_arc0_11916.trc:
ORA-12541: TNS:no listener
PING[ARC0]: Heartbeat failed to connect to standby 'STANDBY'. Error is 12541.
Wed Dec 6 10:06:42 2006
Error 12541 received logging on to the standby
Check whether the listener is up and running.
Wed Dec 6 10:06:42 2006
Errors in file /free/oracle/admin/orcl/bdump/orcl_arc0_11916.trc:
ORA-12541: TNS:no listener
PING[ARC0]: Heartbeat failed to connect to standby 'STANDBY'. Error is 12541.
Wed Dec 6 10:07:42 2006
Error 12541 received logging on to the standby
Check whether the listener is up and running.
Wed Dec 6 10:07:42 2006
Errors in file /free/oracle/admin/orcl/bdump/orcl_arc0_11916.trc:
ORA-12541: TNS:no listener
PING[ARC0]: Heartbeat failed to connect to standby 'STANDBY'. Error is 12541.
Wed Dec 6 10:08:39 2006
Thread 1 advanced to log sequence 302
Current log# 3 seq# 302 mem# 0: /free/oracle/oradata/orcl/redo03.log
Wed Dec 6 10:08:39 2006
Error 12541 received logging on to the standby
Check whether the listener is up and running.
Wed Dec 6 10:08:39 2006
Errors in file /free/oracle/admin/orcl/bdump/orcl_arc0_11916.trc:
ORA-12541: TNS:no listener
FAL[server, ARC0]: Error 12541 creating remote archivelog file 'STANDBY'
FAL[server, ARC0]: FAL archive failed, see trace file.
Wed Dec 6 10:08:39 2006
Errors in file /free/oracle/admin/orcl/bdump/orcl_arc0_11916.trc:
ORA-16055: FAL request rejected
ARCH: FAL archive failed. Archiver continuing