Deletion of archives

hi all,
Good day...Currently am deleting the archives in standby by using
rman  target /  LOG = $LOG <<EOF
run {
crosscheck archivelog all;
delete noprompt ARCHIVELOG ALL COMPLETED BEFORE 'sysdate-1';
EOFSince we need archives in standby for a day... i havent configured 'apply on standby'...How can i modify the above script in such a way that i deletes the archives older than sysdate-1 and which are applied archives......It should not delete the archives which are not applied...
thanks
baskar.l

One way but not sure it will be helpful for you or not.I didn't test it.Create that procedure within that schema which have rights to select the asm views v$asm_alias,v$asm_file.
SQL> declare
  2  cursor c1 is
  3  select al.name
  4    from v$asm_alias al,v$asm_file af
  5   where al.group_number=af.group_number
  6     and al.file_number =af.file_number
  7     and af.type='ARCHIVELOG'
  8     and af.creation_date<sysdate-1;
  9  v1 varchar2(500);
10  begin
11  for m in c1
12  loop
13    v1:='alter diskgroup <diskgroupname> drop file "<+diskgroupname/>||m1.name||"';
14    execute immediate v1;
15  end loop;
16  end;
17  .
SQL> /
PL/SQL procedure successfully completed.scheduled that above procedure within dbms_job
DBMS_JOB.SUBMIT (
   job       OUT BINARY_INTEGER,
   what      IN  VARCHAR2,
   next_date IN  DATE DEFAULT sysdate,
   interval  IN  VARCHAR2 DEFAULT 'null',
   no_parse  IN  BOOLEAN DEFAULT FALSE,
   instance  IN  BINARY_INTEGER DEFAULT any_instance,
   force     IN  BOOLEAN DEFAULT FALSE); Check more detail using oracle doc about dbms_job.
Note: I have not tested above procedure.
Khurram

Similar Messages

  • 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)

  • Can we delete the archived RS tables data in unix path?

    Hi Experts
    As you all know that when we perform RS table archiving we setup a Logical file path 'ARCHIVE_GLOBAL_PATH' pointing to the physical path '/usr/sap/<SYSID>/SYS/global/<FILENAME>' in unix system.
    Here we have our RS table data in the unix path and this logical path will make sure that there are no problems with requests status.
    Now our unix path has grown in size hence we would like to delete some archived data from this path. Could you pls confirm if we delete the data from this unix path will there be any problems with the requests status?
    Simply can we delete the RS table archived data from the unix file path??
    Thanks!!

    Hi All
    Any idea about this would be appreciated.
    Thanks!!

  • *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

  • I need help Guys I might of deleted the Archive utility How do i get it back.

    i Have a Mac Air Book OS  X and i think i might of deleted the Archive utility How do i get it back please need help.

    Why do you think you deleted it?

  • Any suggestions how can I delete or archive items with DocTitle as *.html ?

    Any suggestions how can I delete or archive items with DocTitle as *.html ? These are the email templates checked in by Fusion Apps, and all I know are the DocTitles.
    Archive servervice seems a better way to delete items at same time keep a backup. but not sure what's the correct way to setup/use the "aExportQuery" parameter. Seems it's been ignored from the ADD_ARCHIVE and EXPORT_ARCHIVE idccommands, codes listed below.
    @Properties LocalData
    IdcService=ADD_ARCHIVE
    IDC_Name=CommonDomain_ucm11g_cs
    aArchiveName=archive_test
    aArchiveDescription=this is an archive test
    aCopyWebDocuments=0
    aDoReplace=0
    aExportQuery=Standard Query ValuePanel UseExportDate 0 AllowExportPublished 0 AllRevisions 1 LatestRevisions 0 NotLatestRevisions 0 MostRecentMatching 0 CurrentIndex 0 Clauses dDocTitle:contains:.html CustomQuery dDocTitle%LIKE%'#%.html#%' IsCustom 0
    @end
    @Properties LocalData
    IdcService=EXPORT_ARCHIVE
    aArchiveName=archive_emt
    IDC_Name=CommonDomain_ucm11g_cs
    aExportQuery=Standard Query ValuePanel UseExportDate 0 AllowExportPublished 0 AllRevisions 1 LatestRevisions 0 NotLatestRevisions 0 MostRecentMatching 0 CurrentIndex 0 Clauses dDocTitle:contains:.html CustomQuery dDocTitle%LIKE%'#%.html#%' IsCustom 0
    dataSource=RevisionIDs
    aDoDelete=1
    @end
    <<EOD>>

    You could use the Archiver app. You can use that app as-needed or set it up so that all items are setup to delete once they're checked in.
    -ryan

  • Regarding Deletion or Archiving the Data based on Account Group

    Hi All,
    How to find the solution for Deletion or archiving the vendors in different SAP servers which is haviing account group.
    And tell me what is use for SARA Tcode?
    Please send documents or links..
    Can anyone help us ....its Urgent.....
    Thanks,
    Raj..

    hi,
    F58A - Archiving of Vendors.
    u can find all database tables for a particular object using SAra tcode.
    reward if hlpful.

  • Process Order Deletion and Archiving process

    Hi all,
    I just want to ask what is the proper process in deleting and archiving process orders and what are the possible impacts on the other modules?
    Thanks!

    Using SARA, Archiving object is PR_ORDER or t-code COAC.  Follow the step pre-process, write archive file, and delete from database.
    I don't recall any prerequisite for archiving process orders.   However, costing guys/girls often yelled to keep process orders for a very long while so you might want to check with their requirement (Note that archiving is more business-oriented than you think).
    Before you can do so, you must follow the steps of process order life cycle (from create, release, tech.comp., close, deletion flag, deletion indicator, accordingly).
    For deletion flag, and deletion indicator, you can set via COAC t-code.  There is a set up for period lapse between deletion flag to deletion indicator to archive in order type configuration (residence time 1, 2).  Process order, for example,  must reside in database for 1 month after deletion flag and another 1 month after deletion indicator before you can archive them out if you set residence time 1,2 to 1.
    Hope it helps.

  • Deleting applied archives from standby

    Hello Guys,
    We have oracle 10g rel 2 on hp-ux
    I feel this common question for dataguard implementation
    Just want to check best way of deleting archives automatically from standby database,i have 2 methods in mind
    as below
    1)At os level shell script-finding last seqno from alert log at standby/or query v$views(select max(sequence#) from v$archived_log) ,passing it to script
    using rman as :*delete archivelog until sequence seqno;*
    or deleting at os level upto this seqno
    (Making script is not issue with this functionality and scheduling it in cron)
    2)by RMAN at standby
    set alter system set "_log_deletion_policy"='ALL' scope=spfile;
    set CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;
    however i have no plans to take backup at standby,still can i use above command
    is it reliable i faced some issues in past inspite of this configurations archives were not deleted at standby
    Please give your views is there any other method to delete archives automatically ,and which one is more preferred
    and reliable method/best method
    Thanks

    804719 wrote:
    Hello Guys,
    We have oracle 10g rel 2 on hp-ux
    I feel this common question for dataguard implementation
    Just want to check best way of deleting archives automatically from standby database,i have 2 methods in mind
    as below
    1)At os level shell script-finding last seqno from alert log at standby/or query v$views(select max(sequence#) from v$archived_log) ,passing it to script
    using rman as :*delete archivelog until sequence seqno;*
    or deleting at os level upto this seqno
    (Making script is not issue with this functionality and scheduling it in cron)
    2)by RMAN at standby
    set alter system set "_log_deletion_policy"='ALL' scope=spfile;
    set CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;
    however i have no plans to take backup at standby,still can i use above command
    is it reliable i faced some issues in past inspite of this configurations archives were not deleted at standby
    Please give your views is there any other method to delete archives automatically ,and which one is more preferred
    and reliable method/best method
    ThanksConfigure RMAN to purge archivelogs after applied on standby [ID 728053.1]
    logdeletion_policy parameter is static, so which you cant change dynamically, PRimary should bounce, If it is fine then you can go ahead.
    If you do not have time, then prepare an RMAN script to delete the archives.

  • 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

  • Question related to deletion of archived files.

    Hi everyone,
    I have used the archiving object 'idoc' to archive data. However, this attempt to archive(write) failed twice and now i have two invalid sessions 632 and 633.
    It has created archvied files worth 80 GB in my UNIX system, which are useless now. Is there some way by which i can clean up this data through SAP.
    Please help.
    Thanks,
    Vinod.

    Hi Vinod,
    Since the archive file belongs to invalid session you can simply delete the archive files at the unix level.
    Cheers,
    Samanjay

  • Deletion without archiving is not allowed in the production client

    Hi Gurus!
    I have a new problem with regards deleting products in the Production system in CRM. I can't seem to delete the product in Production Box using this report(COM_PRODUCT_DELETE_SINGLE). It gives me this error: 'Deletion without archiving is not allowed in the production client' I'm doing this to solve my issue with regards some of the products not having any Sales and Distribution Data. The steps i did below worked in QA box.
    These are the steps i did in the QA box to delete the product:
    1) I've deleted the products that has no sales data using the report COM_PRODUCT_DELETE_SINGLE. I went to COMMPR01 to tag the said products with a status 'To Archive' then saved it before I triggered this report.
    2) I've registered it first in the table COMC_PR_TOOL_REG and filling up the necessary parameters
    3) After Deleting the said products in CRM, I logged into R/3 to access the material (MM02). I just changed the sales text and saved it to trigger the replication in CRM.
    When I checked the product in CRM, it worked. The Sales and Distribution Data is already shown.
    Now I have a new problem with regards this procedure. I can't seem to delete the product in Production Box using this report. It gives me this error: 'Deletion without archiving is not allowed in the production client'
    I have already followed the same procedure as to what I did in the QA box but for some reason it didn't work in the Production Box.
    Could anyone please help me with this. Thanks!
    Thanks & Regards
    Nathan

    I was able to solve the problem.
    In Report COM_PRODUCT_DELETE_SINGLE,there is a special check in order for the productive system detection.
    The logic in this program has a perform check_authority which will automatically produce the error and prevents you from deleting a product in the production system.
    Solution:
    I copied the program COM_PRODUCT_DELETE_SINGLE to new one ZCOM_PRODUCT_DELETE_SINGLE then I placed a comment on the PERFORM check_authority.

  • Gmail app: swipe to delete not archive

    In the Gmail app for iOS (not a Gmail account on the native Mail app), is it possible to swipe left to delete not archive? I've trawled through the web but didn't find anything. Nothing under Gmail app or any other settings either.

    Thanks to everyone who mentioned swipe to delete!  I did not know that was an option.
    I had downloaded some iTunes U content and then decided I didn't want it on my iPhone 4S 16gig, so I unchecked it in iTunes but this did not remove the files. 
    Swipe to delete did, so thank you!

  • 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****

  • Count total number of record of table with deletion from archiving object

    Does anyone know is there any SAP standard program to count the total number of record of the table with deletion from Archiving Object and display in repprt?

    Not sure of the question. Are you looking to get the sql "select count(*) from table" from using the TopLink expression framework or are you getting that SQL already and want something else?
    If you are looking just to get the count from a table/class, you can use a ReportQuery:
    ReportQuery rquery = new ReportQuery(ClassToQueryOn.class);
    rquery.addCount(); //equivalent to count(*);
    session.executeQuery(rquery);
    You can use a report query to return data instead of objects, and use selection criteria just like a normal read query.
    Best Regards,
    Chris

  • I accidentally deleted an Archive folder in MAIL, can i get it back ?

    I accidentally deleted an Archive folder in MAIL, can i get it back ?, i have several Time Machine backups and also a Sooper Dooper backup, but where can i find the the Archive folder to give me a chance of RESTORING it.
    I run Time Machine but that only lets me look in Finder for restoring files, if i knew where MAIL kept it's folders i would easily be able to restore it !.
    Any suggestions please would be most welcome, thanks.
    Tim

    Hey buddy you were Spot On thanks a million thanks, youre a star
    Tim

Maybe you are looking for

  • BTREE - C# Api, Can't encrypt database

    Hi. I've a problem using berkeley api for C#. I'm trying to create an encrypted db. That's an example of code I'm trying using: BTreeDatabase btreeDB; DatabaseEntry key ; DatabaseEntry data; public void dummy() dbo.dbs = dbs; String dbFileName = "Mes

  • Clicking noise from new Toshiba Satellite laptop?

    I have a Toshiba Satellite C55-A5195 (Windows 7 Home Premium). It was bought brand new around 3 weeks ago. I've noticed that, besides the fan noise, the bottom of the laptop makes a clicking or buzzing noise. The laptop has blue screened twice, somet

  • IPOD doesn't fully update!

    Hello, My ipod will not fully upload everything from my computer for some odd reason. When I was downloading songs those always updated no problem. Now I have a bunch of podcasts on my iTunes but they will not upload on my ipod. I have the setting se

  • Rs232 controll robot

    Hello Community! I'm a newbie in working with LabView and have a big problem, concerning the programming of my LabView Robotic Starter Kit using the Embedded-Controller NI sbRIO-9631. I need to program my robot as following: the robot communicates wi

  • Can't Share to YouTube

    Hi, I am trying to upload a presentation as a movie to Your Tube using the the share function from the share menu "send to You Tube" and after it has converted to a movie and tried to send I get an unknown error message. This has happened a number of