If you are not using RMAN, the best, safest, and most portable approach whether deleting archived redo log files on UNIX, VMS, or Windows is the technique of "SQL-generating-OScmd". Query the V$ARCHIVED_LOG view to retrieve the file's NAME where COMPLETION_TIME < whatever-you-want and ARCHIVED='Y'. The query should be written to spool the OS-specific "remove" command along with the file-name, and the spool output can be run as a ".bat" script in Windows, a shell script in UNIX, or DCL script in OpenVMS.
However, the most portable and sanest route is to use RMAN for backups and deletion of archived redo log files (and datafiles, of course), as all of RMAN's actions are recorded and are viewable through V$ARCHIVED_LOG and other views. RMAN not only handles archived redo log files according to the rules you specify, it can backup the log files multiple times before deleting them, keeping track of everything. If you have a bad tape, look for the archived redo log file on an older tape. RMAN also validates the redo log files during the backup to verify that it is not corrupted, an invaluable service. Yes, RMAN is tough to set up, but it's very name indicates it's focus. It's not called "backup manager" or BMAN for a reason. Being able to issue only two commands (i.e. "RESTORE DATABASE" and "RECOVER DATABASE") over dialup from home after being roused at 2:30am and having RMAN do all the thinking for you is sublime. Every DBA who has been around for a couple years has their own "backup scripts" that they love and trust (myself included), but how many have bothered to automate restore and recovery? Those who have are certainly aware of the shortcomings of their own efforts and probably use their restore/recovery scripts very sparingly, if they are wise, as the most common cause of failed recoveries by far is not tape failure, but human error or (worse yet) semi-automated human error. ----- Original Message ----- To: "Multiple recipients of list ORACLE-L" <[EMAIL PROTECTED]> Sent: Thursday, April 04, 2002 5:58 AM I think you can use pearl script. Thanks, Ashoke -----Original Message----- Sent: Thursday, April 04, 2002 5:43 AM To: Multiple recipients of list ORACLE-L I don't - but maybe take a look at the rman package (dbms_rman.delete_file or something like that) which allows you to delete files from the operating system. You could then use PL/SQl and the various v$ views to determine which archives you want to toast. hth connor --- Mark Leith <[EMAIL PROTECTED]> wrote: > Hi All, > > To save me re-inventing the wheel: > > Does anybody have a batch script (that runs on NT) > that deletes archive log > files that are older than X days old? I've looked at > the DEL command, but > this doesn't have a date/time based attribute > parameter.. > > Has anybody been through this already? > > All help appreciated! > > Mark > > =================================================== > Mark Leith | T: +44 (0)1905 330 281 > Sales & Marketing | F: +44 (0)870 127 5283 > Cool Tools UK Ltd | E: [EMAIL PROTECTED] > =================================================== > http://www.cool-tools.co.uk > Maximising throughput & performance > > > -- > Please see the official ORACLE-L FAQ: > http://www.orafaq.com > -- > Author: Mark Leith > INET: [EMAIL PROTECTED] > > Fat City Network Services -- (858) 538-5051 FAX: > (858) 538-5051 > San Diego, California -- Public Internet > access / Mailing Lists > -------------------------------------------------------------------- > To REMOVE yourself from this mailing list, send an > E-Mail message > to: [EMAIL PROTECTED] (note EXACT spelling of > 'ListGuru') and in > the message BODY, include a line containing: UNSUB > ORACLE-L > (or the name of mailing list you want to be removed > from). You may > also send the HELP command for other information > (like subscribing). ===== Connor McDonald http://www.oracledba.co.uk (mirrored at http://www.oradba.freeserve.co.uk) "Some days you're the pigeon, some days you're the statue" __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: =?iso-8859-1?q?Connor=20McDonald?= INET: [EMAIL PROTECTED] Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mandal, Ashoke INET: [EMAIL PROTECTED] Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Tim Gorman INET: [EMAIL PROTECTED] Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).