DG修复:清理归档配置归档清理脚本
阅读原文时间:2023年07月15日阅读:1

问题描述:DG同步断了十天,发现FRA归档盘符满了。需要清理下,重新增量恢复DG

Error 12528 received logging on to the standby
FAL[client, ARC1]: Error 12528 connecting to racdb for fetching gap sequence
Unable to create archive log file '+FRA'
ARC4: Error 19504 Creating archive log file to '+FRA'
Using STANDBY_ARCHIVE_DEST parameter default value as ?/dbs/arch
Unable to create archive log file '+FRA'
ARC2: Error 19504 Creating archive log file to '+FRA'
ARC0: Archiving not possible: error count exceeded
ARC3: Archiving not possible: error count exceeded
ARC1: Archiving not possible: error count exceeded
ARCH: Archival stopped, error occurred. Will continue retrying
ORACLE Instance racdg1 - Archival Error
ORA-16038: log 9 sequence# 1326058 cannot be archived
ORA-19504: failed to create file ""
ORA-00312: online log 9 thread 2: '+DATA/racdg/standbylog/std_redo09.log'
ARCH: Archival stopped, error occurred. Will continue retrying
ORACLE Instance racdg1 - Archival Error
ORA-16014: log 8 sequence# 1326059 not archived, no available destinations
ORA-00312: online log 8 thread 2: '+DATA/racdg/standbylog/std_redo08.log'
Archiver process freed from errors. No longer stopped
Sun Jan 16 16:04:30 2022
RFS[1]: Assigned to RFS process 25642
RFS[1]: No standby redo logfiles available for thread 1
Sun Jan 16 16:05:02 2022
Decreasing number of real time LMS from 3 to 0
Sun Jan 16 16:05:05 2022
RFS[2]: Assigned to RFS process 25950
RFS[2]: No standby redo logfiles available for thread 2
Sun Jan 16 16:07:14 2022
ALTER DATABASE RECOVER managed standby database using current logfile disconnect from session

ASMCMD> lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 5242880 1371450 0 1371450 0 N DATA/
MOUNTED EXTERN N 512 4096 1048576 1572864 0 0 0 0 N FRA/
MOUNTED EXTERN N 512 4096 4194304 6144 5696 0 5696 0 Y OCRDG/

ASMCMD> du 2021_12_03
Used_MB Mirror_used_MB
1278 1278
ASMCMD>
ASMCMD> ls
2021_12_03/
2021_12_04/
2021_12_05/
2021_12_06/
2021_12_07/
2021_12_09/
2021_12_10/
2021_12_11/
2021_12_12/
2021_12_13/
2021_12_14/
2021_12_15/
2021_12_16/
2021_12_17/
2021_12_18/
2021_12_19/
2021_12_20/
2021_12_21/
2021_12_22/
2021_12_23/
2021_12_24/
2021_12_25/
2021_12_26/
2021_12_27/
2021_12_28/
2021_12_29/
2021_12_30/
2021_12_31/
2022_01_01/
2022_01_02/
2022_01_03/
2022_01_04/
2022_01_05/
ASMCMD> du 2021_12_04
Used_MB Mirror_used_MB
41926 41926
ASMCMD>
ASMCMD>
ASMCMD> du 2021_12_05
Used_MB Mirror_used_MB
285342 285342

ASMCMD> rm -rf 2021_12_06
ASMCMD> rm -rf 2021_12_07
ASMCMD> rm -rf 2021_12_09
ASMCMD> rm -rf 2021_12_10

重新增量恢复DG

配置归档清理脚本,每天零点执行一次脚本

vi del_arch.sh
#!/bin/bash
source ~/.bash_profile
rman target / <<EOF
crosscheck archivelog all;
delete noprompt expired archivelog all;
delete noprompt archivelog all completed before 'sysdate-15';
EOF
echo -e "\n"

crontab -e
0 0 * * * /home/oracle/del_arc.sh

手机扫一扫

移动阅读更方便

阿里云服务器
腾讯云服务器
七牛云服务器

你可能感兴趣的文章