Solved

Delete archive logs from standby server and v$archived_log

Posted on 2002-03-07
4
5,082 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
  • 2
  • 2
4 Comments
 
LVL 5

Expert Comment

by:kelfink
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Sql to get orphans 7 50
Cannot open form error 6 47
report returning null 21 49
Oracle - Stored Procedure Privilge access 3 22
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now