1. 程式人生 > >ORA-19502: write error on file "", block number (block size=)

ORA-19502: write error on file "", block number (block size=)

1. 問題描述

檢查alert發現如下報錯:

Wed Jun 08 23:03:50 2016
LNS: Attempting destination LOG_ARCHIVE_DEST_2 network reconnect (19502)
LNS: Destination LOG_ARCHIVE_DEST_2 network reconnect abandoned
Error 19502 for archive log file 5 to 'PRODS'
Errors in file /u01/PROD/oracle/diag/rdbms/prod/PROD1/trace/PROD1_nsa2_25439.trc:
ORA-19502: write error on file "", block number  (block size=)
LNS: Failed to archive log 5 thread 1 sequence 22037 (19502)

去檢視DG:

發現端午假期幾天的歸檔尚未在備庫應用,也未傳過去

SQL> l
  1* select dest_name, error from v$archive_dest
SQL> /


DEST_NAMEERROR
---------------------------------------- -----------------------------------------------------------------
LOG_ARCHIVE_DEST_1
LOG_ARCHIVE_DEST_2ORA-19502: write error on file "", block number  (block size=)
LOG_ARCHIVE_DEST_3

2. 問題分析

根據alert應該是由於網路原因導致LOG_ARCHIVE_DEST_2報錯之類

再去備庫查應用程序MRP0發現是停止的

3. 問題解決

主庫檢視近幾天的日誌都在(11g 如果備庫日誌未應用主庫會保留)

先enable主庫LOG_ARCHIVE_DEST_2

SQL>  alter system set log_archive_dest_state_2=enable;
System altered.
SQL> 

SQL> select dest_name, error from v$archive_dest;
DEST_NAMEERROR
---------------------------------------- -----------------------------------------------------------------
LOG_ARCHIVE_DEST_1
LOG_ARCHIVE_DEST_2
LOG_ARCHIVE_DEST_3
LOG_ARCHIVE_DEST_4
LOG_ARCHIVE_DEST_5

禁用如下:

  alter system set log_archive_dest_state_2=defer; 

日誌也已經開始傳輸:

備庫再啟動應用程序:

SQL> alter database recover managed standby database disconnect from session;

再次檢視備庫情況DG已執行正常

SQL> l
  1* select PROCESS,STATUS, THREAD#,SEQUENCE# from v$managed_standby
SQL> /                                                                            


PROCESS   STATUS THREAD#  SEQUENCE#
--------- ------------ ---------- ----------
ARCH CLOSING 1      22036
ARCH CLOSING 2      15425
ARCH CLOSING 2      15116
ARCH CLOSING 1      22197
RFS WRITING 1      22198
RFS WRITING 2      15485
MRP0 APPLYING_LOG1      22034
RFS WRITING 1      22088
RFS WRITING 1      22089
RFS WRITING 2      15532
RFS OPENING 2      15486


PROCESS   STATUS THREAD#  SEQUENCE#
--------- ------------ ---------- ----------
RFS CLOSING 2      15484
RFS WRITING 1      22087


13 rows selected.


SQL> 

另一種情況,日誌傳輸之後MRP不應用,顯示一直在等待存在的日誌,可以重啟下MRP

SQL> alter database recover managed standby database cancel;


Database altered.


SQL> alter database recover managed standby database using current logfile disconnect from session;


Database altered.


SQL> select PROCESS,STATUS, THREAD#,SEQUENCE# from v$managed_standby;


PROCESS   STATUS THREAD#  SEQUENCE#
--------- ------------ ---------- ----------
ARCH CLOSING 27450
ARCH CLOSING 16856
ARCH CLOSING 27449
ARCH WRITING 27567
RFS RECEIVING17471
RFS WRITING 27568
RFS RECEIVING27495
RFS RECEIVING27497
RFS RECEIVING17470
RFS WRITING 17522
RFS WRITING 17472
MRP0 APPLYING_LOG27459
RFS RECEIVING27496


13 rows selected.


SQL>