[20180115]RMAN-06820.txt

简介: [20180115]RMAN-06820.txt --//在备库做归档备份出现RMAN-06820的问题。就是如果在备库做全表,因为要做主库日志切换,一般执行rman target /会出现问题。

[20180115]RMAN-06820.txt

--//在备库做归档备份出现RMAN-06820的问题。就是如果在备库做全表,因为要做主库日志切换,一般执行rman target /会出现问题。
--//必须在备库使用sys/passwd方式登录rman。

1.环境:
SYS@bookdg> @ &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

rman target /
...
RMAN> delete  archivelog all ;
....
RMAN> backup archivelog all ;

Starting backup at 2018-01-15 15:49:04
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

using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
specification does not match any archived log in the repository
backup cancelled because there are no files to backup
Finished backup at 2018-01-15 15:49:04

2.采用输入口令的方法:

$ rlwrap rman
Recovery Manager: Release 11.2.0.4.0 - Production on Mon Jan 15 15:51:57 2018
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
RMAN> connect  target sys
target database Password:
connected to target database: BOOK (DBID=1337401710)

RMAN> backup archivelog all ;
Starting backup at 2018-01-15 15:52:08
using target database control file instead of recovery catalog
current log archived at primary database
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=12 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=73 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=134 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=786 RECID=94 STAMP=965490729
channel ORA_DISK_1: starting piece 1 at 2018-01-15 15:52:12
channel ORA_DISK_1: finished piece 1 at 2018-01-15 15:52:13
piece handle=/u01/app/oracle/fast_recovery_area/BOOKDG/backupset/2018_01_15/o1_mf_annnn_TAG20180115T155211_f5rqfd8f_.bkp tag=TAG20180115T155211 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2018-01-15 15:52:13

Starting Control File and SPFILE Autobackup at 2018-01-15 15:52:13
piece handle=/u01/app/oracle/fast_recovery_area/BOOKDG/autobackup/2018_01_15/o1_mf_s_965475661_f5rqfg61_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 2018-01-15 15:52:16

3.做一个跟踪:
$ rman target / | tee aa.txt
RMAN> debug on
RMAN> backup archivelog all ;
RMAN> quit

--//注很奇怪如果这样打rman  target / debug  trace=tracefile.trc,跟踪文件里面没有RMAN-06820: WARNING: failed to archive current log at primary database错误。
--//检查跟踪文件:

DBGSQL:       TARGET> begin   :lprimary_db_cs :=     sys.dbms_backup_restore.get_connect_identifier       (dbuname=> :primary_dbuname); end;
DBGSQL:          sqlcode = 0
DBGSQL:           B :lprimary_db_cs = book
DBGSQL:           B :primary_dbuname = book
  DBGRCVMAN: getConfig: configurations exists for this site
DBGSQL:       ENTERED krmkosqlerr
--//这步ok。

DBGSQL:        TARGET> declare null_retVal varchar2(1); begin   null_retVal :=
                       sys.dbms_backup_restore.remoteSQLExecute(      source_dbuname=> :primary_dbuname,      source_cs
                       => :lprimary_db_cs, stmt          => 'alter system archive log current'); end;
DBGSQL:           sqlcode = 17629
DBGSQL:            B :primary_dbuname = book
DBGSQL:            B :lprimary_db_cs = book
DBGSQL:        error: ORA-17629: Cannot connect to the remote database server (krmkosqlerr)
DBGSQL:        ORA-17627: ORA-00942: table or view does not exist (krmkosqlerr)
DBGSQL:        ORA-06512: at "SYS.DBMS_BACKUP_RESTORE", line 7809 (krmkosqlerr)
DBGSQL:        ORA-06512: at line 1 (krmkosqlerr)
DBGSQL:         (krmkosqlerr)
DBGSQL:       EXITED krmkosqlerr
RMAN-06820: WARNING: failed to archive current log at primary database
DBGMISC:      ENTERED krmkursr [16:22:19.636]

DBGSQL:        TARGET> begin sys.dbms_backup_restore.updateRmanStatusRow( row_id    => :row_id, row_stamp => :row_stamp, status    => :status); end;
DBGSQL:           sqlcode = 0
DBGSQL:            B :row_id = 507
DBGSQL:            B :row_stamp = 965492539
DBGSQL:            B :status = 9
DBGMISC:      EXITED krmkursr [16:22:19.638] elapsed time [00:00:00:00.001]
DBGMISC:      krmksqlerror called from file krmk3.c, line 2094 [16:22:19.638]
RMAN-06003: ORACLE error from target database:
ORA-17629: Cannot connect to the remote database server
ORA-17627: ORA-00942: table or view does not exist

--//我格式化
/* Formatted on 2018/1/15 16:24:49 (QP5 v5.252.13127.32867) */

DECLARE
   null_retVal   VARCHAR2 (1);
BEGIN
   null_retVal :=
      sys.DBMS_BACKUP_RESTORE.remoteSQLExecute
      (
         source_dbuname   => :primary_dbuname
        ,source_cs        => :lprimary_db_cs
        ,stmt             => 'alter system archive log current'
      );
END;

--//很明显在使用这条语句报错。导致紧跟的语句也报错。
--//begin sys.dbms_backup_restore.updateRmanStatusRow( row_id    => :row_id, row_stamp => :row_stamp, status    => :status); end;

$ rman target sys/oracle | tee bb.txt
....

--//检查跟踪文件:
DBGSQL:       TARGET> begin   :lprimary_db_cs :=     sys.dbms_backup_restore.get_connect_identifier       (dbuname=> :primary_dbuname); end;
DBGSQL:          sqlcode = 0
DBGSQL:           B :lprimary_db_cs = book
DBGSQL:           B :primary_dbuname = book
  DBGRCVMAN: getConfig: configurations exists for this site
--// 这里少了DBGSQL:       ENTERED krmkosqlerr对比前面,是否意味这这里就报错了。

DBGSQL:       TARGET> declare null_retVal varchar2(1); begin   null_retVal :=     sys.dbms_backup_restore.remoteSQLExecute(      source_dbuname=> :primary_dbuname,      source_cs     => :lprimary_db_cs,      stmt          => 'alter system archive log current'); end;
DBGSQL:          sqlcode = 0
DBGSQL:           B :primary_dbuname = book
DBGSQL:           B :lprimary_db_cs = book
RMAN-06819: current log archived at primary database
--//可以发现切换成功。

DBGSQL:       TARGET> begin   :max_first_scn :=     sys.dbms_backup_restore.remoteSQLExecute(      source_dbuname=> :primary_dbuname,      source_cs     => :lprimary_db_cs,      stmt          => 'select max(first_change#) from v$log  where status = ''CURRENT'''); end;
DBGSQL:          sqlcode = 0
DBGSQL:           B :max_first_scn = 13277506958
DBGSQL:           B :primary_dbuname = book
DBGSQL:           B :lprimary_db_cs = book

4.另外一个注意的问题,在备库删除归档,总会保留最后1个不会删除。

RMAN> delete archivelog all ;
released channel: ORA_DISK_1
released channel: ORA_DISK_2
released channel: ORA_DISK_3
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=12 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=73 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=134 device type=DISK
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
archived log file name=/u01/app/oracle/archivelog/book/1_788_896605872.dbf thread=1 sequence=788
List of Archived Log Copies for database with db_unique_name BOOKDG
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - -------------------
94      1    786     A 2018-01-15 11:41:01
        Name: /u01/app/oracle/archivelog/book/1_786_896605872.dbf

95      1    787     A 2018-01-15 15:52:08
        Name: /u01/app/oracle/archivelog/book/1_787_896605872.dbf

Do you really want to delete the above objects (enter YES or NO)? no

--//而实际上已经应用seq=788的日志。

SYS@bookdg> @ &r/dg/dg
PROCESS       PID STATUS       CLIENT_P GROUP#  THREAD#  SEQUENCE#     BLOCK#     BLOCKS DELAY_MINS
--------- ------- ------------ -------- ------- ------- ---------- ---------- ---------- ----------
ARCH        11680 CONNECTED    ARCH     N/A           0          0          0          0          0
RFS           696 IDLE         ARCH     N/A           0          0          0          0          0
RFS           359 IDLE         UNKNOWN  N/A           0          0          0          0          0
RFS           355 IDLE         UNKNOWN  N/A           0          0          0          0          0
RFS           691 IDLE         LGWR     2             1        789        124          1          0
ARCH        11676 CLOSING      ARCH     4             1        788          1        398          0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ARCH        11678 CLOSING      ARCH     4             1        786      26624        680          0
ARCH        11682 CLOSING      ARCH     5             1        787       6144        441          0
MRP0        11879 APPLYING_LOG N/A      N/A           1        789        124     102400          0
9 rows selected.

--//而在主库执行可以删除到seq=788 (执行delete archivelog all ;)

目录
相关文章
|
Oracle 关系型数据库
[20180423]关于rman备份的问题2.txt
[20180423]关于rman备份的问题2.txt --//别人问的问题,rman备份放在哪里的问题. SCOTT@book> @ ver1 PORT_STRING                    VERSION        BANNER --...
928 0
|
Oracle 关系型数据库 测试技术
[20171225]RMAN-06808.txt
[20171225]RMAN-06808: SECTION SIZE cannot be used when piece limit is in effect.txt --//朋友拿我的一些例子来测试遇到的RMAN-06808: SECTION SIZE cannot be used when piece limit is in effect问题.
947 0
|
关系型数据库
[20171221]RMAN-05501.txt
[20171221]RMAN-05501 aborting duplication of target database.txt --//昨天使用rman duplicate建立dg,出现如下错误: rman > duplicate target database for standby from active database; .
1068 0
|
Oracle 关系型数据库
[20171130]关于rman的一些总结.txt
[20171130]关于rman的一些总结.txt --//最近一直做rman相关测试,测试那个乱,没办法.无法从周围的人获得帮助,纯粹是自己的乱猜,乱测,不知道别人是否能看懂我写的东西.
1087 0
|
Oracle 关系型数据库 Shell
[20171121]rman backup as copy 2.txt
[20171121]rman backup as copy 2.txt --//昨天测试backup as copy ,备份时备份文件的文件头什么时候更新.是最后完成后还是顺序写入备份文件.
1011 0
|
Oracle 关系型数据库 Linux
[20171121]rman backup as copy.txt
[20171121]rman backup as copy.txt --//上个星期做数据文件块头恢复时,提到使用rman备份数据文件时,文件头数据库信息是最后写入备份集文件的,在filesperset=1的情况 --//下写入备份集文件中的倒数第2块就是文件头的备份.
1225 0
|
Oracle 关系型数据库 API
[20170208]rman tape.txt
[20170208]rman tape.txt --前一阵子,同事测试使用磁带做rman备份,留下一些备份信息在控制文件,要清除. --我依稀记得我以前也干过这些事情,晚上看了一下书: Apress.
983 0
|
Oracle 关系型数据库 测试技术
[20170207]RMAN-06820错误.txt
[20170207]RMAN-06820 WARNING failed to archive current log at primary database.txt --//生产系统越来越大,备份的时间窗口越来越长,现在生产系统全备从晚上11点开始,基本到第2天早上8点多才结束.
1248 0
|
关系型数据库 Oracle Linux
[20161230]rman checksyntax2.txt
[20161230]rman checksyntax2.txt --曾经写过一篇rman checksyntax的问题,这个问题存在10g: http://blog.
757 0
|
SQL Oracle 关系型数据库
[20161214]rman checksyntax.txt
[20161214]rman checksyntax.txt --rman在命令行使用参数checksyntax可以检查命令语法是否正确,而且并不会真正执行.但是昨天在恢复一个10g的数据库时遇到问题,做 --一个记录: 1.
939 0