Script remove archives from standby after applied

Hello,
I am looking for a script to remove archivelog files from the standby flash recovery area after beeing applied.
My database is 11.2.0.3.3 on Linux Redhat 5.
Can someone kindly proovide me an example?
Thank you

RMAN does that for you :
RMAN>CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;
Then set the date to what you need and run as often as you need.
http://docs.oracle.com/cd/E18283_01/server.112/e17022/rman.htm#BAJHHAEB
#!/bin/bash
# Name: db_rman_arch_standby.sh
# Purpose: Delete archive from standby
# 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 rmancat/rmancat@rcatalog << EOF
delete noprompt ARCHIVELOG UNTIL TIME 'SYSDATE-1';
exit
EOF
echo `date`
echo
echo 'End of archive cleanup on STANDBY'
mailx -s ${MAILHEADER} $MAILTO < /tmp/rmandbarchstandby.out
. /u01/app/oracle/dba_tool/bin/rmemptyfolders.sh ${DBNAME}
# End of ScriptUses an ENV file ( standby.env ) for each database. Use Linux ENV to compare to your settings
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=vt100
export ORACLE_BASE ORACLE_SID ORACLE_TERM ULIMIT
export ORACLE_HOME
export LIBPATH LD_LIBRARY_PATH ORA_NLS33
export TNS_ADMIN
export PATHBest Regards
mseberg
Edited by: mseberg on Oct 25, 2012 4:58 AM

Similar Messages

  • Problem when removing elements from table after apply sort

    Hi,
    I have big problem with <af:table> and sorting.
    When I removed objects from a table without sorting, there is no problem but when I removed
    items from the table after sorting, the remain items are not correct.
    For example, i have in my table these items :
    Item AA
    Item CC
    Item ZZ
    Item BB
    Item AA
    Item BB
    Item CC
    Item ZZ
    I sort the table and i select the following Items : Item BB a Item CC
    The remains item is only Item AA, Item ZZ disappear.
    If i resort the table, the missing Item zz appear again in the table.
    Here is my jspx :
    <af:table var="row" rowBandingInterval="1" width="1050" rows="5"
    rowSelection="multiple"
    value="#{pageFlowScope.editNotificationBackingBean.ingredients}"
    binding="#{pageFlowScope.editNotificationBackingBean.ingredientsTable}"
    autoHeightRows="10" id="t2">
    <af:clientListener method="goEditRow" type="dblClick"/>
    <af:serverListener type="doubleClickOnRow" method="#{pageFlowScope.editNotificationBackingBean.handleRequestIngredientsSelectBtn_action}"/>
    <af:column headerText="#{bundle.col_fr_name}" width="240"
    sortable="true" sortProperty="name.FR_Description" id="c1">
    <af:outputText value="#{row.name.texts['fr'].value}" id="ot1"/>
    </af:column>
    In my backing bean i call this method to remove selected elements :
    public void unselectBtn_action(ActionEvent actionEvent) {
    RowKeySet rowKeySet = selectIngredientsTable.getSelectedRowKeys();
    int i = 0;
    Iterator it = rowKeySet.iterator();
    while (it.hasNext()) {
         Integer index = (Integer)it.next() - i;
    selectIngredientsTable.setRowKey(index);
    CompositionIngredient compositionIngredient =
    (CompositionIngredient)selectIngredientsTable.getRowData();
    notification.getProductDetail().getCompositionIngredients().remove(compositionIngredient);
    i++;
    selectIngredientsTable.getSelectedRowKeys().clear();
    AdfFacesContext.getCurrentInstance().addPartialTarget(selectIngredientsTable);
    Thanks in advance.

    I have made a mistake, i don't paste the right <af:table> from my jspx.
    Here is the correct one :
    <af:table var="row" rowBandingInterval="1" width="1050"
    rowSelection="multiple" id="tableSelectedIngredients"
    value="#{pageFlowScope.editNotificationBackingBean.notification.productDetail.compositionIngredients}"
    binding="#{pageFlowScope.editNotificationBackingBean.selectIngredientsTable}"
    partialTriggers="::tab_ingredients_list_expressed_per">
    <af:column sortable="true" headerText="#{bundle.col_name}" id="c5" width="180"
    sortProperty="ingredient.name.FR_Description">
    <af:outputText value="#{row.ingredient.name.texts['fr'].value}"
    id="ot18"/>
    </af:column>
    ...

  • Clearing out archivelogs from Flash_recovery_area after applied on Standby.

    I set up a standby database using data guard in 11g. I used the flash_recovery_area to store archivelogs, but really the true destination of all my archivelogs should and is my standby database. I didnn't have any other backup(s) setup yet. After few days, my database stopped because it ran out of space in flash_recovery_area. I had to add more space to db_recovery_dest_size just to get the database back up. Then I set the archivelog deletion policy in rman to delete archivelogs after applied on all standby.
    Is that all I need to do keep my flash_recovery_are clean enough to prevent from locking my database again, or is there something else I need to do? This is just a dev box, and I'm trying to stay away from setting up rman backup process with delete option.
    Thanks in advance,
    Kyle

    Kyle;
    Sorry because I'm not answering the question you asked. But I had the same problem with a similar setup.
    What I decided was to use RMAN to backup the primary and have the RMAN script remove archive after a week.
    On the standby I created an RMAN script to remove archive only.
    There's not much to it and at the end I add a seperate remove empty folder script.
    echo "Starting RMAN..."
    $ORACLE_HOME/bin/rman target / catalog <user>/<password>@<catalogdb> << 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
    . /u01/app/oracle/dba_tool/bin/rmemptyfolders.sh ${DBNAME}
    # End of Script

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

  • Remove Mail from mailbox after accepting mail by another guy

    I have an requirement in such way that if one employee accpets the mail, mail should get removed from mail box of other employee.
    Mail are the MS-Outlook mails and all employee are group together in one address book.
    In second scenario, if employee sent one mail (For ex. Leave application) it goes to two high level. If first level try to approve it at time it should prompt error message that second level approval is pending.
    Please let me know is it possible through ABAP or workflow?
    Thanks in stack

    Hi Nilesh,
    <i>at first I don't really have very good news for you:</i>
    Removing mails from Outlook is a microsoft feature and does only work when developing an appropriate application for this one. Removing mail items also prerequesites that an Outlook template/form is used and it is not a "mail" object anyways.
    Solving the problem this way would possibly exceed any one's project's budget.
    <i>The better news is:</i>
    What you might think about is the Outlook-Connector for SAP which comes with the Frontend-CD that opens up in a separate "inbox", which refreshes from the SAP's workitem inbox. If a certain workitem disappears it will also disappear (after the refresh time) from the outlook's inbox as well.
    As I have said in one of my posts before I'm still not sure if that interface product is still activly supported by the SAP. Furthermore I have experienced certain curious effects that came up, e.g. that read-notifications from the last years have been sent once again. Also consider more network traffic etc.
    For the second scenario you where asking, you should think about opening a new thread and a bit of more detailed information about what you are asking exactly.
    Best wishes,
    Florin

  • Remove music from iPhone after enabling iCloud/match

    After enabling iCloud and iTunes Match, then after having some songs downloaded on my iPhone, I want to cycle some out and pull new ones down. However, I do not see how I can remove music from my iPhone. If I delete the playlist, the entire playlist is wiped from my master iTunes library, which removes it from all devices that use iCloud/Match.
    How do I selectively control what stays on my iPhone?
    Thanks,
    Derek

    If that is on, I highly recommend looking at th KB article: http://support.apple.com/kb/TS4054
    Specifically:
    Make sure iTunes Match is turned on.
    Please see this article for information about turning on or adding a computer or device to iTunes Match.
    If iTunes Match is already enabled on your computer or device, try turning iTunes Match off and then on again.
    On your Computer choose Store > Turn Off iTunes Match, then Store > Turn On iTunes Match.
    On your iOS device tap Settings > Music > iTunes Match Off, then Settings > Music > iTunes Match On.
    And sadly, you apparently can delete a song from Match from your phone.
    I am sorry, but no, you can't. If that were true, you would no longer see the song in your music library on your computer, and it would most likely be gone forever. The only way to remove an item from iTunes Match:
    To delete an item from iCloud in iTunes
    From a computer with iTunes Match enabled, open iTunes 10.5.1 or later on your computer. You can download the latest version of iTunes here.
    Click Music on the left side of iTunes.
    Select the item you would like to delete. Right-click the item and then choose Delete.
    You will be asked to confirm this action.
    If the item you want to delete exists in iTunes on your computer as well as in iCloud, click the checkbox to also delete the item from iCloud.
    Match is a train wreck. They need to make it work simply and intuitively.
    I don't disagree with you on this.

  • K8t Neo2 problem with resume from standby after BIOS flash

    Previously while using the 3.2 BIOS and a Winchester 3200+, Both Standby and hibernation worked perfectly almost without fail.  Since I flashed the BIOS to 9.3 and installed an X2 4200+ I have had a problem with resume from standby.  The machine starts up OK but the 2nd processor core (cpu1) is almost maxed out and stays that way.  Task manager shows total cpu load as about 45-50% (all on cpu1) but shows no running process using any cpu load, just the usual System Idle process at about 99%.  The only way to get it back down to normal again seems to be to reboot.  By Contrast Hibernation works fine, with no increase in cpu load after resume.  I have all the latest MS patch's installed (I think!) the AMD dual core driver and the MS and AMD dual core optimizers.  Any ideas what is going on?

    Noticed last night that S! standby seems to work OK.  Also was experimenting with a fresh windows install on a spare hard drive (checking on another problem).  The fresh windows install appeared to work with S4 hibernation, so it looks like that is the answer to that problem.  However the problem with high cpu load on the second core after resume from S3 suspend to RAM standby was still present.  This problem is so specific and so repeatable (it does it every time without fail), that I feel there must be some very well defined reason for it.  Unfortunately I have no ideas what could be wrong. Have now tried Windows re-install, latest cpu drivers, AMD dual core optimizer, MS dual core optimizer, Cool'n'quite disabled/enabled, and various others and suspend to RAM still gives the same behaviour

  • Removing characters from string after a certain point

    Im very new to java programming, so if this is a realy stupid question, please forgive me
    I want to remove all the characters in my string that are after a certain character, such as a backslash. eg: if i have string called "myString" and it contains this:
    109072\We Are The Champions\GEMINI
    205305\We Are The Champions\Queen
    4416\We Are The Champions\A Knight's Tale
    a00022723\We Are The Champions\GREEN DAYi would like to remove all the characters after the first slash (109072*\*We...) leaving the string as "109072"
    the main problem is that the number of characters before and after is not the always the same, and there is often letters in the string i want, so it cant be separated by removing all letters and leaving the numbers
    Is there any way that this can be done?
    Thanks in advance for all help.

    You must learn to use the Javadoc for the standard classes. You can download it or reference it on line. For example [http://java.sun.com/javase/6/docs/api/java/lang/String.html|http://java.sun.com/javase/6/docs/api/java/lang/String.html].

  • S540 Wake up from Standby after moving the device?

    Hy, I have a problem with my S540. It turns into standby after closing, but wakes up if I move the device. Is that normally? Can anybody prove that with ist own device?

    Hey Zyzx,
    I have seen this type of condition before in a USB connected printer.  How do you have the printer connected to the Windows XP Home Edition desktop PC?  (USB or Network connected)
    If the printer is connected by a USB cable, then you may try a different USB port on the PC and uninstalling/re-installing the USB Controller on the PC.
    To perform the uninstall/re-install of the USB controll follow the steps listed below.
    Boot into Safe Mode on the PC
    Click on the Start menu of the PC
    Right Click on My Computer
    Select Manage out of the list
    Select Device Manager in the list on the left
    Right click on the section titled "Universal Serial Bus controllers" and select Properties
    Uninstall the section and restart the PC to perform the re-install
    I will look into this issue more for you and get back with you.
    -------------How do I give Kudos? | How do I mark a post as Solved? --------------------------------------------------------
    I am not an HP employee.

  • Remove message from AQ after reading?

    I have created a java message driven bean that it equaling an AQ. The AQ has been created with multiple_subcriber=&gt;true.
    How can I manage that the message is been removed after it has been distributed to the MDB?

    Hi,
    From your description, you use Exchange 2007 SP2, I recommend you use the following cmdlet to suspend these messages.
    Get-TransportServer | Get-Queue | Get-Message -ResultSize unlimited | where{$_.Subject -eq "xx" -and $_.Queue -notlike "*\Submission*"} | Suspend-Message
    For more information, here is a blog for your reference.
    Removing specific messages from your Exchange Server
    http://blogs.technet.com/b/exchange/archive/2010/10/27/removing-specific-messages-from-your-exchange-server.aspx
    Hope it helps.
    Best regards,
    Amy Wang
    TechNet Community Support

  • How to remove apps from iTunes after they have been removed from iPod Touch

    If I remove an app from my iPod Touch, they still exist in iTunes. After a while, they can add up and take up lots of space on my computer. What's the easiest way to remove ALL apps that no longer exist on my iPod Touch but are still in iTunes? I currently just manually go through the list to delete them from iTunes, which seems to work, but is there a better, more efficient way?

    Anna,
    Your suggestion of using the Control key does not work on a Mac.
    On a Mac, one can:
    1. Use your Command-(Apple) key to select items that are not in consecutive order. It's appropriately called a "non-consecutive select".
    2. Use your Shift key to select consecutive items.
    3. Or use your mouse to perform what's called a "lasso" select. Click your mouse/clicker down while dragging over the items you'd like to select, and then drag them to the trash.
    Gramps.

  • How do it remove songs from iphone after I downloaded via iMatch?

    I am using iMatch. How do I removed some of the songs to free up the sapces of my iPhone after I downloaded from the cloud?

    if next to the song appears a cloud, then this song is not downloaded on your device (it's not taking any space). On the other hand, if you have downloaded the song, you just need to delete it as the other songs, by swiping from right to left

  • Remove button from pdf after saving

    Hello, in my PDF form, I have a button. This button has the following script that I got via this forum, great!
    for (var i=0; i<this.numFields; i++) { 
        var f = this.getField(this.getNthFieldName(i)); 
        if (f==null) continue; 
        f.readonly = true; 
    app.execMenuItem("SaveAs")
    So what it actually does, is to make all form fields "non editable"and show a save as button after that so users can save the filled in PDF.
    But since after saving the PDF is read only, how can I make it in this way that the "button save as" with the script above, is not showing anymore in the generated PDF. This is a read only PDF now, so this button is no longer of use to show and also not to print.
    How do I do this in acrobat pro.
    Thank you all!

    Add this at the end of the code:
    event.target.display = display.hidden;

  • How to remove data from page after submitting the page?

    Hi,
    I am using API to create person record.After submitting the create page the data are still
    showing on that page.
    How to remove data after submitting the page?
    Please suggest.
    Regards,
    Sagarika

    Abdul,
    Your solution is perfect if the UIX beans on the page do not have BC4J binding with a VO attribute, otherwise, Sumit's soution is appropriate.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                               

  • ITunes match remove music from device after period of time?

    Hi
    I've been having a problem with iTunes match where it seems to remove copies of my music from my iOS devices (iPhone 4s and iPad 2) every so often (seems to be about every 90 days). I've noticed though that any songs I bought off iTunes on the device or have downloaded from the purchased section off iTunes are not deleted. Has anyone else experienced this and is there a way to turn it off so files are kept?
    Thanks :)

    If that is on, I highly recommend looking at th KB article: http://support.apple.com/kb/TS4054
    Specifically:
    Make sure iTunes Match is turned on.
    Please see this article for information about turning on or adding a computer or device to iTunes Match.
    If iTunes Match is already enabled on your computer or device, try turning iTunes Match off and then on again.
    On your Computer choose Store > Turn Off iTunes Match, then Store > Turn On iTunes Match.
    On your iOS device tap Settings > Music > iTunes Match Off, then Settings > Music > iTunes Match On.
    And sadly, you apparently can delete a song from Match from your phone.
    I am sorry, but no, you can't. If that were true, you would no longer see the song in your music library on your computer, and it would most likely be gone forever. The only way to remove an item from iTunes Match:
    To delete an item from iCloud in iTunes
    From a computer with iTunes Match enabled, open iTunes 10.5.1 or later on your computer. You can download the latest version of iTunes here.
    Click Music on the left side of iTunes.
    Select the item you would like to delete. Right-click the item and then choose Delete.
    You will be asked to confirm this action.
    If the item you want to delete exists in iTunes on your computer as well as in iCloud, click the checkbox to also delete the item from iCloud.
    Match is a train wreck. They need to make it work simply and intuitively.
    I don't disagree with you on this.

Maybe you are looking for

  • Problem with i Message

    After I changed the language, I have to sign in with my Apple ID again, but it goes always back to the Sign in Screen. I dont know why, it always worked. I only can send and Get messeges from my iPod (4th Generation, IOS 6.1.2) Please forgive me my B

  • Download iOS 5.0

    How can I download iOS 5.0 on my first generation iPad? I cannot download any new angry birds.

  • BI Content 3.5.3 and xRPM 4.0

    Hi I am currently working on xRPM 4.0. I need to know that can we use BI Content 3.5 on the source system(R/3 4.7) as a plugin with xRPM 4.0. In the xRPM masterguide it states BI content 7.0 version is required. Also will it create any consistency is

  • 4 level Approval workflow

    Hi Experts, I am working on a scenario where in a junior account manager creates a quotation and then changes the status to waiting for approval.On this a mail is to be triggered to the Account manager for approval.If the account manager approves thi

  • Socket Connection reset error

    i hava a server serving multiple clients. sometimes while reading data from the client by the thread, it is throwing an exception as follows: java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:168) at