Solved

Delete archive logs from standby server and v$archived_log

Posted on 2002-03-07
4
5,223 Views
Last Modified: 2008-03-03
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?
Mike
0
Comment
Question by:mmoore
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 5

Expert Comment

by:kelfink
ID: 6847915
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.

0
 
LVL 3

Author Comment

by:mmoore
ID: 6847991
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?
Mike
0
 
LVL 5

Accepted Solution

by:
kelfink earned 200 total points
ID: 6848060
Yes, you should be able to manually delete those files.

Before that, though, read up on this doc:

http://technet.oracle.com/docs/products/oracle8i/doc_library/817_doc/server.817/a76990/troubler.htm#444834

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.

0
 
LVL 3

Author Comment

by:mmoore
ID: 6848589
I don't see how there solution ...
run {
     allocate channel t1 type 'sbt_tape';
     allocate channel t2 type 'sbt_tape';
     backup
       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:
log_archive_dest_2 = "SERVICE=DEAP_STANDBY MANDATORY"
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.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
constraint check 2 56
Oracle Verification of DataPump Export and Import 17 68
Oracle - Query link database loop 8 54
Need to Understand Resolution to Oracle Error ORA-00600 2 44
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question