共计 5208 个字符,预计需要花费 14 分钟才能阅读完成。
这篇文章给大家分享的是有关 Oracle 中闪回区存储空间报 ORA-19815 问题怎么办的内容。丸趣 TV 小编觉得挺实用的,因此分享给大家做个参考,一起跟随丸趣 TV 小编过来看看吧。
查询 Oracle 的 alert 日志是发现 ORA-19815 告警日志,具体现象如下:
【现象】
ORA-19815: WARNING: db_recovery_file_dest_size of 214748364800 bytes is 85.22% used, and has 31746169856 remaining bytes available
【分析处理思路】
1、查询相关参数和视图
(1)查询 db_recovery_file_dest_size 和 db_recovery_file_dest 参数闪回区存储空间确定位置和大小。
(2)查询 v$recovery_file_dest 视图确定 db_recovery_file_dest_size 的使用情况。
(3)查询 v$flash_recovery_area_usage 视图确定那种文件占用空间。
2、解决方法主要考虑以下三个方面:
(1)如果 db_recovery_file_dest_size 较小,修改 db_recovery_file_dest_size 为更大的值。
(2)如果 db_recovery_file_dest 指定的目录空间不足,解决办法:
A、可另指定空间,将源 db_recovery_file_dest 中的文件拷贝到该空间下;
B、为该目录新增磁盘空间;
C、将该目录空间中的文件备份到其他目录,并进行压缩。
(3)通过 RMAN 删除已经失效的文件。
【实际操作】
1、查看 db_recovery_file 相关参数
SQL show parameter db_recovery
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string /home/erp_db_rec/db_recovery_d
est
db_recovery_file_dest_size big integer 200G
[oraprod@erpdb erp_db_rec]$ pwd
/home/erp_db_rec
[oraprod@erpdb erp_db_rec]$ du -sh db_recovery_dest/
17G db_recovery_dest/
根据参数可以判断 db_recovery_file_dest 指定的目录足够大。
2、查看 recovery file 的使用率
SQL set linesize 2000
SQL col name form a40
SQL col SPACE_LIMIT form 99999999999999
SQL col SPACE_USED form 99999999999999
SQL col NUMBER_OF_FILES form 9999
SQL select rfd.NAME,rfd.SPACE_LIMIT,rfd.SPACE_USED,rfd.SPACE_USED/rfd.SPACE_LIMIT*100 as Rate(%) ,rfd.NUMBER_OF_FILES from v$recovery_file_dest rfd;
NAME SPACE_LIMIT SPACE_USED Rate(%) NUMBER_OF_FILES
---------------------------------------- --------------- --------------- ---------- ---------------
/home/erp_db_rec/db_recovery_dest 214748364800 183002194944 85.2170377 736
查询发现已经使用了 85.21% 了。
3、查询是哪类文件占用空间
SQL select file_type,
percent_space_used as used,
percent_space_reclaimable as reclaimable,
number_of_files as number
from v$flash_recovery_area_usage;
FILE_TYPE USED RECLAIMABLE number
----------------------- ---------- ----------- ----------
CONTROL FILE 0 0 0
REDO LOG 0 0 0
ARCHIVED LOG 0 0 0
BACKUP PIECE 85.22 0 736
IMAGE COPY 0 0 0
FLASHBACK LOG 0 0 0
FOREIGN ARCHIVED LOG 0 0 0
AUXILIARY DATAFILE COPY 0 0 0
8 rows selected.
通过查询可知是 BACKUP PIECE 使用了 recovery_file_dest 统计的空间。
由上述查询可知:对 db_recovery_file_dest 和备份空间中的文件定期进行删除,但是在数据库层面为进行清理,导致 v$recovery_file_dest 视图将已删除的文件统计在内导致,判断通过 RMAN 删除无效的备份集可解决。
4、解决此问题的方法
(1) 对 backupset 进行交叉检查。
RMAN crosscheck backupset;
using channel ORA_DISK_1
crosschecked backup piece: found to be EXPIRED
backup piece handle=/home/erp_db_rec/db_recovery_dest/PROD/backupset/2017_11_07/o1_mf_annnn_TAG20171107T230006_f03lmq9w_.bkp RECID=1405 STAMP=959468407
crosschecked backup piece: found to be EXPIRED
......
......
backup piece handle=/home/erp_db_rec/db_recovery_dest/PROD/backupset/2017_11_09/o1_mf_annnn_TAG20171109T230007_f08vcrc8_.bkp RECID=1420 STAMP=959641208
crosschecked backup piece: found to be EXPIRED
backup piece handle=/home/erp_db_rec/db_recovery_dest/PROD/backupset/2017_11_09/o1_mf_annnn_TAG20171109T230007_f08vcrf1_.bkp RECID=1421 STAMP=959641208
crosschecked backup piece: found to be EXPIRED
backup piece handle=/home/erp_db_rec/db_recovery_dest/PROD/backupset/2017_11_09/o1_mf_annnn_TAG20171109T230007_f08vcrhd_.bkp RECID=1422 STAMP=959641208
crosschecked backup piece: found to be EXPIRED
backup piece handle=/home/erp_db_rec/db_recovery_dest/PROD/backupset/2017_11_09/o1_mf_annnn_TAG20171109T230932_f08vxdxq_.bkp RECID=1426 STAMP=959641772
.......
backup piece handle=/home/erp_db_rec/db_recovery_dest/PROD/backupset/2018_03_22/o1_mf_annnn_TAG20180322T231231_fc7kz019_.bkp RECID=2963 STAMP=971478752
crosschecked backup piece: found to be AVAILABLE
backup piece handle=/home/erp_db_rec/db_recovery_dest/PROD/autobackup/2018_03_22/o1_mf_s_971478753_fc7kz217_.bkp RECID=2964 STAMP=971478754
Crosschecked 1510 objects
(2)删除无效的备份集
RMAN delete noprompt expired backupset;
using channel ORA_DISK_1
......
backup piece handle=/backup/rman_backup/20180219/level1backup/PROD_2218_1_5asrlg89.20180219 RECID=2573 STAMP=968540425
deleted backup piece
backup piece handle=/backup/rman_backup/20180219/level1backup/PROD_2217_1_59srlg89.20180219 RECID=2574 STAMP=968540425
deleted backup piece
backup piece handle=/backup/rman_backup/20180219/level1backup/PROD_2219_1_5bsrlg89.20180219 RECID=2575 STAMP=968540426
Deleted 1125 EXPIRED objects
(3)使用 v$recovery_file_dest 验证使用率
SQL select rfd.NAME,rfd.SPACE_LIMIT,rfd.SPACE_USED,rfd.SPACE_USED/rfd.SPACE_LIMIT*100 as Rate(%) ,rfd.NUMBER_OF_FILES from v$recovery_file_dest rfd;
NAME SPACE_LIMIT SPACE_USED Rate(%) NUMBER_OF_FILES
---------------------------------------- --------------- --------------- ---------- ---------------
/home/erp_db_rec/db_recovery_dest 214748364800 18025081856 8.39358282 162
删除无效的备份集后,空间使用率变成 8.39%。
(4)查询 BACKUP PIECE 的使用情况
SQL select file_type,
2 percent_space_used as used,
3 percent_space_reclaimable as reclaimable,
4 number_of_files as number
5 from v$flash_recovery_area_usage;
FILE_TYPE USED RECLAIMABLE number
----------------------- ---------- ----------- ----------
CONTROL FILE 0 0 0
REDO LOG 0 0 0
ARCHIVED LOG 0 0 0
BACKUP PIECE 8.39 0 162
IMAGE COPY 0 0 0
FLASHBACK LOG 0 0 0
FOREIGN ARCHIVED LOG 0 0 0
AUXILIARY DATAFILE COPY0 0 0
8 rows selected.
完整解决 ORA-19815 问题。
感谢各位的阅读!关于“Oracle 中闪回区存储空间报 ORA-19815 问题怎么办”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!