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

问题现象

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

问题原因

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

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

解决方案

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

连接到SQL查询归档状态

shell 复制代码
[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删除归档日志

shell 复制代码
[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
相关推荐
开开心心就好1 小时前
高效报价软件,简化商铺定价流程
服务器·数据库·安全·面试·职场和发展·电脑·symfony
钢铁男儿2 小时前
PyQt5高级界而控件(容器:装载更多的控件QDockWidget)
数据库·python·qt
阿蒙Amon5 小时前
C# Linq to SQL:数据库编程的解决方案
数据库·c#·linq
互联网搬砖老肖9 小时前
运维打铁: MongoDB 数据库集群搭建与管理
运维·数据库·mongodb
典学长编程9 小时前
数据库Oracle从入门到精通!第四天(并发、锁、视图)
数据库·oracle
积跬步,慕至千里10 小时前
clickhouse数据库表和doris数据库表迁移starrocks数据库时建表注意事项总结
数据库·clickhouse
极限实验室11 小时前
搭建持久化的 INFINI Console 与 Easysearch 容器环境
数据库
白仑色11 小时前
Oracle PL/SQL 编程基础详解(从块结构到游标操作)
数据库·oracle·数据库开发·存储过程·plsql编程
程序猿小D12 小时前
[附源码+数据库+毕业论文]基于Spring+MyBatis+MySQL+Maven+jsp实现的个人财务管理系统,推荐!
java·数据库·mysql·spring·毕业论文·ssm框架·个人财务管理系统
钢铁男儿13 小时前
C# 接口(什么是接口)
java·数据库·c#