In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Today, my colleague asked a question that his 11g database could not delete old archives using RMAN, resulting in high disk utilization. To log in to ip, it is true that the oldest archive log is from May 16.
Oracle@ps251n2s: [/ opt/oracle/archive/db] ls-ltr | moretotal 3059881082 moretotal 3059881082 oracle oinstall 725320704 May 20 2016 1mm 91233774.oracle oinstall 1756937216 Jun 7 1 oracle oinstall 1756937216 Jun 7 1 oracle oinstall 1756731392 Jun 21 2016 1 oracle oinstall 1756731392 Jun 21 _ 91233774.dbfkashi Jul-1 oracle oinstall 1756729344 Jul 15 2016 11951 91233774.dbfkashi RWMULI-1 oracle oinstall 1765750784 Jul 26 22:00 116091233774.dbfKuk RWLY RWRW RWRAULY-1 oracle oinstall 1760346112 Aug 6 14:04 1_7_91233774.dbf.
Using RMAN list archivelog all; to view the log does not show the records of the old archive log
RMAN > list archivelog all Using target database control file instead of recovery catalogList of Archived Log Copies for database with db_unique_name DBS====Key Thrd Seq S Low Time-1206 1 1206 A 14-JAN-17 Name: / opt/oracle/archive/db/1_1206_91233774.dbf1207 1 1207 A 14-JAN-17 Name: / opt/oracle/archive / db/1_1207_91233774.dbf1208 1 1208 A 14-JAN-17 Name: / opt/oracle/archive/db/1_1208_91233774.dbf.
No old archive log records were found using crosscheck check.
RMAN > crosscheck archivelog all Using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: SID=16 device type=DISKvalidation succeeded for archived logarchived log file name=/opt/oracle/archive/db/1_1206_91233774.dbf RECID=1206 STAMP=933244655validation succeeded for archived logarchived log file name=/opt/oracle/archive/db/1_1207_91233774.dbf RECID=1207 STAMP=933249510validation succeeded for archived logarchived log file name=/opt/oracle/archive/db/1_1208_91233774.dbf RECID=1208 STAMP=933254500validation succeeded for archived logarchived log file name=/opt/oracle/archive/db/1_1209_91233774.dbf RECID=1209 STAMP=933259445validation succeeded for archived log
View the v$archived_log view and there are no old archive log records
So Baidu found an article http://3y.uu456.com/bp_3i90z4529l10ttd0odyk_1.html which basically means that MAN deletes archive logs based on the archive logs recorded in controlfile, not the actual archive logs on your disk.
If your archive log is no longer in controlfile, it cannot be recognized by RMAN and cannot be deleted. When the archived information is overwritten in the control file is controlled by a parameter control_file_record_keep_time.
Check that the parameters in the database are 7 days by default
SYS@db > show parameter CONTROL_FILE_RECORD_KEEP_TIMENAME TYPE VALUE -- control_file_record_keep_time integer 7
Is it possible that the number of entries archived in the control file can only be retained for 7 days? So go to MOS to find relevant documents and find a Why Are Controlfile Entries For Archived Logs Not Overwritten After CONTROL_FILE_RECORD_KEEP_TIME? (document ID 1056085.1), the CONTROL_FILE_RECORD_KEEP_TIME parameter is not forced to keep the archive log entry in the control file for how many days, but is controlled by the ARCHIVED LOG entry in the V$CONTROLFILE_RECORD_SECTION view. When RECORDS_TOTAL=RECORDS_USED, the old archive log will be overwritten.
So looking at the V$CONTROLFILE_RECORD_SECTION view in the database, you can see that the records_total=224 of the ARCHIVED LOG line means that only 224 pieces of archive log file information can be retained in the control file.
SYS@dbs > select * from v$controlfile_record_section where type='ARCHIVED LOG' TYPE RECORD_SIZE RECORDS_TOTAL RECORDS_USED FIRST_INDEX LAST_INDEX LAST_RECID -- ARCHIVED LOG 584224 224 88 87 1235
Query v$archived_log views with a total of 224 entries
SYS@dbs > select count (*) from vested archived log; COUNT (*)-224
At this point, it should be inferred that because only 224 pieces of archive log data can be retained in the control file, the previous archive information has been brushed out by the control file, and RMAN cannot recognize these archive files, so these archive logs cannot be deleted.
What if you use RMAN to delete these old archive logs now? I want to use the catalog start with command to re-register these files into the control file
RMAN > catalog start with'/ opt/oracle/archive/db';.File Name: / opt/oracle/archive/db/1_1005_91233774.dbfFile Name: / opt/oracle/archive/db/1_1006_91233774.dbfFile Name: / opt/oracle/archive/db/1_1007_91233774.dbfDo you really want to catalog the above files (enter YES or NO)? Yescataloging files...cataloging done.RMAN > list archivelog all;.1236 1 301 A 22-OCT-16 Name: / opt/oracle/archive/db/1_301_91233774.dbf1237 1 302 A 22-OCT-16 Name: / opt/oracle/archive/db/1_302_91233774.dbf.
The old archive log file has been registered in the control file, and then delete it using RMAN
Delete archivelog until logseq 1007
Query the v$controlfile_record_section view again, and records_total has also been "stretched".
SYS@db > select * from v$controlfile_record_section where type='ARCHIVED LOG' TYPE RECORD_SIZE RECORDS_TOTAL RECORDS_USED FIRST_INDEX LAST_INDEX LAST_RECID -- ARCHIVED LOG 584,896 742 807 652 1800
This is the end of the question.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.