如何在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

相关文章

Linux换行符的使用方法详解

《Linux换行符的使用方法详解》本文介绍了Linux中常用的换行符LF及其在文件中的表示,展示了如何使用sed命令替换换行符,并列举了与换行符处理相关的Linux命令,通过代码讲解的非常详细,需要的... 目录简介检测文件中的换行符使用 cat -A 查看换行符使用 od -c 检查字符换行符格式转换将

SpringBoot实现数据库读写分离的3种方法小结

《SpringBoot实现数据库读写分离的3种方法小结》为了提高系统的读写性能和可用性,读写分离是一种经典的数据库架构模式,在SpringBoot应用中,有多种方式可以实现数据库读写分离,本文将介绍三... 目录一、数据库读写分离概述二、方案一:基于AbstractRoutingDataSource实现动态

Java中的String.valueOf()和toString()方法区别小结

《Java中的String.valueOf()和toString()方法区别小结》字符串操作是开发者日常编程任务中不可或缺的一部分,转换为字符串是一种常见需求,其中最常见的就是String.value... 目录String.valueOf()方法方法定义方法实现使用示例使用场景toString()方法方法

Java中List的contains()方法的使用小结

《Java中List的contains()方法的使用小结》List的contains()方法用于检查列表中是否包含指定的元素,借助equals()方法进行判断,下面就来介绍Java中List的c... 目录详细展开1. 方法签名2. 工作原理3. 使用示例4. 注意事项总结结论:List 的 contain

macOS无效Launchpad图标轻松删除的4 种实用方法

《macOS无效Launchpad图标轻松删除的4种实用方法》mac中不在appstore上下载的应用经常在删除后它的图标还残留在launchpad中,并且长按图标也不会出现删除符号,下面解决这个问... 在 MACOS 上,Launchpad(也就是「启动台」)是一个便捷的 App 启动工具。但有时候,应

SpringBoot日志配置SLF4J和Logback的方法实现

《SpringBoot日志配置SLF4J和Logback的方法实现》日志记录是不可或缺的一部分,本文主要介绍了SpringBoot日志配置SLF4J和Logback的方法实现,文中通过示例代码介绍的非... 目录一、前言二、案例一:初识日志三、案例二:使用Lombok输出日志四、案例三:配置Logback一

Python实现无痛修改第三方库源码的方法详解

《Python实现无痛修改第三方库源码的方法详解》很多时候,我们下载的第三方库是不会有需求不满足的情况,但也有极少的情况,第三方库没有兼顾到需求,本文将介绍几个修改源码的操作,大家可以根据需求进行选择... 目录需求不符合模拟示例 1. 修改源文件2. 继承修改3. 猴子补丁4. 追踪局部变量需求不符合很

mysql出现ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost‘ (10061)的解决方法

《mysql出现ERROR2003(HY000):Can‘tconnecttoMySQLserveron‘localhost‘(10061)的解决方法》本文主要介绍了mysql出现... 目录前言:第一步:第二步:第三步:总结:前言:当你想通过命令窗口想打开mysql时候发现提http://www.cpp

Mysql删除几亿条数据表中的部分数据的方法实现

《Mysql删除几亿条数据表中的部分数据的方法实现》在MySQL中删除一个大表中的数据时,需要特别注意操作的性能和对系统的影响,本文主要介绍了Mysql删除几亿条数据表中的部分数据的方法实现,具有一定... 目录1、需求2、方案1. 使用 DELETE 语句分批删除2. 使用 INPLACE ALTER T

MySQL INSERT语句实现当记录不存在时插入的几种方法

《MySQLINSERT语句实现当记录不存在时插入的几种方法》MySQL的INSERT语句是用于向数据库表中插入新记录的关键命令,下面:本文主要介绍MySQLINSERT语句实现当记录不存在时... 目录使用 INSERT IGNORE使用 ON DUPLICATE KEY UPDATE使用 REPLACE