How to delete old archived logs

hai i am running oracle 9i in archive log mode
my disk is about 90% full
pls tell me how to delete archive logs that are very older

Hi Rajeskm,
First of all, archives should not be deleted, depending your backup policie, you can need them in a recovery. But if you want delete them, do:
find <log_archive_dest>/ -name *.rdo (or extention used by you) mtime +<days ago> -exec rm{}\
Explanation:
Find -- The first, and most obvious, use is find's ability to locate old, big, or unused files, or files that you forgot where they are.
mtime -- The mtime--modify time--is the time when the actual contents of a file was last modified. This is the time displayed in a long directoring listing (ls -l).
rm -- Deletes a file without confirmation (by default).
Regards,
Jonathan Ferreira - Brazil
http://www.ebs11i.com.br

Similar Messages

  • *HOW TO DELETE THE ARCHIVE LOGS ON THE STANDBY*

    HOW TO DELETE THE ARCHIVE LOGS ON THE STANDBY
    I have set the RMAN CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY; on my physical standby server.
    My archivelog files are not deleted on standby.
    I have set the CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default on the Primary server.
    I've checked the archivelogs with the FRA and they are not beign deleted on the STANDBY. Do I have to do something for the configuation to take effect? Like run a RMAN backup?
    I've done a lot ofresearch and i'm getting mixed answers. Please help. Thanks in advanced.
    J

    Setting the Policy will not delete the Archive logs on the Standby. ( I found a thread where the Data Guard product manager says "The deletion policy on both sides will do what you want" ). However I still
    like to clean them off with RMAN.
    I would use RMAN to delete them so that it can use that Policy are you are protected in case of Gap, transport issue etc.
    There are many ways to do this. You can simply run RMAN and have it clean out the Archive.
    Example :
    #!/bin/bash
    # Name: db_rman_arch_standby.sh
    # Purpose: Database rman backup
    # Usage : db_rman_arch_standby <DBNAME>
    if [ "$1" ]
    then DBNAME=$1
    else
    echo "basename $0 : Syntax error : use . db_rman_full <DBNAME> "
    exit 1
    fi
    . /u01/app/oracle/dba_tool/env/${DBNAME}.env
    echo ${DBNAME}
    MAILHEADER="Archive_cleanup_on_STANDBY_${DBNAME}"
    echo "Starting RMAN..."
    $ORACLE_HOME/bin/rman target / catalog <user>/<password>@<catalog> << EOF
    delete noprompt ARCHIVELOG UNTIL TIME 'SYSDATE-8';
    exit
    EOF
    echo `date`
    echo
    echo 'End of archive cleanup on STANDBY'
    mailx -s ${MAILHEADER} $MAILTO < /tmp/rmandbarchstandby.out
    # End of ScriptThis uses ( calls an ENV) so the crontab has an environment.
    Example ( STANDBY.env )
    ORACLE_BASE=/u01/app/oracle
    ULIMIT=unlimited
    ORACLE_SID=STANDBY
    ORACLE_HOME=$ORACLE_BASE/product/11.2.0.2
    ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
    LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
    LIBPATH=$LD_LIBRARY_PATH:/usr/lib
    TNS_ADMIN=$ORACLE_HOME/network/admin
    PATH=$ORACLE_HOME/bin:$ORACLE_BASE/dba_tool/bin:/bin:/usr/bin:/usr/ccs/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:/usr/lbin:/GNU/bin/make:/u01/app/oracle/dba_tool/bin:/home/oracle/utils/SCRIPTS:/usr/local/bin:.
    #export TERM=linux=80x25 wrong wrong wrong wrong wrong
    export TERM=vt100
    export ORACLE_BASE ORACLE_SID ORACLE_TERM ULIMIT
    export ORACLE_HOME
    export LIBPATH LD_LIBRARY_PATH ORA_NLS33
    export TNS_ADMIN
    export PATH
    export MAILTO=?? your email hereNote use the env command in Unix to get you settings.
    There are probably ten other/better ways to do this, but this works.
    other options ( you decide )
    Configure RMAN to purge archivelogs after applied on standby [ID 728053.1]
    http://www.oracle.com/technetwork/database/features/availability/rman-dataguard-10g-wp-1-129486.pdf
    Maintenance Of Archivelogs On Standby Databases [ID 464668.1]
    Tip I don't care myself but in some of the other forums people seem to mind if you use all caps in the subject. They say it shouting. My take is if somebody is shouting at me I'm probably going to just move away.
    Best Regards
    mseberg
    Edited by: mseberg on May 8, 2012 11:53 AM
    Edited by: mseberg on May 8, 2012 11:56 AM

  • How to delete the archive logs.

    Hi,
    I need to delete the archive logs in standby database which has been generated after created the restore point.
    SEQUENCE# APPLIED
    17 YES
    18 YES
    1 NO
    2 NO
    19 YES
    18 YES
    21 YES
    22 YES
    20 YES
    23 YES
    24 YES
    sequence 1,2 has been generated after created the restore point,how can i remove sequence# 1 and 2 from the v$archived_log;
    ways i have tried
    1.dropped the restore point during that time only the flashback logs has been deleted not the archive log
    2.manually tried from rman ,but i was not working.
    please help me out....
    ***points are waiting for you guys****

    Hi,
    I need to delete the archive logs in standby database which has been generated after created the restore point.
    SEQUENCE# APPLIED
    17 YES
    18 YES
    1 NO
    2 NO
    19 YES
    18 YES
    21 YES
    22 YES
    20 YES
    23 YES
    24 YES
    sequence 1,2 has been generated after created the restore point,how can i remove sequence# 1 and 2 from the v$archived_log;
    ways i have tried
    1.dropped the restore point during that time only the flashback logs has been deleted not the archive log
    2.manually tried from rman ,but i was not working.
    please help me out....
    ***points are waiting for you guys****

  • How to removed the 300GB old archive logs???

    Dear Gurus
    Site-A
    Our Environment:
    Live Production 2-Node RAC Oracle10g r2 10.2.0.4
    Data and Archive is stored in Oracle ASM
    Operating System: Sun Solaris10 64bit
    We have two databases.
    ==>db-1(Site-A db-1 is Oracle streaming with Site-B db-1,so archive logs should not be deleted which is required for oracle streaming)
    ==>db-2
    Existing Backup and Recovery Strategy:
    Daily logical backup of application schema using DATA PUMP.
    We have not taken any RMAN Backup still.
    Please find the status of Shared Storage.
    -bash-3.00$ asmcmd
    ASMCMD> lsdg
    State Type Rebal Unbal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Name
    MOUNTED EXTERN N N 512 4096 1048576 614256 577801 0 577801 0 DATA/
    MOUNTED EXTERN N N 512 4096 1048576 298948 38635 0 38635 0 FLASH/
    We want to removed the old archive logs?
    Please suggest the best way of removed the old archive logs for db-2 and db-1?
    Can you Please suggest that how many time and how many space it's required for completed the backup?
    Regards
    Hitesh Gondalia
    Edited by: hitgon on Oct 1, 2011 9:50 PM
    Edited by: hitgon on Oct 1, 2011 10:09 PM
    Edited by: hitgon on Oct 1, 2011 10:13 PM

    You should consider using RMAN for backup/recovery. Logical exports (Data Pump) are useful for some purposes, but are not the preferred way to go for your backup and recovery needs. RMAN will give you better performance and so much more options.
    Long-term, a great way to delete archivelog backups is via RMAN “backup archivelog …. delete input” and/or “delete archivelog … “commands.
    Please delete archivelogs only after they are already backed up. RMAN will also take into consideration if the backups are needed for Streams and/or Standby.
    About the backup space – a full RMAN backup is typically smaller than the size of your DB. You need to run a test to see the exact size. The frequency and type of backup should be based on your SLE for this DB.
    Iordan Iotzov
    http://iiotzov.wordpress.com/

  • How to find out who deleted the archive logs

    Hi All,
    Recently some archive logs were deleted from one of our servers. Is there any way to find out which user has deleted the archive logs through OS or through database ?
    OS Version :-
    SunOS Generic_Virtual sun4u sparc SUNW,SPARC-Enterprise
    Database Version:-
    SQL*Plus: Release 9.2.0.8.0 - Production on Mon Apr 9 01:12:15 2012

    888132 wrote:
    Hi All,
    Recently some archive logs were deleted from one of our servers. Is there any way to find out which user has deleted the archive logs through OS or through database ?
    OS Version :-
    SunOS Generic_Virtual sun4u sparc SUNW,SPARC-Enterprise
    Database Version:-
    SQL*Plus: Release 9.2.0.8.0 - Production on Mon Apr 9 01:12:15 2012As explained by others, from oracle database there is no record if they are deleted from OS.
    But you can probably find the history of OS command been run with history command :). You can get the date and time.
    Following link can help
    http://stackoverflow.com/questions/99755/how-do-i-get-the-command-buffer-in-solaris-10
    http://www.cyberciti.biz/faq/unix-linux-bash-history-display-date-time/
    http://www.linuxquestions.org/questions/solaris-opensolaris-20/in-solaris-command-line-how-to-get-the-previous-commands-573814/
    But i suggest you to post in Sun OS forum to get more details as its nothing to do with Database(in this scenario)

  • How to delete old account, I can't log in due to - This email address is not available for use as an Apple ID. You may already have an Apple ID associated with this address. Please try again or sign in using your existing Apple ID.

    How to delete old account, I can't log in due to error - This email address is not available for use as an Apple ID. You may already have an Apple ID associated with this address. Please try again or sign in using your existing Apple ID.

    All good, I loved with AppStore and now everything seems to be back to normal.

  • How to delete old logs in SAP BI, what is the best way to go?

    Hi,
    below are the issues we are facing,
    when executing infopackage job is not getting triggred into source system.
    for activation DSO data it is taking huge time. At the time of seqential read to RSREQDONE table.
    I think this is due to huge logs in the staandard tables.
    What could be the reson behind this.. and let me know how to delete old logs.
    Thanks,
    Harish

    Hi,
    just carry out RSRV for DSO PSA tables and see if there is inconsistency available there in the PSA table.
    see if the change log and PSA deletion is happening regularly..else schedule same in PC
    check with basis there are certain jobs which needs to run regularly at certain frequency..
    http://www.erphowtos.com/guides-a-tutorials/doc_view/1041-how-to-delete-process-chain-logs-in-sap-bw.html
    http://www.erphowtos.com/guides-a-tutorials/doc_view/1040-periodic-maintenance-activities-on-sap-bw-best-practices.html
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a02ba9e7-bb6f-2c10-09b4-e86b9fcbad41?QuickLink=index&overridelayout=true
    Thanks and regards
    Kiran

  • I accidently delete the archived log, how to recover?

    There was old archived log file in a directory, I delete the directory, so when I backup whole archived log with RMAN, I often got error like this,
    RMAN-06059: expected archived log not found, lost of archived log compromises recoverabiligy
    ora-196525: error identifying file G:\oracle\oradata\archive\arc00081.001
    I am using oracle 9.2 on windows XP
    Edited by: user8117130 on Jun 14, 2009 9:35 PM

    HI..
    I delete the directory, so when I backup other archived log with RMAN, I often got error like this From metalink:-
    Error:     RMAN-06059 (RMAN-6059)Text:     expected archived log not found, lost of archived log compromises
         recoverability
    Cause:     The archived log was not found. The repository thinks it does
         exist. If the archived log has in fact been lost and there is no
         backup, then the database is no longer recoverable across the
         point in time covered by the archived log. This may occur because
         the archived log was removed by an outside utility without
         updating the repository.
    Action:     If the archived log has been removed with an outside utility and
         the archivelog has already been backed up, then you can
         synchronize the repository by running CROSSCHECK ARCHIVELOG ALL.
         If the archivelog has not been previously backed up, then you
         should take a full backup of the database and archivelogs to
         preserve recoverability. Previous backups are not fully
         recoverable.
    >
    Anand

  • Extract is abended and looking 8 days old archive log.

    I was doing some maintenance and I stop all the extracts and replicats. Couple of my extracts are stopped and looking for 8 days old archive logs. Please tell me how can I recover from that situation. I dont have that archive any more we only keep 5days arch.
    GGSCI (ggastdb01.infra.mms) 5> info e_it860t
    EXTRACT E_IT860T Initialized 2011-02-08 16:04 Status STOPPED
    Checkpoint Lag 00:10:05 (updated 04:34:30 ago)
    Log Read Checkpoint Oracle Redo Logs
    2011-02-24 09:53:04 Seqno 15721, RBA 103192
    Report file Error:
    2011-02-24 14:34:04 ERROR OGG-00446 Could not find archived log for sequence 15494 thread 1 under alternative or default destinations. SQL <SELECT name FROM v$archived_log WHERE sequence# = :ora_seq_no AND thread# = :ora_thread AND resetlogs_id = :ora_resetlog_id AND archived = 'YES' AND deleted = 'NO>. Last alternative log tried /u10/oradata/PPMTST10/arch/1_15494_721133148.arc, error retrieving redo file name for sequence 15494, archived = 1, use_alternate = 0Not able to establish initial position for sequence 15494, rba 68728848.
    2011-02-24 14:34:04 ERROR OGG-01668 PROCESS ABENDING.

    If you don't have the log file(s) in question, then you need to:
    re-sync the databases/schema/tables, or
    advance the CSN to a point in time where you do have log files and deal with missing data separately
    Is an archived transaction log missing?
    ● Extract reads the archived logs when an online log is not available. If you started
    Extract after it was stopped for a long time, the records it needs to process might
    already be archived away.
    ● Restore the archive log that is specified in the error message in the report file, and also
    restore all subsequent logs.
    NOTE Extract should not be stopped for a long time. If you must stop Extract, make
    certain that archives are available all the way back to the time that you stopped
    Extract. If Extract remains stopped for an exceptionally long time, it might be more
    practical to resynchronize the table(s) rather than wait for Extract to go through the
    archives and catch up.

  • How to determine which archive logs are needed in flashback.

    Hi,
    Let's assume I have archive logs 1,2,3,4, then a "backup database plus archivelogs" in RMAN, and then archive logs 5+6. If I want to flashback my database to a point immediately after the backup, how do I determine which archive logs are needed?
    I would assume I'd only need archive logs 5 and/or 6 since I did a full backup plus archivelogs and the database would have been checkpointed at that time. I'd also assume archive logs 1,2,3,4 would be obsolete as they would have been flushed to the datafiles in the checkpoint.
    Are my assumptions correct? If not what queries can I run to determine what files are needed for a flashback using the latest checkpointed datafiles?
    Thanks.

    Thanks for the explanation, let me be more specific with my problem.
    I am trying to do a flashback on a failed primary database, the only reason why I want to do a flashback is because dataguard uses the flashback command to try and synchronize the failed database. Specifically dataguard is trying to run:
    FLASHBACK DATABASE TO SCN 865984
    But it fails, if I run it manually then I get:
    SQL> FLASHBACK DATABASE TO SCN 865984;
    FLASHBACK DATABASE TO SCN 865984
    ERROR at line 1:
    ORA-38754: FLASHBACK DATABASE not started; required redo log is not available
    ORA-38761: redo log sequence 5 in thread 1, incarnation 3 could not be accessed
    Looking at the last checkpoint I see:
    CHECKPOINT_CHANGE#
    865857
    Also looking at the archive logs:
    RECID STAMP THREAD# SEQUENCE# FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# RESETLOGS_CHANGE# RESETLOGS
    25 766838550 1 1 863888 10-NOV-11 863892 863888 10-NOV-11
    26 766838867 1 2 863892 10-NOV-11 864133 863888 10-NOV-11
    27 766839225 1 3 864133 10-NOV-11 864289 863888 10-NOV-11
    28 766839340 1 4 864289 10-NOV-11 864336 863888 10-NOV-11
    29 766840698 1 5 864336 10-NOV-11 865640 863888 10-NOV-11
    30 766841128 1 6 865640 10-NOV-11 865833 863888 10-NOV-11
    31 766841168 1 7 865833 10-NOV-11 865857 863888 10-NOV-11
    How can I determine what archive logs are needed by a flashback command? I deleted any archive logs with a SCN less than the checkpoint #, I can restore them from backup but I am trying to figure out how to query what is required for a flashback. Maybe this coincides with the point that flashbacks have nothing to do with the backups of datafiles or the checkpoints?

  • Script for automatic delete of archive logs/redologs

    Hi Experts,
    Do you have any idea on how to create a shell script. Actually the function of it, is to automatically deletes the archive logs/redologs if reaches the limit. Or is there any parameter to change to set the automatic deletion of archive logs/redologs.
    Regards

    Hi,
    at first, archivelogs should always be saved to tape before you delete them. If you don't want to backup them, may be for a test system, you can suppress them in ORACLE instead to delete them later.
    You can run the database in "NOARCHIVE LOG MODE". If you do so, the online redologs are not archived, they are still reused and overwritten. You can not run an online Backup, when the database is in noarchive log mode. If you want to backup the database, you have to run an offline backup.
    Do not use the NOARCHIVE LOG MODE for production or developemet systems.
    To change the archive log mode:
    shutdown the database
    startup mount;
    alter database noarchivelog;
    alter database open;
    archive log list       will show the actual status
    regards Ulrich

  • Delete unwanted archive logs

    We do only one way replication using stream. How do I find archive logs that can be deleted at source. Our destination runs nonarchive.

    If you use RMAN - it is streams friendly and should know which logs can be purged.
    Otherwise, I use the following query:
    SELECT r.CONSUMER_NAME,
    r.NAME,
    r.FIRST_SCN,
    r.NEXT_SCN,
    case when (r.next_scn > c.required_checkpoint_scn) then ‘NO’ else ‘YES’ end purgable
    FROM DBA_REGISTERED_ARCHIVED_LOG r, DBA_CAPTURE c
    WHERE r.CONSUMER_NAME = c.CAPTURE_NAME;
    According to Metalink note 373066.1 this is what RMAN does, so it should be safe.

  • I have a 3g iphone and I need to know how to delete old photos from my phone!! I need the space but there is no way to delete the pictures!! Help!!!

    I have a 3g iPhone and I need to know how to delete old photos. Need to free up space and there is no clear way to delete these photos!! Can someone please let me know how to get rid of these pictures!!!! Help!!!

    There are a number of ways to delete pictures from the Camera Roll.  One is to open Camera Roll in the thumbnail view, tap the arrow button (top right), tap all the pictures you want to delete, tap the Delete button ant the bottom.  Photo Library pictures are deleted by unchecking Sync Photos on the Photos tab of your iTunes sync settings, followed by syncing your phone.

  • How to delete old emails in app store?

    how to delete old emails in app store?

    Yes, I am with KJ, I have no real idea what you are asking about. The app store does not usually have email involved with it.

  • How to set no archive log in MS SQL

    Dear Gurus,
    I'll already did the support package upgrade and need to run the SGEN.But before that I'll need to set the archive log in MS SQL 2005 database.
    Kindly please help me,how to set "no archive log " in MS SQL .Then I can run the SGEN.After that how to revert back to "enable archive log mode".
    All the posting told about the archive log with Oracle.
    Thanks
    /Shah

    Hi Shah,
    In MS SQL Server, Transaction log is used to write log files.
    For eg., Intially if you allocate 10GB to the Tr.Log and can set the limit based on your requirement, say as 11GB. It means it wont grow beyond the point 11GB.
    If you take a transactional log backup, the data present in the 10GB file is freed up, but the size of the file would remain same.
    This can be truncated by shrinking the log file.
    1. Open SQL Mgmt studio.
    2. Right click on the DB(SID)> Tasks>Shrink-->Files.
    3. Choose "Log" in the file type and "Log File Name" in the Filename column.
    4. Shrink Action should be "Release Unused Space"
    5. Then Click Ok. The unused space will be released.
    The Transaction log can be switched off by changing the Recovery Model to "SIMPLE"
    1. Click on the DB(SID)
    2. Properties>Options>Recovery Model.
    3. If the recovery model is set to Simple, the Transaction log wont be written.
    Hope this would help you. Revert for any other clarification.
    Regards,
    Kamesh

Maybe you are looking for

  • Itunes 10.6.1 crash for other language

    Before I installed 10.6 and it just crashed continusly, would restore and I kept reinstalling. finaly I decided to go to an older version, what ended up been the perfect solution. Waited for next version where all bugs should be at the most fixed, bu

  • Incremental index for UME ADS LDAP

    Hi, We are currently indexing the users in the "ume" repository in order to use a "Who Is Who" type search and using Active Directory as the data source. The problem is that when we change an attribute in Active Directory, TREX doesn't pick up the mo

  • UK iphone 3gs upgraded from a nokia n82

    Hi there ,Sorry if this is a stupid question but I have just upgraded my trusty old nokia n82 to the new iphone 3gs .And i was told all i needed to do was take my sim out the old phone and put it in the iphone and register on line at itunes .Oh this

  • Making Photoshop the Default

    Ok, here's the thing. I am graphic designer for a firm where I live and I loaded Corel's Paint Shop Pro on my computer since one of the guys here uses that mostly (why I don't know). Anyways I prefer Photoshop, hands down, so I want to make it my def

  • Need to make cool rollover buttons

    Hello all, This is for a commercial website I'm working on and I hit a snag with. Here's what I'm trying to do: On the site header, there are topics such as, "Apartments" and the like. What the client wants is to be able to have the viewer rollover t