In this article, we are going to learn, why we need to run crosscheck archivelog all commands. You must read this article carefully and follow all steps.
Why we run crosscheck archivelog all?
Rman utility is a very powerful utility that is used for creating Oracle Database backup. The crosscheck command only verifies the existence of archive files on disk. Suppose after creating a database backup user manually removes the archives from the physical disk.
Space is released immediately on the disk but these archive files entry still remains in the RMAN repository. Now if the user tries to create a new database backup using the rman utility it will show the archive-related error.
So, if you run the crosscheck archivelog all command before taking the rman backup it removes the entry of those files which is not available on disk.
Check archivelog
For example, if we check archive logs on their physical location, we get this type of record list as shown below screenshot.
Archives list which is available on the location
Remove archives from physical location
Here I'm going to show you if we remove archives from their physical location, then how to react RMAN.
$ rm arch1_2*
I removed archives, now check rman reaction on it:
RMAN> list expired archivelog all;
See in the above screenshot, rman still doesn't have deleted archives information in the repository.
Run crosscheck archivelog all
Now, run crosscheck archivelog all commands on RMAN prompt, then check the expired archivelog again.
RMAN> crosscheck archivelog all;
allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=76 device type=DISK validation succeeded for archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_5_1086532269.dbf RECID=3 STAMP=1090866038 validation succeeded for archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_6_1086532269.dbf RECID=4 STAMP=1090866038 validation succeeded for archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_7_1086532269.dbf RECID=5 STAMP=1090886899 validation succeeded for archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_8_1086532269.dbf RECID=6 STAMP=1090941949 validation succeeded for archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_9_1086532269.dbf RECID=7 STAMP=1090941949 validation succeeded for archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_10_1086532269.dbf RECID=8 STAMP=1091664227 validation succeeded for archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_11_1086532269.dbf RECID=9 STAMP=1091689489 validation succeeded for archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_12_1086532269.dbf RECID=10 STAMP=1092290421 validation succeeded for archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_13_1086532269.dbf RECID=11 STAMP=1092315643 validation succeeded for archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_14_1086532269.dbf RECID=12 STAMP=1094387912 validation succeeded for archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_15_1086532269.dbf RECID=13 STAMP=1094603459 validation succeeded for archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_16_1086532269.dbf RECID=14 STAMP=1095767844 validation succeeded for archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_17_1086532269.dbf RECID=15 STAMP=1095767845 validation succeeded for archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_18_1086532269.dbf RECID=16 STAMP=1095767847 validation succeeded for archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_19_1086532269.dbf RECID=17 STAMP=1095767848 validation failed for archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_20_1086532269.dbf RECID=18 STAMP=1095767850 validation failed for archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_21_1086532269.dbf RECID=19 STAMP=1095767850 validation failed for archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_22_1086532269.dbf RECID=20 STAMP=1095767851 validation failed for archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_23_1086532269.dbf RECID=21 STAMP=1095767854 validation failed for archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_24_1086532269.dbf RECID=22 STAMP=1095767855 validation failed for archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_25_1086532269.dbf RECID=23 STAMP=1095767857 validation failed for archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_26_1086532269.dbf RECID=24 STAMP=1095767857 validation failed for archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_27_1086532269.dbf RECID=25 STAMP=1095767860 validation failed for archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_28_1086532269.dbf RECID=26 STAMP=1095767861 validation succeeded for archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_29_1086532269.dbf RECID=27 STAMP=1095769970 validation succeeded for archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_30_1086532269.dbf RECID=28 STAMP=1095769970 validation succeeded for archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_31_1086532269.dbf RECID=29 STAMP=1095769971 validation succeeded for archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_32_1086532269.dbf RECID=30 STAMP=1095769972 Crosschecked 28 objects
Clearly, you can see in the above output the status of those archives which we removed from their physical location showing "validation failed for archived log".
Let's check archivelog status again.
RMAN> list expired archivelog all;
This time you can see, it's showing those archives list which we removed.
How to delete expired archivelog?
Before taking database backup using RMAN, you must be clear deleted archivelog from the rman repository using the below command.
RMAN>delete expired archivelog all;
Output:
released channel: ORA_DISK_1 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=76 device type=DISK List of Archived Log Copies for database with db_unique_name DIGITAL ===================================================================== Key Thrd Seq S Low Time ------- ---- ------- - --------- 18 1 20 X 04-FEB-22 Name: /u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_20_1086532269.dbf 19 1 21 X 04-FEB-22 Name: /u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_21_1086532269.dbf 20 1 22 X 04-FEB-22 Name: /u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_22_1086532269.dbf 21 1 23 X 04-FEB-22 Name: /u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_23_1086532269.dbf 22 1 24 X 04-FEB-22 Name: /u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_24_1086532269.dbf 23 1 25 X 04-FEB-22 Name: /u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_25_1086532269.dbf 24 1 26 X 04-FEB-22 Name: /u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_26_1086532269.dbf 25 1 27 X 04-FEB-22 Name: /u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_27_1086532269.dbf 26 1 28 X 04-FEB-22 Name: /u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_28_1086532269.dbf Do you really want to delete the above objects (enter YES or NO)? YES deleted archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_20_1086532269.dbf RECID=18 STAMP=1095767850 deleted archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_21_1086532269.dbf RECID=19 STAMP=1095767850 deleted archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_22_1086532269.dbf RECID=20 STAMP=1095767851 deleted archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_23_1086532269.dbf RECID=21 STAMP=1095767854 deleted archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_24_1086532269.dbf RECID=22 STAMP=1095767855 deleted archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_25_1086532269.dbf RECID=23 STAMP=1095767857 deleted archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_26_1086532269.dbf RECID=24 STAMP=1095767857 deleted archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_27_1086532269.dbf RECID=25 STAMP=1095767860 deleted archived log archived log file name=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch1_28_1086532269.dbf RECID=26 STAMP=1095767861 Deleted 9 EXPIRED objects
Now error removed:
Subscribe on YouTube
Today we facing the ORA-19913 unable to decrypt backup error...
Read Moredata guard configuration steps in oracle 11gr2 Oracle 11g R2...
Read MoreThe error ORA-00054 occurs if DDL or DML currently running...
One thought on “crosscheck archivelog all”