如何在Oracle中释放flash_recovery_area(温柔的方法)

2024-01-07 05:58

本文主要是介绍如何在Oracle中释放flash_recovery_area(温柔的方法),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

案例: Oracle数据库10g中释放flash_recovery_area解决ORA-19815错误。

错误现象:备份Oracle数据库10g时出现下面的错误:

ORA-19815: WARNING: db_recovery_file_dest_size of 2147483648 bytes is 100.00% used, and has 0 remaining bytes available.

*************************************************************

You have the following choices to free up space from

flash recovery area:

1. Consider changing your RMAN retention policy.

If you are using dataguard, then consider changing your

RMAN archivelog deletion policy.

2. Backup files to tertiary device such as tape using the

RMAN command BACKUP RECOVERY AREA.

3. Add disk space and increase the db_recovery_file_dest_size

parameter to reflect the new space.

4. Delete unncessary files using the RMAN DELETE command.

If an OS command was used to delete files, then use

RMAN CROSSCHECK and DELETE EXPIRED commands.

*************************************************************

此时flash_recovery_area已经手工释放空间,即使切换到一个全新的磁盘也无法解决此问题。

继续连接数据库的查询:

$ sqlplus "/ as sysdba"

SQL*Plus: Release 10.1.0.2.0 - Production on Mon Mar 28 11:45:30 2005

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

Connected to:

Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production

With the Partitioning, OLAP and Data Mining options

SYS AS SYSDBA on 28-MAR-05 >set liesize 120

SP2-0158: unknown SET option "liesize"

SYS AS SYSDBA on 28-MAR-05 >set linesize 120

SYS AS SYSDBA on 28-MAR-05 >SELECT substr(name, 1, 30) name, space_limit AS quota,

2 space_used AS used,

3 space_reclaimable AS reclaimable,

4 number_of_files AS files

5 FROM v$recovery_file_dest ;

NAME QUOTA USED RECLAIMABLE FILES

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

/data5/flash_recovery_area 2147483648 2144863232 0 227

此时发现仍然记录了227个文件,USED空间仍然未被释放。

继续使用rman登录数据库来进行crosscheck:

$ rman target /

Recovery Manager: Release 10.1.0.2.0 - 64bit Production

Copyright (c) 1995, 2004, Oracle. All rights reserved.

connected to target database: EYGLE (DBID=1337390772)

RMAN> crosscheck archivelog all;

using target database controlfile instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=144 devtype=DISK

validation failed for archived log

archive log filename=/opt/oracle/flash_recovery_area/EYGLE/

archivelog/2004_05_17/o1_mf_1_790_0bjq36ps_.arc recid=1 stamp=526401126

validation failed for archived log

archive log filename=/opt/oracle/flash_recovery_area/EYGLE/

archivelog/2004_05_17/o1_mf_1_791_0bkbcy7x_.arc recid=2 stamp=526420862

validation failed for archived log

archive log filename=/opt/oracle/flash_recovery_area/EYGLE/

archivelog/2004_05_17/o1_mf_1_792_0bkkds4d_.arc recid=3 stamp=526428057

.......

archive log filename=/opt/oracle/flash_recovery_area/EYGLE/

archivelog/2004_07_16/o1_mf_1_1014_0hh3zsrp_.arc recid=225 stamp=531678074

validation failed for archived log

archive log filename=/opt/oracle/flash_recovery_area/EYGLE/

archivelog/2004_07_16/o1_mf_1_1015_0hh40qyp_.arc recid=226 stamp=531678104

validation failed for archived log

archive log filename=/opt/oracle/flash_recovery_area/EYGLE/

archivelog/2004_07_16/o1_mf_1_1016_0hh41jqq_.arc recid=227 stamp=531678129

Crosschecked 227 objects

RMAN> delete expired archivelog all;

released channel: ORA_DISK_1

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=144 devtype=DISK

List of Archived Log Copies

Key Thrd Seq S Low Time Name

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

1 1 790 X 17-MAY-04 /opt/oracle/flash_recovery_area/EYGLE/

archivelog/2004_05_17/o1_mf_1_790_0bjq36ps_.arc

2 1 791 X 17-MAY-04 /opt/oracle/flash_recovery_area/EYGLE/

archivelog/2004_05_17/o1_mf_1_791_0bkbcy7x_.arc

3 1 792 X 17-MAY-04 /opt/oracle/flash_recovery_area/EYGLE/

archivelog/2004_05_17/o1_mf_1_792_0bkkds4d_.arc

.......

225 1 1014 X 16-JUL-04 /opt/oracle/flash_recovery_area/EYGLE/

archivelog/2004_07_16/o1_mf_1_1014_0hh3zsrp_.arc

226 1 1015 X 16-JUL-04 /opt/oracle/flash_recovery_area/EYGLE/

archivelog/2004_07_16/o1_mf_1_1015_0hh40qyp_.arc

227 1 1016 X 16-JUL-04 /opt/oracle/flash_recovery_area/EYGLE/

archivelog/2004_07_16/o1_mf_1_1016_0hh41jqq_.arc

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

deleted archive log

archive log filename=/opt/oracle/flash_recovery_area/EYGLE/

archivelog/2004_05_17/o1_mf_1_790_0bjq36ps_.arc recid=1 stamp=526401126

deleted archive log

archive log filename=/opt/oracle/flash_recovery_area/EYGLE/

archivelog/2004_05_17/o1_mf_1_791_0bkbcy7x_.arc recid=2 stamp=526420862

deleted archive log

......

archive log filename=/opt/oracle/flash_recovery_area/EYGLE/

archivelog/2004_07_16/o1_mf_1_1014_0hh3zsrp_.arc recid=225 stamp=531678074

deleted archive log

archive log filename=/opt/oracle/flash_recovery_area/EYGLE/

archivelog/2004_07_16/o1_mf_1_1015_0hh40qyp_.arc recid=226 stamp=531678104

deleted archive log

archive log filename=/opt/oracle/flash_recovery_area/EYGLE/

archivelog/2004_07_16/o1_mf_1_1016_0hh41jqq_.arc recid=227 stamp=531678129

Deleted 227 EXPIRED objects

RMAN> exit

Recovery Manager complete.

此时空间得到释放:

$ sqlplus "/ as sysdba"

SQL*Plus: Release 10.1.0.2.0 - Production on Mon Mar 28 12:02:19 2005

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

Connected to:

Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production

With the Partitioning, OLAP and Data Mining options

SYS AS SYSDBA on 28-MAR-05 >SELECT substr(name, 1, 30) name, space_limit AS quota,

2 space_used AS used,

3 space_reclaimable AS reclaimable,

4 number_of_files AS files

5 FROM v$recovery_file_dest ;

NAME QUOTA USED RECLAIMABLE FILES

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

/data5/flash_recovery_area 2147483648 9959424 0 1

SYS AS SYSDBA on 28-MAR-05 >

解决方法:

可以通过执行如下命令:

RMAN> backup recovery area来解决此问题。

(注:将闪回区的内容备份到第三方介质,同样可以解决此问题)

这篇关于如何在Oracle中释放flash_recovery_area(温柔的方法)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/578922

相关文章

Java 中的 @SneakyThrows 注解使用方法(简化异常处理的利与弊)

《Java中的@SneakyThrows注解使用方法(简化异常处理的利与弊)》为了简化异常处理,Lombok提供了一个强大的注解@SneakyThrows,本文将详细介绍@SneakyThro... 目录1. @SneakyThrows 简介 1.1 什么是 Lombok?2. @SneakyThrows

判断PyTorch是GPU版还是CPU版的方法小结

《判断PyTorch是GPU版还是CPU版的方法小结》PyTorch作为当前最流行的深度学习框架之一,支持在CPU和GPU(NVIDIACUDA)上运行,所以对于深度学习开发者来说,正确识别PyTor... 目录前言为什么需要区分GPU和CPU版本?性能差异硬件要求如何检查PyTorch版本?方法1:使用命

Qt实现网络数据解析的方法总结

《Qt实现网络数据解析的方法总结》在Qt中解析网络数据通常涉及接收原始字节流,并将其转换为有意义的应用层数据,这篇文章为大家介绍了详细步骤和示例,感兴趣的小伙伴可以了解下... 目录1. 网络数据接收2. 缓冲区管理(处理粘包/拆包)3. 常见数据格式解析3.1 jsON解析3.2 XML解析3.3 自定义

SpringMVC 通过ajax 前后端数据交互的实现方法

《SpringMVC通过ajax前后端数据交互的实现方法》:本文主要介绍SpringMVC通过ajax前后端数据交互的实现方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价... 在前端的开发过程中,经常在html页面通过AJAX进行前后端数据的交互,SpringMVC的controll

Java中的工具类命名方法

《Java中的工具类命名方法》:本文主要介绍Java中的工具类究竟如何命名,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下吧... 目录Java中的工具类究竟如何命名?先来几个例子几种命名方式的比较到底如何命名 ?总结Java中的工具类究竟如何命名?先来几个例子JD

Spring Security自定义身份认证的实现方法

《SpringSecurity自定义身份认证的实现方法》:本文主要介绍SpringSecurity自定义身份认证的实现方法,下面对SpringSecurity的这三种自定义身份认证进行详细讲解,... 目录1.内存身份认证(1)创建配置类(2)验证内存身份认证2.JDBC身份认证(1)数据准备 (2)配置依

python获取网页表格的多种方法汇总

《python获取网页表格的多种方法汇总》我们在网页上看到很多的表格,如果要获取里面的数据或者转化成其他格式,就需要将表格获取下来并进行整理,在Python中,获取网页表格的方法有多种,下面就跟随小编... 目录1. 使用Pandas的read_html2. 使用BeautifulSoup和pandas3.

Spring 中的循环引用问题解决方法

《Spring中的循环引用问题解决方法》:本文主要介绍Spring中的循环引用问题解决方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下吧... 目录什么是循环引用?循环依赖三级缓存解决循环依赖二级缓存三级缓存本章来聊聊Spring 中的循环引用问题该如何解决。这里聊

Java学习手册之Filter和Listener使用方法

《Java学习手册之Filter和Listener使用方法》:本文主要介绍Java学习手册之Filter和Listener使用方法的相关资料,Filter是一种拦截器,可以在请求到达Servl... 目录一、Filter(过滤器)1. Filter 的工作原理2. Filter 的配置与使用二、Listen

Pandas统计每行数据中的空值的方法示例

《Pandas统计每行数据中的空值的方法示例》处理缺失数据(NaN值)是一个非常常见的问题,本文主要介绍了Pandas统计每行数据中的空值的方法示例,具有一定的参考价值,感兴趣的可以了解一下... 目录什么是空值?为什么要统计空值?准备工作创建示例数据统计每行空值数量进一步分析www.chinasem.cn处