1、19C ADG 搭建完成,考虑主备库的归档如果清理时间不同可能有问题,则在主备库设置了同样的时间和脚本进行清理;
2、备库在清理的时候日志提示如下,导致没有形成备库的清理日志备份
“RMAN> 2> 3> 4> 5> 6> 7> 8> 9>
using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=238 device type=DISK
allocated channel: c2
channel c2: SID=353 device type=DISK
Starting backup at 25-AUG-23
Oracle error from target database:
ORA-17629: Cannot connect to the remote database server
ORA-17627: ORA-00942: table or view does not exist
released channel: c1
released channel: c2
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 08/25/2023 10:10:19
RMAN-06822: backup not consistent because switching of archived log failed at the primary”
RMAN-06207: warning: 17 objects could not be deleted for DISK channel(s) due
RMAN-06208: to mismatched status. Use CROSSCHECK command to fix status
3、备份执行脚本如下:
#!/bin/bash
echo “----------------------------------------date
---------------------------------------”
source ~/.bash_profile
rman target / log /backup/easbak/dblogsbak/clear_archDG.log<<EOF
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
#sql ‘alter system archive log current’;
backup as compressed backupset tag=mwdb_bkDGLOG_level1 not backed up 1 times archivelog all delete input format ‘/backup/easbak/dblogsbak/mwdbArchDGLog_%d_%T_%s_%p.bak’ FILESPERSET 1000 MAXSETSIZE 500000M keep UNTIL TIME ‘sysdate+1’;
sql ‘alter system archive log current’;
release channel c1;
release channel c2;
}
run{
CROSSCHECK ARCHIVELOG ALL;
report obsolete;
delete noprompt obsolete;
DELETE NOPROMPT FORCE ARCHIVELOG UNTIL TIME ‘SYSDATE-1’;
sql ‘alter system archive log current’;
host ‘find /u01/oradb/flash_recovery_area/MWEASDB/archivelog/ -mtime +3 -type f -name “*.dbf” -exec rm -rf {} ;’;
host ‘find /u01/oradb/flash_recovery_area/MWEASDBDG/archivelog/ -mindepth 1 -ctime +2 -type d -exec rm -rf {} ;’;
host ‘find /u01/app/oracle/diag/tnslsnr/easdb-dg-s/listener/trace/ -ctime +2 -type f -exec rm -rf {} ;’;
host ‘find /u01/app/oracle/admin/MWEASDBDG/adump/ -ctime +20 -type f -exec rm -rf {} ;’;
}
exit;
EOF