【故障處理】ORA-19809錯誤處理

【故障處理】ORA-19809錯誤處理sql

一.1  BLOG文檔結構圖

 

wps441C.tmp 

 

一.2  前言部分

一.2.1  導讀和注意事項

各位技術愛好者,看完本文後,你能夠掌握以下的技能,也能夠學到一些其它你所不知道的知識,~O(∩_∩)O~數據庫

① ORA-19809: limit exceeded for recovery files錯誤的處理方法瀏覽器

RMAN-03009: failure of backup command on ORA_DISK_1 channel at 07/26/2016 17:35:35微信

ORA-19809: limit exceeded for recovery filesoracle

ORA-19804: cannot reclaim 68157440 bytes disk space from 4385144832 limitide

② 閃回恢復區佔用大小的查詢svg

  Tips: 學習

① 本文在ITpubhttp://blog.itpub.net/26736162)、博客園(http://www.cnblogs.com/lhrbest)和微信公衆號(xiaomaimiaolhr)有同步更新字體

② 文章中用到的全部代碼,相關軟件,相關資料請前往小麥苗的雲盤下載(http://blog.itpub.net/26736162/viewspace-1624453/ui

若文章代碼格式有錯亂,推薦使用搜狗360QQ瀏覽器,也能夠下載pdf格式的文檔來查看,pdf文檔下載地址:http://blog.itpub.net/26736162/viewspace-1624453/

本篇BLOG中命令的輸出部分須要特別關注的地方我都用灰色背景和粉紅色字體來表示,好比下邊的例子中,thread 1的最大歸檔日誌號爲33thread 2的最大歸檔日誌號爲43是須要特別關注的地方;而命令通常使用黃色背景和紅色字體注;對代碼或代碼輸出部分的注釋通常採用藍色字體表示

  List of Archived Logs in backup set 11

  Thrd Seq     Low SCN    Low Time            Next SCN   Next Time

  ---- ------- ---------- ------------------- ---------- ---------

  1    32      1621589    2015-05-29 11:09:52 1625242    2015-05-29 11:15:48

  1    33      1625242    2015-05-29 11:15:48 1625293    2015-05-29 11:15:58

  2    42      1613951    2015-05-29 10:41:18 1625245    2015-05-29 11:15:49

  2    43      1625245    2015-05-29 11:15:49 1625253    2015-05-29 11:15:53

 

[ZHLHRDB1:root]:/>lsvg -o

T_XDESK_APP1_vg

rootvg

[ZHLHRDB1:root]:/>

00:27:22 SQL> alter tablespace idxtbs read write;

 

====》2097152*512/1024/1024/1024=1G 

 

本文若有錯誤或不完善的地方請你們多多指正,ITPUB留言或QQ皆可,您的批評指正是我寫做的最大動力。

 

 

一.3  故障分析及解決過程

 

一.3.1  故障環境介紹

 

項目

source db

db 類型

RAC

db version

11.2.0.4

db 存儲

ASM

OS版本及kernel版本

AIX 64位 6.1.0.0

 

一.3.2  故障發生現象及報錯信息

rman執行0級全備的時候報錯:

[ZFXDESKDB2:root]:/>su - oracle

[ZFXDESKDB2:oracle]:/oracle>ORACLE_SID=raclhr2

[ZFXDESKDB2:oracle]:/oracle>rman target /

 

Recovery Manager: Release 11.2.0.4.0 - Production on Tue Jul 26 17:35:15 2016

 

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

 

connected to target database: RACLHR (DBID=4156381309)

 

RMAN>  backup incremental level 0 database;

 

Starting backup at 2016-07-26 17:35:19

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=70 instance=raclhr2 device type=DISK

channel ORA_DISK_1: starting incremental level 0 datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00002 name=+DATA/raclhr/datafile/sysaux.365.916601225

input datafile file number=00001 name=+DATA/raclhr/datafile/system.359.916601225

input datafile file number=00005 name=+DATA/raclhr/datafile/example.351.916601377

input datafile file number=00003 name=+DATA/raclhr/datafile/undotbs1.364.916601225

input datafile file number=00006 name=+DATA/raclhr/datafile/undotbs2.343.916601713

input datafile file number=00004 name=+DATA/raclhr/datafile/users.363.916601225

input datafile file number=00007 name=+DATA/raclhr/datafile/rsa_cm_data.519.917516173

input datafile file number=00008 name=+DATA/raclhr/datafile/rsa_cm_data.520.917516173

input datafile file number=00009 name=+DATA/raclhr/datafile/rsa_cm_data.521.917516173

input datafile file number=00010 name=+DATA/raclhr/datafile/ts_lhr.522.917516295

input datafile file number=00011 name=+DATA/raclhr/datafile/ts_lhr.523.917516295

input datafile file number=00012 name=+DATA/raclhr/datafile/ts_lhr.524.917516295

input datafile file number=00013 name=+DATA/raclhr/datafile/test.525.917516413

input datafile file number=00014 name=+DATA/raclhr/datafile/test.526.917516413

input datafile file number=00015 name=+DATA/raclhr/datafile/test.527.917516413

channel ORA_DISK_1: starting piece 1 at 2016-07-26 17:35:20

RMAN-03009: failure of backup command on ORA_DISK_1 channel at 07/26/2016 17:35:35

ORA-19809: limit exceeded for recovery files

ORA-19804: cannot reclaim 68157440 bytes disk space from 4385144832 limit

continuing other job steps, job failed will not be re-run

channel ORA_DISK_1: starting incremental level 0 datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

including current control file in backup set

including current SPFILE in backup set

channel ORA_DISK_1: starting piece 1 at 2016-07-26 17:35:37

channel ORA_DISK_1: finished piece 1 at 2016-07-26 17:35:38

piece handle=+DATA/raclhr/backupset/2016_07_26/ncsnn0_tag20160726t173520_0.568.918236137 tag=TAG20160726T173520 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

 

RMAN-03009: failure of backup command on ORA_DISK_1 channel at 07/26/2016 17:35:35

ORA-19809: limit exceeded for recovery files

ORA-19804: cannot reclaim 68157440 bytes disk space from 4385144832 limit

 

一.3.3  故障分析及解決過程

看着這個錯誤聽陌生的,以前沒有遇到過,oerr看一下解釋:

[ZFXDESKDB2:oracle]:/oracle>oerr rman 3009

3009, 1, "failure of %s command on %s channel at %s"

// *Cause:  This message should be accompanied by other error message(s)

//          indicating the cause of the error.

// *Action: Check the accompanying errors.

[ZFXDESKDB2:oracle]:/oracle>oerr ora 19809

19809, 00000, "limit exceeded for recovery files"

//*Cause: The limit for recovery files specified by the

//        DB_RECOVERY_FILE_DEST_SIZE was exceeded.

// *Action: There are five possible solutions:

//          1) Take frequent backup of recovery area using RMAN.

//          2) Consider changing RMAN retention policy.

//          3) Consider changing RMAN archived log deletion policy.

//          4) Add disk space and increase DB_RECOVERY_FILE_DEST_SIZE.

//          5) Delete files from recovery area using RMAN.

[ZFXDESKDB2:oracle]:/oracle>oerr ora 19804

19804, 00000, "cannot reclaim %s bytes disk space from %s limit"

// *Cause: Oracle cannot reclaim disk space of specified bytes from the

//         DB_RECOVERY_FILE_DEST_SIZE limit.

// *Action: There are five possible solutions:

//          1) Take frequent backup of recovery area using RMAN.

//          2) Consider changing RMAN retention policy.

//          3) Consider changing RMAN archived log deletion policy.

//          4) Add disk space and increase DB_RECOVERY_FILE_DEST_SIZE.

//          5) Delete files from recovery area using RMAN.

 

oerr的解釋能夠看出該錯誤是因爲閃回恢復區大小參數DB_RECOVERY_FILE_DEST設置太小致使的,下邊咱們來修復該錯誤:

[ZFXDESKDB2:oracle]:/oracle>ORACLE_SID=raclhr2

[ZFXDESKDB2:oracle]:/oracle>sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.4.0 Production on Mon Aug 1 15:38:13 2016

 

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

 

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

Data Mining and Real Application Testing options

 

SYS@raclhr2> show parameter DB_RECOVERY_FILE_DEST_SIZE

 

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

db_recovery_file_dest_size           big integer 4182M

SYS@raclhr2> alter system set db_recovery_file_dest_size=10G sid='*';     

 

System altered.

 

SYS@raclhr2> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

Data Mining and Real Application Testing options

[ZFXDESKDB2:oracle]:/oracle>rman target /

 

Recovery Manager: Release 11.2.0.4.0 - Production on Mon Aug 1 15:46:58 2016

 

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

 

connected to target database: RACLHR (DBID=4156381309)

 

RMAN> backup incremental level 0 database;

 

Starting backup at 2016-08-01 15:47:10

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=67 instance=raclhr2 device type=DISK

channel ORA_DISK_1: starting incremental level 0 datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00002 name=+DATA/raclhr/datafile/sysaux.365.916601225

input datafile file number=00001 name=+DATA/raclhr/datafile/system.359.916601225

input datafile file number=00005 name=+DATA/raclhr/datafile/example.351.916601377

input datafile file number=00003 name=+DATA/raclhr/datafile/undotbs1.364.916601225

input datafile file number=00006 name=+DATA/raclhr/datafile/undotbs2.343.916601713

input datafile file number=00004 name=+DATA/raclhr/datafile/users.363.916601225

input datafile file number=00007 name=+DATA/raclhr/datafile/rsa_cm_data.519.917516173

input datafile file number=00008 name=+DATA/raclhr/datafile/rsa_cm_data.520.917516173

input datafile file number=00009 name=+DATA/raclhr/datafile/rsa_cm_data.521.917516173

input datafile file number=00010 name=+DATA/raclhr/datafile/ts_lhr.522.917516295

input datafile file number=00011 name=+DATA/raclhr/datafile/ts_lhr.523.917516295

input datafile file number=00012 name=+DATA/raclhr/datafile/ts_lhr.524.917516295

input datafile file number=00013 name=+DATA/raclhr/datafile/test.525.917516413

input datafile file number=00014 name=+DATA/raclhr/datafile/test.526.917516413

input datafile file number=00015 name=+DATA/raclhr/datafile/test.527.917516413

channel ORA_DISK_1: starting piece 1 at 2016-08-01 15:47:12

channel ORA_DISK_1: finished piece 1 at 2016-08-01 15:47:57

piece handle=+DATA/raclhr/backupset/2016_08_01/nnndn0_tag20160801t154711_0.597.918748035 tag=TAG20160801T154711 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45

channel ORA_DISK_1: starting incremental level 0 datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

including current control file in backup set

including current SPFILE in backup set

channel ORA_DISK_1: starting piece 1 at 2016-08-01 15:47:59

channel ORA_DISK_1: finished piece 1 at 2016-08-01 15:48:00

piece handle=+DATA/raclhr/backupset/2016_08_01/ncsnn0_tag20160801t154711_0.598.918748079 tag=TAG20160801T154711 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

Finished backup at 2016-08-01 15:48:00

 

RMAN> list backupset summary;

 

 

List of Backups

===============

Key     TY LV S Device Type Completion Time     #Pieces #Copies Compressed Tag

------- -- -- - ----------- ------------------- ------- ------- ---------- ---

1       B  0  A DISK        2016-07-26 17:35:37 1       1       NO         TAG20160726T173520

2       B  0  A DISK        2016-08-01 15:47:51 1       1       NO         TAG20160801T154711

3       B  0  A DISK        2016-08-01 15:47:59 1       1       NO         TAG20160801T154711

 

一.4  故障處理總結

ORA-19809: limit exceeded for recovery files

ORA-19804: cannot reclaim 68157440 bytes disk space from 4385144832 limit

ORA-19809錯誤是因爲閃回恢復區設置太小致使,只須要修改參數db_recovery_file_dest_size設置爲更大的值便可解決問題,要想更深刻分析該問題就得分析閃回恢復區裏存放了哪些內容。

一.5  如何查看閃回恢復區大小的佔用狀況

wps442D.tmp

咱們從健康檢查的腳本能夠看出:

wps442E.tmp 

點擊鏈接能夠跳轉到相應的部分:

數據庫閃回空間使用狀況

 


數據庫閃回空間整體使用狀況

 

 

 

NAME

LIMIT

USED_GB

USED%

RECLAIM

NUMBER_OF_FILES

+DATA

10G

5.953G

59.531%

4.154G

144

[回到目錄]


數據庫閃回空間詳細使用狀況

 

 

FILE_TYPE

USED_GB

PERCENT_SPACE_USED

PERCENT_SPACE_RECLAIMABLE

RECLAIM_GB

NUMBER_OF_FILES

ARCHIVED LOG

4.185

41.85

41.46

4.146

138

BACKUP PIECE

1.619

16.19

.08

.008

3

CONTROL FILE

0

0

0

0

0

FLASHBACK LOG

0

0

0

0

0

FOREIGN ARCHIVED LOG

0

0

0

0

0

IMAGE COPY

0

0

0

0

0

REDO LOG

.149

1.49

0

0

3

Total:

5.953

59.53

41.54

4.154

144

[回到目錄]

能夠看出,閃回空間目前是10G,使用了將近60%,共144個文件,每種文件的佔用狀況參考如上的表格,能夠看出主要是歸檔文件和備份集佔用空間比較大。

有關健康檢查報告中的用到的腳本以下:

閃回恢復區總大小:

SELECT NAME,                   

       round(space_limit / 1024 / 1024 / 1024, 3) "LIMIT_GB",                  

       round(space_used / 1024 / 1024 / 1024, 3) "USED_GB",                  

       round(space_used / space_limit * 100, 3) "USED%",                   

       round(space_reclaimable / 1024 / 1024 / 1024, 3) "RECLAIM_GB",                  

       number_of_files                

FROM   v$recovery_file_dest v

WHERE v.SPACE_LIMIT<>0;

閃回恢復區詳細使用大小:

SELECT nvl(frau.file_type,'<font color="#990000"><b>Total:</b></font>') file_type,

       sum(round(frau.percent_space_used / 100 * rfd.space_limit / 1024 / 1024 / 1024,3)) USED_GB,

       sum(frau.percent_space_used) percent_space_used,

       sum(frau.percent_space_reclaimable) percent_space_reclaimable,

       sum(round(frau.percent_space_reclaimable / 100 * rfd.space_limit / 1024 / 1024 / 1024,3)) RECLAIM_GB,

       sum(frau.number_of_files) number_of_files

FROM   v$flash_recovery_area_usage frau,

       v$recovery_file_dest        rfd

GROUP  BY ROLLUP(file_type)

;

一.6  用到的SQL集合

0級全備:backup incremental level 0 database;

oerr查看錯誤:oerr rman 3009  oerr ora 19809

設置閃回恢復區的大小:alter system set db_recovery_file_dest_size=10G sid='*';

------閃回恢復區總大小:

SELECT NAME,                   

       round(space_limit / 1024 / 1024 / 1024, 3) "LIMIT_GB",                  

       round(space_used / 1024 / 1024 / 1024, 3) "USED_GB",                  

       round(space_used / space_limit * 100, 3) "USED%",                   

       round(space_reclaimable / 1024 / 1024 / 1024, 3) "RECLAIM_GB",                  

       number_of_files                

FROM   v$recovery_file_dest v

WHERE v.SPACE_LIMIT<>0;

-----閃回恢復區詳細使用大小:

SELECT nvl(frau.file_type,'<font color="#990000"><b>Total:</b></font>') file_type,

       sum(round(frau.percent_space_used / 100 * rfd.space_limit / 1024 / 1024 / 1024,3)) USED_GB,

       sum(frau.percent_space_used) percent_space_used,

       sum(frau.percent_space_reclaimable) percent_space_reclaimable,

       sum(round(frau.percent_space_reclaimable / 100 * rfd.space_limit / 1024 / 1024 / 1024,3)) RECLAIM_GB,

       sum(frau.number_of_files) number_of_files

FROM   v$flash_recovery_area_usage frau,

       v$recovery_file_dest        rfd

GROUP  BY ROLLUP(file_type)

;

 

  About Me

..........................................................................................................................................................................................................                        

v 本文做者:小麥苗,只專一於數據庫的技術,更注重技術的運用

v 本文在ITpub(http://blog.itpub.net/26736162)、博客園(http://www.cnblogs.com/lhrbest)和我的微信公衆號(xiaomaimiaolhr)上有同步更新

v QQ羣:230161599 微信羣:私聊

v 本文地址:http://blog.itpub.net/26736162/viewspace-2122820/

v 本文pdf版:http://yunpan.cn/cdEQedhCs2kFz (提取碼:ed9b)

v 小麥苗分享的其它資料:http://blog.itpub.net/26736162/viewspace-1624453/

v 聯繫我請加QQ好友(642808185),註明添加原因

v 2016-08-01 15:00~ 2016-08-01 19:00 在中行完成

v 【版權全部,文章容許轉載,但須以連接方式註明源地址,不然追究法律責任】

..........................................................................................................................................................................................................

長按識別二維碼或微信客戶端掃描下邊的二維碼來關注小麥苗的微信公衆號:xiaomaimiaolhr,學習最實用的數據庫技術。

wps443F.tmp

相關文章
相關標籤/搜索