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

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ORA-00257: archiver error. Connect internal only, until freed相关的知识,希望对你有一定的参考价值。

问题描述:

  在新建的Oracle数据库中,开启了归档模式,由于目前根据实际的业务需求,需要将部分数据从原有数据库(源头数据库)迁移到新建的数据库(目标数据库),在迁移过程中使用了数据泵IMPDP远程导入,第二天使用PL/SQL登录目标数据库时,弹出提示框提示【ORA-00257: archiver error. Connect internal only, until freed】,经过搜索发现该问题是由于归档日志写满,需要删除归档日志。

  当导入的数据量过大时,比如我此次导入的一张数据表大小约为25G,插入记录要几千万条记录,由于目标数据库开启了归档模式,对于每一个插入操作搜会记录到归档日志当中去,而且除了我使用IMPDP进行远程导入外,还有正常的ETL工具不间断的进行数据插入更新等DML操作,因此归档日志很快写满。当处于归档模式,并且归档日志写满后,那我的IMPDP操作会BLOCK,当正常清空归档日志后,IMPDP导入会再次进行。

解决过程:

1.远程登录Linux服务器,并切换进入Oracle用户

Xshell for Xmanager Enterprise 5 (Build 0517)
Copyright (c) 2002-2014 NetSarang Computer, Inc. All rights reserved.

Type `help to learn how to use Xshell prompt.
[c:\\~]$ ssh *.*.*.*

Connecting to *.*.*.*:22...
Connection established.
To escape to local shell, press Ctrl+Alt+].

Last login: Thu Dec 22 15:37:49 2016 from *.*.*.*
[[email protected] ~]# su - oracle 
Last login: Thu Dec 22 15:38:44 CST 2016 on pts/1
cqjwya-> pwd
/home/oracle

2.采用rman方式清除归档日志
2.1进入rman

cqjwya-> rman target /;
#回复管理器: Release 11.2.0.4.0 - Production on Thu Dec 22 15:45:58 2016
Recovery Manager: Release 11.2.0.4.0 - Production on Thu Dec 22 15:45:58 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
#连接到目标数据库: CQJWY (DBID=146406491)
connected to target database: CQJWY (DBID=146406491)

2.2检验archivelog的可用性

RMAN>crosscheck archivelog all;

2.3列出所有已经失效的归档日志

RMAN>list expired archivelog all; 

2.4删除过期日志(在本操作中可以有下列返回信息获知当前没有过期archivelog存在)

RMAN> delete expired archivelog all;
#释放的通道:
released channel: ORA_DISK_1
#分配的通道:
allocated channel: ORA_DISK_1
#通道 ORA_DISK_1: SID=2689 实例名=cqjwy1 设备类型=DISK
channel ORA_DISK_1: SID=2689 instance=cqjwy1 device type=DISK
#说明与档案资料库中的任何归档日志均未匹配到
specification does not match any archived log in the repository

2.5删除archivelog
2.5.1删除archivelog的集中方式
可以基于不同的条件来删除archivelog,如基于SCN,基于SEQUENCE以及基于TIME等方式。并且以上方式还可以通过配合UNTIL,FROM,BETWEEN......AND等子句限定删除范围。
2.5.2举例
#删除log sequence为16以及19之前的所有归档日志

RMAN> delete archivelog until sequence 16;

#删除系统时间7天之前的归档日志,但是不会删除闪回区有效的归档日志

RMAN> delete archivelog all completed before sysdate-7;

#删除系统时间1天以内到现在的归档日志

RMAN> delete archivelog from time sysdate-7;

#删除所有的日志

RMAN> delete noprompt archivelog all completed before sysdate;

RMAN> delete noprompt archivelog all;

2.5.3在本次操作中,基于TIME方式,配合UNTIL,指定某一时间,将该时间之前的archivelog删除

RMAN> delete archivelog until time "to_date(‘2016-12-22 15:55:00‘,‘YYYY-MM-DD HH24:MI:SS‘)";
#释放的通道: ORA_DISK_1
released channel: ORA_DISK_1
#分配的通道: ORA_DISK_1
allocated channel: ORA_DISK_1
#通道 ORA_DISK_1: SID=2689 实例名=cqjwy1 设备类型=DISK
channel ORA_DISK_1: SID=2689 instance=cqjwy1 device type=DISK
#截取读取archivelog部分记录
List of Archived Log Copies
Key        Thrd     Seq     S     Low Time                 Name
1341741   2        646086  A     2016/12/22 15:54:53        Name: +JWYARC/cqjwy/archivelog/2016_12_22/thread_2_seq_646086.140257.931276495
1341742   2        646087  A     2016/12/22 15:54:54        Name: +JWYARC/cqjwy/archivelog/2016_12_22/thread_2_seq_646087.64599.931276497
1341744   2        646088  A     2016/12/22 15:54:56        Name: +JWYARC/cqjwy/archivelog/2016_12_22/thread_2_seq_646088.105749.931276499
1341745   2        646089  A     2016/12/22 15:54:57        Name: +JWYARC/cqjwy/archivelog/2016_12_22/thread_2_seq_646089.78909.931276499
1341746   2        646090  A     2016/12/22 15:54:59        Name: +JWYARC/cqjwy/archivelog/2016_12_22/thread_2_seq_646090.27026.931276501
1341748   2        646091  A     2016/12/22 15:55:00        Name: +JWYARC/cqjwy/archivelog/2016_12_22/thread_2_seq_646091.96197.931276503
#你真的想要删除这些记录吗(输入YES或者NO)        
Do you really want to delete the above objects (enter YES or NO)? YES
#截取删除archivelog部分记录
deleted archived log
archived log file name=+JWYARC/cqjwy/archivelog/2016_12_22/thread_1_seq_686519.64540.931252625 RECID=1318627 STAMP=931252625
deleted archived log
archived log file name=+JWYARC/cqjwy/archivelog/2016_12_22/thread_1_seq_686520.62350.931252627 RECID=1318628 STAMP=931252627
deleted archived log
archived log file name=+JWYARC/cqjwy/archivelog/2016_12_22/thread_1_seq_686521.59664.931252629 RECID=1318630 STAMP=931252629
deleted archived log 

2.6删除完毕后,再次检验archivelog的可用性

RMAN>crosscheck archivelog all;

参考文章:

【参考1:http://www.2cto.com/database/201109/104615.html

【参考2:http://www.cnblogs.com/lanzi/archive/2013/09/04/3301729.html

【参考3:http://www.cnblogs.com/xwdreamer/p/3804509.html

【参考4:http://www.linuxidc.com/Linux/2013-07/87298.htm

以上是关于ORA-00257: archiver error. Connect internal only, until freed的主要内容,如果未能解决你的问题,请参考以下文章

ORA-00257:archiver error. 错误的处理方法

ORA-00257 archiver error. 错误的处理方法

ORA-00257: archiver error. Connect internal only, until freed 错误的处理方法

ORACLE 11G DB RAC ORA-00257archiver error解决办法

ORA-00257: archiver error. Connect internal only, until freed 错误的处理方法

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