欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

解决ECOLOG E9大版本升级归档日志ORA-00257错误导致升级卡住

程序员文章站 2022-06-02 16:44:27
...

OAE8升级到E9在SQL文件执行到20%时卡住,由于有2万个SQL文件,先访问数据库检查一下执行情况,结果报错
ERROR:
ORA-00257: archiver error. Connect internal only, until freed.
Warning: You are no longer connected to ORACLE.
不能访问数据库,
产生原因:出现ORA-00257错误是由于归档日志太多,超过了归档日志空间。

解决办法:
1,检查flash recovery area的使用情况,可以看见archivelog已经很大了,达到99.88

SQL> select * from V$FLASH_RECOVERY_AREA_USAGE;
FILE_TYPE	     PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE
-------------------- ------------------ -------------------------
NUMBER_OF_FILES
---------------
ARCHIVED LOG			  99.88 			0
	    111

3,清理一下archivelog归档日志
使用oracle用户登录服务器,进入RMAN维护:
先检查日志文件情况

RMAN> crosscheck archivelog all;

删除截止到前一天的所有archivelog

RMAN> delete archivelog until time 'sysdate-1' ;
archived log file name=/app/oracle/oradate/recovery/ECOLOGY/archivelog/2021_05_11/o1_mf_1_109_j9nf0tdj_.arc RECID=29075 STAMP=1072280218
deleted archived log
archived log file name=/app/oracle/oradate/recovery/ECOLOGY/archivelog/2021_05_11/o1_mf_1_110_j9nf0x55_.arc RECID=29076 STAMP=1072280221
deleted archived log
archived log file name=/app/oracle/oradate/recovery/ECOLOGY/archivelog/2021_05_11/o1_mf_1_111_j9nf1037_.arc RECID=29077 STAMP=1072280224
Deleted 3115 objects

4、检查清理效果,再次查询flash recovery area的使用情况:

SQL> select * from V$FLASH_RECOVERY_AREA_USAGE;

FILE_TYPE	     PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE
-------------------- ------------------ -------------------------
NUMBER_OF_FILES
---------------
ARCHIVED LOG			   5.46 			0
	      6

只使用5.46%,说明清除归档日志成功!
5、此时升级可以正常继续进行。

由于还要升级1.5小时,收工回家,第二天看结果。
6、升级到30%又卡住。由于有2万个日志文件升级,不可能频繁清空日志。
检查一下日志空间配置,

SQL> show parameter recover
NAME				     TYPE	 VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest		     string	 /app/oracle/oradate/recovery
db_recovery_file_dest_size	     big integer 5000M
db_unrecoverable_scn_tracking	     boolean	 TRUE
recovery_parallelism		     integer	 0

只分配了5G空间。
7、修改日志空间为20G

SQL> alter system set db_recovery_file_dest_size=20G scope=both;
SQL>  show parameter recover

NAME				     TYPE	 VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest		     string	 /app/oracle/oradate/recovery
db_recovery_file_dest_size	     big integer 20G
db_unrecoverable_scn_tracking	     boolean	 TRUE
recovery_parallelism		     integer	 0

重新升级正常了。

相关标签: ORACEL ECOLOGY