Rman archive deletion script required

hi
i need a shell script which will delete archivelog using rman and will take backup of archivelog to specified location.DB 10gR2 OS RHEL 5 686.
backup archivelog all to destination '/oracle/oracle/.Arch_bkp/';
delete archivelog until 'sysdate-10';
kind regards
Edited by: no one on May 24, 2012 1:40 AM

Kuljeet Pal Singh wrote:
cat db_rman.sh
<<all oracle environment variable>>
CUR_DATE=`date +%d%m%y`
export CUR_DATE
DT=`date +%d%m%y_%H-%M`
export DT
LOG_DEST=/u02/backup/TAPE_Backup_Log
export LOG_DEST
rman target / catalog db_cat/password@rmanprod log=$LOG_DEST/RMAN_$DT.log <<EOF
run {
backup archivelog all to destination '/oracle/oracle/.Arch_bkp/';
delete archivelog until 'sysdate-10';
}I am in nocatalogue database.
exit
EOF

Similar Messages

  • Rman tablespace backup script required

    Dear Guru,
    Thanks a lot, it start working...as the policy has set to 7 days retention period...
    i have another issue if you can help me, i have whole apps running on only two tablespace docv,docvindex
    rest by using this script i have to take backup every day entire database that occupied unncessary space, can you help me to revised the script..thank you in advanced sir
    connect target sys/sys@ORCL;
    run
    allocate channel h1 type disk format="E:\bkup_orcl\%t_%u";
    allocate channel h2 type disk format="E:\bkup_orcl\%t_%u";
    backup database tag=dailybak;
    backup current controlfile tag=ctlbak;
    sql 'alter system archive log current';
    backup archivelog all ;
    release channel h1;
    release channel h2;
    regards,
    salim shahzad

    Kuljeet Pal Singh wrote:
    cat db_rman.sh
    <<all oracle environment variable>>
    CUR_DATE=`date +%d%m%y`
    export CUR_DATE
    DT=`date +%d%m%y_%H-%M`
    export DT
    LOG_DEST=/u02/backup/TAPE_Backup_Log
    export LOG_DEST
    rman target / catalog db_cat/password@rmanprod log=$LOG_DEST/RMAN_$DT.log <<EOF
    run {
    backup archivelog all to destination '/oracle/oracle/.Arch_bkp/';
    delete archivelog until 'sysdate-10';
    }I am in nocatalogue database.
    exit
    EOF

  • Delete Script required

    Hi,
    I want to delete the records which comes from the below query.
    select da.deal_id, da.subsection_id, count(*) from tableDA da
    where da.subsection_id = 9000 group by da.deal_id, da.subsection_id having count(*)=1
    Please help me to write the delete query. Thanks in advance.
    Regards,
    Subhadeep

    I would delete like this:
    delete from tableDA d
    where d.subsection_id = 9000
    and not exists (select null from tableDA t
                         where d.deal_id = t.deal_id
                         and d.subsection_id = t.subsection_id
                         and d.rowid != t.rowid);

  • RMAN Cold backup script

    DB version :10.2.0.4
    Do you find anything wrong in the below mentioned RMAN cold backup script? Any enhancements, corrections required?
    shutdown immediate;
    startup mount;
    backup database including current controlfile tag='full_bkp';
    startup;
    crosscheck backup;
    delete noprompt obsolete device type disk;
    resync catalog;
    }

    Since you are doing a SHUTDOWN IMMEDIATE and STARTUP MOUNT before the BACKUP, there will be no ArchiveLogs generated while the backup is running --- as the database is not OPEN.
    However, the PLUS ARCHIVELOG can include ArchiveLogs that had been generated from the previous STARTUP or ALTER DATABASE OPEN.
    (In that case, I would suggest an SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT' before the SHUTDOWN IMMEDIATE).
    Is your database running in ARCHIVELOG mode ? If not, then this discussion is moot.
    If yes, the next question is, obviously : Why not take a Hot Backup while the database is running (in which case you MUST backup archivelogs !)
    Hemant K Chitale

  • Data Guard archive deleted from Primary datbase before transfaring Standby

    Dear all
    I have a physical standby database. And Primary database on RAC node 1 and node 2.
    Accidently archive log deleted from Primary db before shipped standby db .
    I saw this error which is showing the GAP.
    FAL[client]: Failed to request gap sequence
    GAP - thread 1 sequence 1_7090 1_7090
    ir
    Edited by: user8244545 on Jun 7, 2010 11:33 AM
    Edited by: user8244545 on Jun 7, 2010 6:47 PM

    Well, I feel sorry for you after all these guys gave you such a hard time :^)
    You should be using at least an RMAN Archive Log deletion policy to manage your archive log files.
    See "Deletion Policy for Archived Redo Log Files In Flash Recovery Areas" at http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/rman.htm#SBYDB00750 and http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/rman.htm#i1031870 for 10gR2. 10g does require you use a Flash Recovery Area (FRA, renamed to Fast Recovery Area) . Read the paper at http://www.oracle.com/technology/deploy/availability/pdf/RMAN_DataGuard_10g_wp.pdf to sort out not having to use MANDATORY (which we do not recommend).
    Now, if you are at 11g (R1 or R2) you don't even have to be using the FRA nor mandatory to have it work. See http://www.oracle.com/pls/db111/to_URL?remark=ranked&urlname=http:%2F%2Fdownload.oracle.com%2Fdocs%2Fcd%2FB28359_01%2Fbackup.111%2Fb28270%2Frcmconfb.htm%23BRADV89439.
    If you do not use RMAN to backup the archive logs at least these deletion policy will prevent this from happening again since you will no longer be deleting archive logs manually.
    Now, it may be too late for this, I am behind in my mail, but you could get the standby past this gap by using an incremental backup of the primary from the last SCN that was applied at the standby. See the manual at http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/scenarios.htm#CIHIAADC for more information.
    Larry

  • PI 7.1 Archiving - Delete

    hi Team,
    We have PI 7.1 production environment and planning to implement ARCHIVING & DELETE for Integration Engine, Adapter Engine and Business Process Engine based messages.
    I had referred to 'How to arhive & delete' doc that highly available in SDN but few question after going through the doc.
    1. If a interface flagged for ARCHIVING then all messages in complete message status gets automatically Archived
    2. And if interface not flagged for ARCHIVING then all messages of those interfaces gets automatically Deleted
    Ofcourse on these both the cases, the corresponding action takes place only provided the retention period candition meets.
    1. But Wondering, How about the messages that NOT successfully processed? Somewhere in SDN i red the NOT completetly proccessed messages require to be first 'Cancelled' and then they get marked for ARCH so that it gets archived! So in this case, both 'Synchronous" and "Asynchronous" not completely proccessed messages have to be marked for 'Cancel' before they get Archived?
    2. Keeping this aside how the not completely processed archving, Why we need to archive the messages that are not completely proccessed in PRODUCTION environment?
    3. In regards to 'NOT Completely processed' messages, I agree to certain extend that "All these have to be removed" from Database so that we gain disk space that helps improve the performance also? Please share your knowledge.
    4. Either Archiving or Delete mechanism has any dependance or functional variations on Synchronous and Asysnchronous?
    I highly appriciate all those add their knowledge here to clarify
    Regards
    Sekhar

    Dear Sekhar,
    let me go through your questions step by step...
    1. But Wondering, How about the messages that NOT successfully processed? Somewhere in SDN i red the NOT completetly proccessed messages require to be first 'Cancelled' and then they get marked for ARCH so that it gets archived! So in this case, both 'Synchronous" and "Asynchronous" not completely proccessed messages have to be marked for 'Cancel' before they get Archived?
    This is almost correct. Canceling is required for asynchonous messages in error state only. By canceling a message its state changes from error to final and this it is allowed to be archived. In contrast synchronous messages are final right when processing fails.
    Please note: archiving applies to asynchronous messages only. It is a general decision by SAP to not archive synchronous messages.
    2. Keeping this aside how the not completely processed archving, Why we need to archive the messages that are not completely proccessed in PRODUCTION environment?
    Once an asynchronous message enters the central Intergation Server(IS) or the local Integration Engine(IE) XI/PI takes over responsibility for this message. Canceling a message means a serious violation of the EO/EOIO protocol. This violation needs to be documented in productive environments for the purpose of tracebility.
    3. In regards to 'NOT Completely processed' messages, I agree to certain extend that "All these have to be removed" from Database so that we gain disk space that helps improve the performance also? Please share your knowledge.
    I am not quite sure that I got the point. For each message entering the IS/IE SAP has to provide a guided procedure to reorganize this message. For successfully processed messages this is done by standard house-keeping jobs for archivng and deletion. For messages in error state there are basically two ooptions:
    (1) restert message after error has been fixed;
         -   if message processing is sucessful this time, we are back to normal
         -   if message processing fails again, we are in the very same siutation as before
    (2) cancel messages; this males the message 'final' and then it is treated like sucessfully processed messages.
    Thus, this is all about defining an end point in the lifecycle of each message.

  • Archival/Deletion of messages in XI 3.0 SP23

    Dear All,
      We need to carry out a data deletion/purging activity at our XI box, where no archival/deletion policy has been incorporated ever. As a preparatory measure, I need to have some guidelines for the activities as under,
    1. While defining an Archival policy, is there any recomendation from SAP or others that message archival exercise has to be carried out first, before proceeding with message deletion? To be more precise, can we directly delete/purge the messages without archiving them? What will be the impact of such an exercise on the XI system?
      This point may sound confusing but the reality is that we do not have enough H/W to carry out an activity of Archival and Deletion.
    2. What is the SAP recomendation/best practice in this regard?
    3. Although we are defining the Archival/Deletion policy now, we need to purge data that is 3 years old and we do not require them any more. What would be the best practice to carryout this activity?
    Thanks and regards,
    Sugata Basu

    Hi Sugatada,
    is there any recomendation from SAP or others that message archival exercise has to be carried out first, before proceeding with message deletion?
          No as per my knowledge..
    can we directly delete/purge the messages without archiving them? What will be the impact of such an exercise on the XI system?
         This wholly depends on requirement...if the data is too old...you can directly delete it..no need to archieve..
    What is the SAP recomendation/best practice in this regard?
      you can set these values which close to best practice...
    Retention period for both synch and asynch
    msgs without error awaiting deletion : 180 days
    msgs without error awaiting archieving : 45 days
    retention period for history entris for deleted msgs : 30 days
    in XI we have 2 types of action:
    (1) deletion of XML messages (without prior archiving)
    (2) archiving of XML messages with subsequent deletion
    SAP_BC_XMB_DELETE* for type (1)
    SAP_BC_XMB_ARCHIVE* for type (2)
    Regds,
    Pinangshuk.

  • Seeburger message tracking archiving / deleting question

    Hello,
    We are using Seeburger 1.7 with XI 7.0 for our EDI translations..We store information in Seeburger Message Tracking for our business requirements.I would like to know how these entries could be archived(Compressed) and stored or deleted after certain days so that we wont max up our storage..?
    Any suggestions are appreciated.
    Thanks in advance!
    Larry

    Prateek,
    Thanks for your response.Yes,I could find the "Archive Configuration" option..when I click that it shows me a screen saying show master data with two items with check boxes (Document Types & Archiving Systems)..On clicking the details of them I see set of parameters which shows the profile and the document type..not sure how to proceed from here to set up any archiving / deletion..any help is appreciated..
    Regards,
    Larry.

  • Archiving  & Deleting the Cost center line items

    My requirement is to delete the line items in the cost cneter as of today, but when i tried to archive & delete the Cost center line items using CO_item,i aam sucesfull in deleteing the past data, but the data of the last month and currenct month i was unable to ........
    when i tried in the spro>img>controlling>general ontrolling>archiving>prepare archiving for co line items
    i set the resident time to 0,but i was unable to delete the line items.what colud be the reason and what is the way to delete the currenct data also from the system.
    your earlier reply surely appreciated .......

    Hi Rajesh,
    I think SAP help says that the period for which you are planning to delete or archive data may have to be locked.
    Check the following links:
    For Archiving
    http://help.sap.com/saphelp_47x200/helpdata/en/8d/3e55ec462a11d189000000e8323d3a/frameset.htm

  • RMAN-06067: RECOVER DATABASE required with a backup or created controlfile

    Hi,
    DB:9.2.0.8
    OS: AIX 5.3
    I am restoring DB with until time(12/06/2012) for needed tablespaces.
    I restored the 12th date controlfile ,which is backed up with archivedlogs. I also have one more controlfile which backed up with full DB..
    Restore of tablespaces are completed..
    When recovery is going , failed with following error..
    allocated channel: c7
    channel c7: sid=22 devtype=SBT_TAPE
    channel c7: VERITAS NetBackup for Oracle - Release 5.1 (2006040520)
    allocated channel: c8
    channel c8: sid=21 devtype=SBT_TAPE
    channel c8: VERITAS NetBackup for Oracle - Release 5.1 (2006040520)
    executing command: SET until clause
    Starting recover at 23-06-2012 02:00:15
    released channel: c1
    released channel: c2
    released channel: c3
    released channel: c4
    released channel: c5
    released channel: c6
    released channel: c7
    released channel: c8
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of recover command at 06/23/2012 03:36:57
    RMAN-06067: RECOVER DATABASE required with a backup or created controlfile
    RMAN>
    Restore Script:
    connect target /
    connect catalog rmanc/recom@lgn_rmanc
    run {
    allocate channel c1 type 'SBT_TAPE';
    allocate channel c2 type 'SBT_TAPE';
    allocate channel c3 type 'SBT_TAPE';
    allocate channel c4 type 'SBT_TAPE';
    allocate channel c5 type 'SBT_TAPE';
    allocate channel c6 type 'SBT_TAPE';
    allocate channel c7 type 'SBT_TAPE';
    allocate channel c8 type 'SBT_TAPE';
    allocate channel c9 type 'SBT_TAPE';
    allocate channel c10 type 'SBT_TAPE';
    allocate channel c11 type 'SBT_TAPE';
    allocate channel c12 type 'SBT_TAPE';
    set until time '12-06-2012 00:01:26';
    restore tablespace SYSTEM,UNDO_GEN01,UNDO_GEN02,TAB_80K_GENCON,TAB_25M_GENCON;
    release channel c1;
    release channel c2;
    release channel c3;
    release channel c4;
    release channel c5;
    release channel c6;
    release channel c7;
    release channel c8;
    release channel c9;
    release channel c10;
    release channel c11;
    release channel c12;
    Recover Script:
    connect catalog rmanc/recom@lgn_rmanc
    connect target /
    run {
    allocate channel c1 type 'SBT_TAPE';
    allocate channel c2 type 'SBT_TAPE';
    allocate channel c3 type 'SBT_TAPE';
    allocate channel c4 type 'SBT_TAPE';
    allocate channel c5 type 'SBT_TAPE';
    allocate channel c6 type 'SBT_TAPE';
    allocate channel c7 type 'SBT_TAPE';
    allocate channel c8 type 'SBT_TAPE';
    set until time '12-06-2012 00:01:26';
    recover tablespace SYSTEM,UNDO_GEN01,UNDO_GEN02,TAB_80K_GENCON,TAB_25M_GENCON;
    release channel c1;
    release channel c2;
    release channel c3;
    release channel c4;
    release channel c5;
    release channel c6;
    release channel c7;
    release channel c8;
    Any suggestion in this is helpful to me..
    Thanks in advance,

    Hello;
    I read your post and here's the thoughts that came to mind : ( my largest concern is you might restore something that damages your current system )
    1. So you want to restore the whole DB back to 12/06/2012 to get some tablespaces from then right?
    2. Are you restoring to a different system?
    3. How did you start the database ( NOMOUNT, MOUNT )
    4. If you are restoring the whole DB back to 12/06/2012 how did you restore the control file?
    5. Your command shows :
    restore tablespace SYSTEM,UNDO_GEN01,UNDO_GEN02,TAB_80K_GENCON,TAB_25M_GENCON;
    COMMENT : Generally I use recover tablespace for point in time recovery and use an auxilary destination.
    Meaning I don't use restore at all, in fact using restore may cause an issue.
    SUMMARY : I don't see how this will work as is.
    It seems you want data from five tablespaces from about six months ago including the SYSTEM tablespace.
    This is an Incomplete Recovery. I believe I would rethink this completely.
    Give the time that has past I would consider restoring the whole database to a different server where cannot damage anything.
    Once this is done I would decide how to get the data I need.
    Or I would check for a daily export file and recover the tablespace data that way.
    So you have some good details on your question but it seems the plan is either missing something or you need to add a few more details.
    Example
    I'm recovering old tablespaces into a test system.
    Here's how I'm not damaging my current production system.
    I don't have an export from that date.
    So take a step back and either rethink or give a few more details on how this is safe.
    Best Regards
    mseberg

  • Setting up archive delete functionalities using background job

    Hi,
    Through SARA transaction there we can set up a archive delete job by selecting the files, job timing details. Instead of this, we want to set up this functionality using a background job as per the variant and timing requirements.
    Is there any option to set up a background job of archive delete functionality by selecting the files through a program or function moduel. Please suggest me if anyone has done this in previous.
    Thanks,
    Siva

    Hello,
    Take a look at OSS note 205585 which describes how to schedule archive delete jobs indirectly using program RSARCHD.
    Hope this helps.
    Best Regards,
    Karin Tillotson

  • Message archiving/deletion in PI 7.1

    Hi All,
    I'm new to SAP PI. We have newly implemented PI 7.1 in our landscape. We have installed PI in HP UX 23 with oracle as the database.
    We have configured the messge archival/deletion in our PI production server. We have allocated a dedicated file system to store the archived messages. Eventhough we have maintained the path of the archival_interface, no messages are archived in this drectory.
    We are using synchronous interfaces and while executing the report ( RSXMB_SHOW_REORG_STATUS  ) as per the note 872388, the report says that there are more than 1700 messages to be archived. But no messages are getting archived in the path mention as of now.
    I think we have missed out some steps while configuring the archiving process. Can somebody help me with the steps involved in PI integration engine message archival/deletion.
    Your timely help will be much appreciated.
    Thanks in advance.
    Regards,
    Varadhu

    Hi,
    Go to transaction "SXMB_ADM" on the ABAP stack of your XI installation. Go to "Integration Engine Configuration" and click on tab "Specific configuration". Check if you have the parameter "LOGGING_SYNC" enabled (It should have a value 1). In case it is not present, please create this entry and have the default value as "1". This will enable you to view all sync messages on sxmb_moni.
    Thanks,
    Sidhartha

  • Issue with Archiving & Deletion of messages in PI ,SXMB_MONI messages

    Hello experts
    I am  working on Archiving & Deletion of messages in PI ,SXMB_MONI, i have fallowed all the steps which are avialable in /people/deepak.shah/blog/2010/04/22/archiving-deletion-of-messages-in-pi--part-2, but the messages still there in SXMB_MONI.
    please help me to resolve this issue.
    regards
    chandra

    Hi Krish
    i have fallowed steps like....
    in SXMB_ADM
    >>>step 1: Define the interface for archivng and retnetion period
    >>>step2):Schedule Archive Jobs,
    after this i have checked the in SM37 the jobs got sheduled and released after that it showing finished.
    >>>step3):ARV_BC_XMB_WRP<date> (archiving, step 1)
    ARV_BC_XMB_DEL<date> (archiving, step 2)
    here i am getting message like "0 XML messages got archived".
    "0 XML message for deleated".
    I have doubt in SXMBPMAST  table here when i check the status of interface , ITFACTION field is containing the value INIT and if I understood correctly it job deletes only those messages where ITFACTION is set to DEL.
    We are actually trying to delete the messages avoiding archiving but what I am seeing is we cannot delete error messages and for them we must have to go through archiving. Please correct me if I am wrong.
    Thanks
    Chandra

  • Import Format script required to update multiple fields

    Further to my previous post yesterday (Import Format script required to work across multiple fields I now need my import script to update multiple (two) fields at the same time, based on criteria set across multiple fields. So far, I can use DW.Utilities.fParseString to assess the values across multiple fields, but I now need to update not only the field in question, but also an additional field at the same time. For example:
    Function TBService(strField, strRecord)
    ' How do I update a second field at the same time?
    Dim strField2 As String
    If Left(strField, 1) = "S" Then
    If DW.Utilities.fParseString (strRecord, 3, 8, ",") = "B1110" Then
    strField2 = "N101"
    Else
    strField2 = "Network N/A"
    End If
    TBService = strField
    Else
    TBService = "Service N/A"
    End If
    End Function
    Is this even possible? Should I be looking at creating an event script which would work post-import? Or can this be done right here in the import script?

    All the logic you require can be encapsulated in the import script for the second field. You don't need to reference the second field in the first import script.
    Edited by: SH on May 2, 2012 5:39 PM

  • Archive / Delete Q-INFO records

    Hello ,
    Which object in sara code should i use/create to archive/delete Q info records ?
    Thx in advance .

    Hi
    I am not very sure about archiving of the Quality info record but
    Deletion is possible only by putting the Deletion Indicator to the same in T code QI02 screen -->"deletion Screen"
    I hope this will add some value.
    Regards
    Sujit

Maybe you are looking for