• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5524
  • Last Modified:

Delete archive logs from standby server and v$archived_log

What steps do I need to take to delete archive logs from a standby server. I think that I cannot just delete the archive log files because that will leave entries in the v$archived_log table.
 Also, on the PRIMARY database enteries remain in the v$archived_log table for both the primary archive and the secondary archive log destinations. The "DELETED" column from the V$ARCHIVED_LOG table shows "YES" for those archive logs going to the primary destination because I use RMAN to back up this database with the "delete input" option which deletes the archive logs once they are backed up. The secondaries shows a "DELETED" value of "NO". So what is supposed to happen here. Is the V$ARCHIVED_LOG table just supposed to grow forever? There must be some way to clean up, but how?
  • 2
  • 2
1 Solution
The parameter CONTROL_FILE_RECORD_KEEP_TIME in your init.ora file controls the number of days records stay in the history.

After this many days, the records get removed (or overwritten) so you shouldn't see this grow all that much.

mmooreAuthor Commented:
So, on the standby server, do you think it would be okay if I just deleted the physical archive logs once they had been applied? It sounds, from what you are telling me, that I could write a script to read the filenames out of v$archived_log and they physically delete those files off the disk. V$ARCHIVEED_LOG will clean itself based on CONTROL_FILE_RECORD_KEEP_TIME ... right?
Yes, you should be able to manually delete those files.

Before that, though, read up on this doc:


I think your scenario matches the "RMAN Fails to Delete All Archived Logs" section there.  If so, this will be a much more controlled way to get rid of the unnecessary files.

mmooreAuthor Commented:
I don't see how there solution ...
run {
     allocate channel t1 type 'sbt_tape';
     allocate channel t2 type 'sbt_tape';
       archivelog like '/oracle/arch/dest1/%' channel t1 delete input
       archivelog like '/oracle/arch/dest2/%' channel t2 delete input;

... could work when the second archive is defined as:
In other words, the second destination is defined
as a SERVICE, and not a LOCATION. I suspect that RMAN is not going to reach out to the remoted standby machine and physically delete the archives! After all, how would RMAN know if the remote archive had even been applied?
thanks for your help, further comments are most welcome.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now