Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to standardize and clean up v$archived_log records in Oracle

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

How to standardize and clean up v$archived_log records in Oracle

There are a lot of v$archived_log on the stand-alone instance, with tens of thousands of records, so you have to clean it up, otherwise every query will be scrolled directly.

SQL > select sequence#,applied from v$archived_log order by sequence#; SEQUENCE# APPLIED. SEQUENCE# APPLIED--9376 NO 9377 NO 9377 NO 9378 NO 9378 NO 9379 NO 9379 NO 9380 NO 9380 NO 9381 NO 9381 NO SEQUENCE# APPLIED--9382 NO 9382 NO11200 rows selected.SQL >

Then check the current archive record

SQL > archive log list;Database log mode Archive ModeAutomatic archival EnabledArchive destination USE_DB_RECOVERY_FILE_DESTOldest online log sequence 164Next log sequence to archive 166Current log sequence 166SQL >

See that the archived record is 164. it does not match the number of records on W in v$archived_log. This is because it is a record left over from rman backup and recovery, so it needs to be cleaned up.

Clean up records, using sys.dbms_backup_restore.resetCfileSection (11); clean up:

SQL > execute sys.dbms_backup_restore.resetCfileSection (11); PL/SQL procedure successfully completed.SQL > select sequence#,applied from v$archived_log order by sequence#; no rows selectedSQL >

Test again, you can see that the log record has changed, v$archived_log is up to date, and only one record number exists:

SQL > alter system switch logfile;System altered.SQL > select sequence#,applied from v$archived_log order by sequence#; SEQUENCE# APPLIED--166NOSQL > execute sys.dbms_backup_restore.resetCfileSection (11); PL/SQL procedure successfully completed.SQL > select sequence#,applied from v$archived_log order by sequence#; no rows selectedSQL >

Expand the topic, stand-alone instances can be used, the method of operation, then Oracle clusters such as dg, analysis master library, standby library

# v$archived_log records on master library: SQL > select count (1) from vested archived records log; COUNT (1)-623616SQL > # v$archived_log table records on standby library: SQL > select count (1) from archived records log; COUNT (1)-2226823SQL >

Thank you for reading, hope to help you, thank you for your support to this site!

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report