===============
General===============
After running RMAN, archive files are not deleted
rman target /
RMAN> LIST EXPIRED ARCHIVELOG ALL; specification does not match any archived log in the recovery catalog
After running RMAN, archive files are not deleted
In RMAN log, there is an error:
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 11/14/2022 15:00:44
RMAN-06059: expected archived log not found, loss of archived log compromises recoverability
ORA-19625: error identifying file /oracle_db/db1/db_igt/arch/arch0001_2710_1084024359.arc
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7
===============
General===============
The solution would be to :
rman target /
rman target /
crosscheck archivelog all;
delete expired archivelog all;
===============
Example===============
rman target /
RMAN> LIST EXPIRED ARCHIVELOG ALL; specification does not match any archived log in the recovery catalog
RMAN> LIST ARCHIVELOG ALL;
A list of archive several days old is listed.
Now run RMAN backup
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 09/11/2017 17:12:54
RMAN-06059: expected archived log not found, lost of archived log compromises recoverability
ORA-19625: error identifying file /oracle_db/db2/db_igt/arch/arch0001_100463_669127092.arc
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
This was because some arch files were already deleted.
CROSSCHECK ARCHIVELOG ALL;
archived log file name=/oracle_db/db2/db_igt/arch/arch0001_101016_669127092.arc RECID=101005 STAMP=954426612
validation succeeded for archived log
archived log file name=/oracle_db/db2/db_igt/arch/arch0001_101017_669127092.arc RECID=101006 STAMP=954428414
validation succeeded for archived log
archived log file name=/oracle_db/db2/db_igt/arch/arch0001_101018_669127092.arc RECID=101007 STAMP=954430213
validation succeeded for archived log
archived log file name=/oracle_db/db2/db_igt/arch/arch0001_101019_669127092.arc RECID=101008 STAMP=954432013
validation succeeded for archived log
archived log file name=/oracle_db/db2/db_igt/arch/arch0001_101020_669127092.arc RECID=101009 STAMP=954433815
validation succeeded for archived log
archived log file name=/oracle_db/db2/db_igt/arch/arch0001_101021_669127092.arc RECID=101010 STAMP=954435614
validation succeeded for archived log
archived log file name=/oracle_db/db2/db_igt/arch/arch0001_101022_669127092.arc RECID=101011 STAMP=954436373
Crosschecked 560 objects
LIST EXPIRED ARCHIVELOG ALL;
Now many files are listed
100806 1 100817 X 07-SEP-17
Name: /oracle_db/db2/db_igt/arch/arch0001_100817_669127092.arc
100807 1 100818 X 07-SEP-17
Name: /oracle_db/db2/db_igt/arch/arch0001_100818_669127092.arc
100808 1 100819 X 07-SEP-17
Name: /oracle_db/db2/db_igt/arch/arch0001_100819_669127092.arc
100809 1 100820 X 07-SEP-17
Name: /oracle_db/db2/db_igt/arch/arch0001_100820_669127092.arc
DELETE EXPIRED ARCHIVELOG ALL;
Many files are deleted, some are kept
archived log file name=/oracle_db/db2/db_igt/arch/arch0001_100816_669127092.arc thread=1 sequence=100816
RMAN-08137: WARNING: archived log not deleted as it is still needed
archived log file name=/oracle_db/db2/db_igt/arch/arch0001_100817_669127092.arc thread=1 sequence=100817
RMAN-08137: WARNING: archived log not deleted as it is still needed
archived log file name=/oracle_db/db2/db_igt/arch/arch0001_100818_669127092.arc thread=1 sequence=100818
RMAN-08137: WARNING: archived log not deleted as it is still needed
archived log file name=/oracle_db/db2/db_igt/arch/arch0001_100819_669127092.arc thread=1 sequence=100819
RMAN-08137: WARNING: archived log not deleted as it is still needed
archived log file name=/oracle_db/db2/db_igt/arch/arch0001_100820_669127092.arc thread=1 sequence=100820
Now run RMAN backup again
./rman target / log=/backup/ora_online/logs/$1_backup_$DATE.log << EOF
sql 'alter system archive log current';
run {
allocate channel C1 type disk;
allocate channel C2 type disk;
backup AS COMPRESSED BACKUPSET tag whole_database_open format '/backup/ora_online/$1/$1_$DATE/db_%T_%t_s%s_p%p.bak' (DATABASE);
BACKUP format '/backup/ora_online/$1/$1_$DATE/AR_%d_%s_%p.bak' TAG 'Arch_backup' ARCHIVELOG ALL NOT BACKED UP DELETE ALL INPUT;
#BACKUP format '/backup/ora_online/$1/$1_$DATE/AR_%d_%s_%p.bak' TAG 'Arch_backup' ARCHIVELOG ALL;
backup current controlfile format '/backup/ora_online/$1/$1_$DATE/cntc_%T_%t_s%s_p%p';
release channel C1;
release channel C2;
}
crosscheck archivelog all;
crosscheck backup;
delete noprompt obsolete;
EOF
or
run {
configure controlfile autobackup on;
configure backup optimization on;
set controlfile autobackup format for device type disk to '/backup/ora_online/20170911_1718/%F';
allocate channel 'dev_0' type disk format = '/backup/ora_online/20170911_1718/dbf_%d_%T_%U';
backup full database;
backup archivelog from time = "TO_DATE('2017:09:11:17:18','YYYY:MM:DD:HH24:MI')-20" format '/backup/ora_online/20170911_1718/arch_%d_%T_%U';
release channel 'dev_0';
}
No comments:
Post a Comment