ORA-00257:archiver error.Connect internal only,until freed.

本文讲述了在使用Navicat连接Oracle数据库时遇到的连接问题,主要原因是归档日志占用空间过大。文章提供了两种解决方案:一是扩展硬盘空间或清理旧日志;二是调整归档日志大小。同时介绍了如何通过SQL查询检查归档状态和闪回区设置,以及使用RMAN管理归档日志的删除操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

问题现象

使用navicat连接oracle时无法连接上去,提示这个错误

问题原因

归档日志占用空间满了,注意这里分为两个

  1. 硬盘空间不足了
  2. 硬盘空间足够但是归档日志空间不够了

解决方案

  1. 针对第一种情况,拓展本地硬盘空间,或删除之前日志
  2. 针对第二种情况,需要设置归档日志大小,或删除归档日志

连接到SQL查询归档状态

[root@localhost ~]# docker exec -it oracle11g bash
[oracle@82a1fe0258ea /]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Wed Apr 10 09:05:12 2024

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select flashback_on from v$database;

FLASHBACK_ON
------------------
NO

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     265
Next log sequence to archive   265
Current log sequence           268
SQL> show parameter recover;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      /home/oracle/app/oracle/flash_
                                                 recovery_area
db_recovery_file_dest_size           big integer 3882M
recovery_parallelism                 integer     0
SQL> alter system set db_recovery_file_dest_size=100G scope=both;

System altered.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

操作说明

1.查看归档路径
archive log list;
Arcive destination      USE_DB_RECOVERY_FILE_DEST
此参数代表归档存放路径,本地存放为/opt/oracle…,asm为+archdg
当为以上参数时,代表存放到数据闪回区

2.查看闪回区设置
show parameter recover;

db_recovery_file_dest  #表示存放路径
db_recovery_file_dest_size  #表示可以使用的空间大小


3.设置闪回区大小
alter system set db_recovery_file_dest_size=100G scope=both;


4.查看归档空间使用情况
select * from v$flash_recovery_area_usage;


查看闪回区是否开启

select flashback_on from v$database;

开启闪回
SQL>shutdown immediate;
SQL>startup mount;
SQL>alter database archivelog;
SQL> alter database flashback on;

关闭闪回
SQL>shutdown immediate;
SQL>startup mount;
SQL>alter database flashback off;

切换到rman删除归档日志

[oracle@82a1fe0258ea /]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Wed Apr 10 09:07:55 2024

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

connected to target database: HELOWIN (DBID=1384114315)

RMAN> list archivelog all;

using target database control file instead of recovery catalog
List of Archived Log Copies for database with db_unique_name HELOWIN
=====================================================================

Key     Thrd Seq     S Low Time 
------- ---- ------- - ---------
1       1    1       A 04-JAN-16

RMAN> crosscheck archivelog all;

allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=131 device type=DISK
validation succeeded for archived log
archived log file name=/home/oracle/app/oracle/flash_recovery_area/HELOWIN/archivelog/2024_04_07/o1_mf_1_1_m1467glz_.arc RECID=1 STAMP=1165665262


RMAN> delete archivelog all completed before 'sysdate-1'; 

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=131 device type=DISK
List of Archived Log Copies for database with db_unique_name HELOWIN
=====================================================================

Key     Thrd Seq     S Low Time 
------- ---- ------- - ---------
1       1    1       A 04-JAN-16
        Name: /home/oracle/app/oracle/flash_recovery_area/HELOWIN/archivelog/2024_04_07/o1_mf_1_1_m1467glz_.arc
Do you really want to delete the above objects (enter YES or NO)? yes
deleted archived log
archived log file name=/home/oracle/app/oracle/flash_recovery_area/HELOWIN/archivelog/2024_04_07/o1_mf_1_1_m1467glz_.arc RECID=1 STAMP=1165665262

Deleted 50 objects


RMAN> delete archivelog all completed before 'trunc(sysdate-1)+2/24';

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=131 device type=DISK

RMAN> list archivelog all;

List of Archived Log Copies for database with db_unique_name HELOWIN
=====================================================================

Key     Thrd Seq     S Low Time 
------- ---- ------- - ---------
51      1    51      A 09-APR-24
        Name: /home/oracle/app/oracle/flash_recovery_area/HELOWIN/archivelog/2024_04_09/o1_mf_1_51_m195pxfd_.arc

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

_三石_

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值