Linux下Data Guard 無法應用歸檔日誌的處理過程

來源:互聯網
上載者:User

環境:
OS:Red Hat Linux As 5
DB:11.2.0.1

今天發現在主庫的表上寫入了資料,且做了日誌切換後探索資料沒有傳輸到備庫,查看備庫的alert報如下錯誤:

Datafiles are recovered to a consistent state at change 2610390 but controlfile is ahead at change 2610391.
Database remains open for continuous queries. Please continue recovery.
Errors in file /u01/app/Oracle/diag/rdbms/oraclbak/oraclbak/trace/oraclbak_mrp0_4332.trc:
ORA-01237: cannot extend datafile 4
ORA-01110: data file 4: '/u01/app/oracle/oradata/oracl/users01.dbf'
ORA-19502: write error on file "/u01/app/oracle/oradata/oracl/users01.dbf", block number 723584 (block size=8192)
ORA-27072: File I/O error
Linux Error: 25: Inappropriate ioctl for device
看到以上錯誤,應該是users資料表空間不足導致的,但users資料表空間的資料檔案是自動擴充的呀,資料檔案怎麼會報無法擴充呢,想了一會,在主庫和備庫使用df查看磁碟空間,探索資料檔案user01.dbf所在的目錄已經用滿,這個時候馬上清理該目錄下的檔案,騰出一些空間.過程處理如下.
 
1.查看主庫和備庫磁碟使用方式
[oracle@stdby oracl]$ df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda1              6146832   4321584   1507968  75% /
tmpfs                  2097152    400408   1696744  20% /dev/shm
/dev/sdb1             20635700  19525276     62188 100% /u01
/dev/sdc1              8254240   6356052   1478896  82% /u02

發現存放資料檔案的目錄/u01已經使用了100%.
 
2.在備庫上查看日誌使用方式
Select Sequence#, Name, Applied From V$archived_Log Order By Sequence#;
------------------------------------------------------------------------
SEQUENCE#   NAME                       APPLIED
9    /u02/archive_log/1_9_792174458.dbf YES
10 /u02/archive_log/1_10_792174458.dbf YES
11 /u02/archive_log/1_11_792174458.dbf YES
12 /u02/archive_log/1_12_792174458.dbf YES
13 /u02/archive_log/1_13_792174458.dbf YES
14 /u02/archive_log/1_14_792174458.dbf YES
15 /u02/archive_log/1_15_792174458.dbf YES
16 /u02/archive_log/1_16_792174458.dbf YES
17 /u02/archive_log/1_17_792174458.dbf YES
18 /u02/archive_log/1_18_792174458.dbf YES
19 /u02/archive_log/1_19_792174458.dbf YES
20 /u02/archive_log/1_20_792174458.dbf YES
21 /u02/archive_log/1_21_792174458.dbf YES
22 /u02/archive_log/1_22_792174458.dbf YES
23 /u02/archive_log/1_23_792174458.dbf YES
24 /u02/archive_log/1_24_792174458.dbf YES
25 /u02/archive_log/1_25_792174458.dbf YES
26 /u02/archive_log/1_26_792174458.dbf YES
27 /u02/archive_log/1_27_792174458.dbf YES
28 /u02/archive_log/1_28_792174458.dbf YES
29 /u02/archive_log/1_29_792174458.dbf YES
30 /u02/archive_log/1_30_792174458.dbf YES
31 /u02/archive_log/1_31_792174458.dbf YES
32 /u02/archive_log/1_32_792174458.dbf YES
33 /u02/archive_log/1_33_792174458.dbf YES
34 /u02/archive_log/1_34_792174458.dbf NO
35 /u02/archive_log/1_35_792174458.dbf NO

發現34和35沒有使用
 
3.主備庫騰出部分空間後,在備庫上使用如下命令應用日誌
recover managed standby database disconnect from session;
 
4.這個時候看到日誌應用的進程
select process,status,sequence# from v$managed_standby;
--------------------------------------------------
PROCESS   STATUS       SEQUENCE#
ARCH     CLOSING       34
ARCH     CLOSING       35
ARCH     CLOSING       31
ARCH     CONNECTED    0
MRP0     APPLYING_LOG 35
RFS       IDLE         0
RFS       IDLE         0
RFS       IDLE         36

5.重新查詢備庫日誌應用情況
Select Sequence#, Name, Applied
From V$archived_Log Order By Sequence#;
-----------------------------------------
SEQUENCE#   NAME                       APPLIED
9   /u02/archive_log/1_9_792174458.dbf YES
10 /u02/archive_log/1_10_792174458.dbf YES
11 /u02/archive_log/1_11_792174458.dbf YES
12 /u02/archive_log/1_12_792174458.dbf YES
13 /u02/archive_log/1_13_792174458.dbf YES
14 /u02/archive_log/1_14_792174458.dbf YES
15 /u02/archive_log/1_15_792174458.dbf YES
16 /u02/archive_log/1_16_792174458.dbf YES
17 /u02/archive_log/1_17_792174458.dbf YES
18 /u02/archive_log/1_18_792174458.dbf YES
19 /u02/archive_log/1_19_792174458.dbf YES
20 /u02/archive_log/1_20_792174458.dbf YES
21 /u02/archive_log/1_21_792174458.dbf YES
22 /u02/archive_log/1_22_792174458.dbf YES
23 /u02/archive_log/1_23_792174458.dbf YES
24 /u02/archive_log/1_24_792174458.dbf YES
25 /u02/archive_log/1_25_792174458.dbf YES
26 /u02/archive_log/1_26_792174458.dbf YES
27 /u02/archive_log/1_27_792174458.dbf YES
28 /u02/archive_log/1_28_792174458.dbf YES
29 /u02/archive_log/1_29_792174458.dbf YES
30 /u02/archive_log/1_30_792174458.dbf YES
31 /u02/archive_log/1_31_792174458.dbf YES
32 /u02/archive_log/1_32_792174458.dbf YES
33 /u02/archive_log/1_33_792174458.dbf YES
34 /u02/archive_log/1_34_792174458.dbf YES
35 /u02/archive_log/1_35_792174458.dbf YES
 
這個時候34,35都已經應用了,應用程式層的資料,主庫和備庫已經保持一致了.

-- The End --

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.