How to delete the standby archive log files in ASM?

Hi Experts
we have a realtime downstream replication that is using the a location in ASM to put the shipped logs files.
set up by
ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='LOCATION=+BOBOASM/NANPUT/standbyarchs/
VALID_FOR=(STANDBY_LOGFILE,PRIMARY_ROLE)' Scope=BOTH;
What shall i do to clean up those files ?
Any procedure or script to do that?
Thanks

Hello Haggylein
check this out, seems to work
--- redologs used or not?
---- when purgeable we can delete it
COLUMN CONSUMER_NAME HEADING 'Capture|Process|Name' FORMAT A15
COLUMN NAME HEADING 'Archived Redo Log|File Name' FORMAT A25
COLUMN FIRST_SCN HEADING 'First SCN' FORMAT 99999999999
COLUMN NEXT_SCN HEADING 'Next SCN' FORMAT 99999999999
COLUMN PURGEABLE HEADING 'Purgeable?' FORMAT A10
SELECT r.CONSUMER_NAME,
r.NAME,
r.FIRST_SCN,
r.NEXT_SCN,
r.PURGEABLE
FROM DBA_REGISTERED_ARCHIVED_LOG r, DBA_CAPTURE c
WHERE r.CONSUMER_NAME = c.CAPTURE_NAME and PURGEABLE = 'YES';
-- Now the script
-- to be executed on the downstream database
-- generate the list of logs to be purged and executed in a ksh script
-- sqlplus "/as sysdba" @$HOME/bin/generate_list.sql
SET NEWPAGE 0
SET SPACE 0
SET LINESIZE 150
SET PAGESIZE 0
SET TERMOUT OFF
SET ECHO OFF
SET FEEDBACK OFF
SET HEADING OFF
SET MARKUP HTML OFF SPOOL OFF
spool list_purgeable_arch_redologs.ksh
SELECT 'asmcmd ls ' || r.NAME
FROM DBA_REGISTERED_ARCHIVED_LOG r, DBA_CAPTURE c
WHERE r.CONSUMER_NAME = c.CAPTURE_NAME and PURGEABLE = 'YES';
spool off
exit
# eventually we can call it from a script
# !ksh
# delete of the shipped redologs
# to be performed on node 2
# not to be used on
$HOME/bin/export ORACLE_SID=+ASM2
./list_purgeable_arch_redologs.ksh
exit

Similar Messages

  • How to correct the corrupted archive log files?

    Friends,
    Our restore method is cloning type.
    today i fired this statement(this is one is usually do for the restore) "recover database until cancel using backup controlfile"
    i have 60 files in the archive folder.
    it executs only 50 files when it comes to 51st file it came out and says could not copy the file.
    is that particular file is corrupted?
    or is there any restriction in copying no of archivelog files? i mean only 60 files like that.....
    suppose if the archive file is corrupted how can i correct it?
    thanks
    sathyguy

    Now, this is the error message....
    ORA-00310: archived log contains sequence 17480; sequence 17481 required
    ORA-00334 archived log; '/archive2/OURDB/archive/ar0000017481.arc'i googled....and find out.....
    ORA-00310 archived log contains sequence string; sequence string required
    Cause: The archived log is out of sequence, probably because it is corrupted or
    the wrong redo log file name was specified during recovery.
    Action: Specify the correct redo log file and then retry the operation.so...from the above error messages.....i think the particular archive file(17481) is corrupted. now can i correct this corrupted archive file.
    According to the above action, it says to specify the correct redo log file. if the file is not corrupted then where should i specify the redo log file's path?
    thanks
    sathyguy

  • Deleting the old Archive Log Files from the Hard Disk

    Hello All,
    I want to delete the old archive files of Oracle. These files are very old and consuming very huge disk space.
    Is there any way by which I can delete these files from the Hard Disk?
    Can I directly delete them using the Operating System Command?
    Will it cause any dilfference to the normal functioning of my Database?
    If I need to delete these files, do I need to bring the database down?
    Please guide me.
    I need to do this activity to make some space free on the Hard Disk.
    Thanks in advance.
    Himanshu

    Hi.
    Keep archived logs from time of last backup and forward to currenct time on disk together with the backup itself. And keep older archived logs together with older warm/cold backupfiles on tape as long as there is enough capasity or following your recovery strategy. This way you might be able to roll forward a recovery without restoring these files from tape which often the faster.
    Older archived logs can be deleted manually, with scheduled OS script or automatically with RMAN.
    Good luck
    rgds
    Kjell Ove

  • How to delete archive log files from ASM through Grid Control

    Hi
    Anybody suggest me how to delete archive log files from ASM through Grid Control.
    Thanks

    It is important to specify both, the oracle version and os version when posting, so confusions can be avoided.
    In this particular case, since you are referring to asm and grid control you could be talking about either 10gR1, 10gR2 or 11gR1; but I strongly suggest you to avoid us to be guessing. In either case, you sould go to the maintenance tab of the target database and program a scheduled 'delete noprompt obsolete;' procedure. This will purge the information stored at the Flash recovery area, which I assume you have declared inside the ASM.
    ~ Madrid
    http://hrivera99.blogspot.com/

  • How to remove archive log files from ASM managed 11g R2 database?

    Hi,
    I am planning to automate deletion of older archive log files from my 11g R2 Production instance which is ASM managed.
    Also want to remove the archive log files files from standby database.
    Please provide your inputs on how can I remove the older archive log files.
    Regards,
    Avinash

    Greetings
    Did you check RMAN,
    RMAN>show all;
    CONFIGURE RETENTION POLICY . . . .
    CONFIGURE ARCHIVELOG DELETION POLICY TO [CLEAR | NONE | APPLIED ON STANDBY];
    DELETE NOPROMPT EXPIRED ARCHIVELOG ALL;
    DELETE NOPROMPT ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-10';
    This will be part of your RMAN Backup scripts/process
    Check the urls below:
    11gRel2:
    http://download.oracle.com/docs/cd/E11882_01/backup.112/e10642/rcmmaint.htm#BRADV90079
    http://download.oracle.com/docs/cd/E11882_01/backup.112/e10642/rcmmaint.htm#BRADV89634
    10g:
    http://download.oracle.com/docs/cd/B19306_01/backup.102/b14193/toc.htm#sthref45
    http://download.oracle.com/docs/cd/B19306_01/backup.102/b14191/rcmconc1.htm#i1008093
    http://download.oracle.com/docs/cd/B19306_01/backup.102/b14192/maint003.htm#sthref712
    Regards & Thanks
    BN

  • How to recover a lost archive log file?

    How to recover a lost archive log file? Do I need to open the database with RESETLOGS after recovery?-------No.156

    I think he might rewrite the question in his own words.
    I guess in the event of lost archive logs during db recovery, you have to open RESETLOGS and say goodbye to some of the data.

  • How to delete the specified line in file?

    How to delete the specified line in file? In case of deleting a specified line in a file, how to do?
    Line 1
    Line 2
    Line 3
    Line 4
    Line 5
    The case is a file including the above content. Now I wanna to delete the "Line 3" and how to realize the action in Java?

    An alternative solution can be :
    import java.io.LineNumberReader;
    import java.io.IOException;
    import java.io.File;
    import java.io.FileReader;
    import java.io.BufferedWriter;
    import java.io.FileWriter;
    import java.io.PrintWriter;
    public class LineDeleter {
    public static void main(String args[]){
    try {
    //suppose you want to delete line 3
         int lineToBeDeleted = 3;
         File f = new File("line.txt");
         long fileSize = f.length();
    //Wrap the FileReader with a LineNumberReader. It will help you
    //identify the lines.
    LineNumberReader lnr = new LineNumberReader( new FileReader(f));
    //Wrap the FileWriter object with BufferedWriter object. Create it with the buffersize
    //equal to the file size.
         BufferedWriter bw = new BufferedWriter(new FileWriter(new File("line1.txt")),(int)fileSize);
    //Wrap BufferedWriter object with PrintWriter so that it allows you
    //to print line by line
    PrintWriter pw = new PrintWriter(bw);
         String s=null;
         while ( (s=lnr.readLine())!=null ){
              System.out.println(s);
              int lineNumber = lnr.getLineNumber();
    //match the line number
              if(! (lineNumber==lineToBeDeleted)){
                   pw.println(s);
              pw.flush();
              lnr.close();
              pw.close();
         catch(Exception e){System.out.println(e);}
    If you want you can rename the line1.txt to the original file name.
    I hope this helps.Good luck!!!!!!

  • How to restore cold backup + archived log files

    Hi,
    Suppose I take a cold backup on 18th. After that I have four days of archived log files. if the database crashes on 5th day, I have to restore the 18th cold back + 4 days of archived log files. How do I restore since it is a cold backup and I cant do incomplete recovery.
    can I use
    Recover database ( with 18th cold backup) in mount state and apply archived logs.
    Prabhath

    The details of how you perform forward recovery using a cold backup depends on
    1- rman or manual backup
    2- using current or backup control file
    3- if rman, recovery catalog or no recovery catalog
    4- if full database recovered or only a few files
    Each of these conditions will affect what is known to Oracle and what needs to be done. For example if you restored the entire cold backup including the control file then Oracle would see a consistent database and not need to perform recovery so you would need to startup mount and tell the database to perform recovery using a backup control file. If using rman and no recovery catalog you might need to catalog some of the archived redo logs, etc....
    It is advisable to consult the Backup and Recovery manuals before attempting recovery for any new scenario.
    HTH -- Mark D Powell --

  • How to delete the beginning of a file?

    Hi,
    is there a way to delete the beginning of a file, or do I have to copy the rest of the file and create a new one and then delete the old one?
    Lets say my file contains "ThisIsMyFile" and I want to delete "This", so that my new file contains "IsMyFile", how can I do this?
    thanx

    You have to copy.

  • How does one name an Archive Log file in ARC%S_%R.%T format

    Hallo!I have been trying to enable Archive Log mode for the Oracle 10g database.
    In OEM,I went via the links Maintenance->Recovery Settings->Media Recovery
    There,a text box by the name Log Archive Filename Format requires one to name the Archive Log file in ARC%S_%R.%T format.
    I have tried several times to name the Archive log e.g ARC001_001.001 but when I shutdown and restart the database instance,the error below appears
    ORA-19905: log_archive_format must contain %s, %t and %r.
    This error has proved impossible to rectify and I am forced to uninstall then re-install Oracle 10g.
    I would like to have back-ups in archive log mode.Please give me the best way to name the Archive Log file i.e with an example name so that I can have online back-ups.
    Thanks.

    Hi,
    If you try to change the LOG_ARCHIVE_FORMAT to something other than the default %s,%t,%r, it will fail
    Perform as the below steps in order to enable archive log mode
    SQL>create pfile from spfile
    SQL>create pfile='c:\temp\init.ora' from spfile;
    SQL>created;
    SQL>shutdown immediate;
    edit the init.ora file by adding the following information
    *.LOG_ARCHIVE_DEST_1='LOCATION=C:\db\archive1'
    *.LOG_ARCHIVE_FORMAT='%t_%s_%r.dbf'
    Start the DB with modified pfile.
    - Pavan Kumar N
    Edited by: Pavan Kumar on May 2, 2010 2:17 PM

  • How to delete the unused Archive mailbox ?

    Hi ... How can I delete the unused Archives mailbox in Mail ?

    After taking another look at your first post, it does not appear that you are using iCloud.
    What I can tell you is that Apple changed the way Archive folders are displayed at some point. That Archive folder is part of the main mailbox system just as the Draft mailbox is. You have no option to delete a main mailbox in Mail. If you have archived messages, they should appear in that mailbox. If you archive messages from more than one account, subfolders will appear under the Archive mailbox which will tell you which account the messages are archived in. Even local mailbox messages will appear as an On My Mac sub account.
    Since your picture does not show an arrow next to it indicating a sub account, it would indicate archives from only one account. If you have no messages in it, then it should disappear following the instructions in my first reply until it is need in the future. This will also apply to the Draft mailbox if you have no draft messages in it.
    I understand you said that didn't work for you and you said you have no messages in it. What I do see in your illustration is that you also have an Archive folder under your IMAP account. Is that a folder you created and named Archive?  If messages within that folder are truly archive messages, they should appear in the main Archive mailbox and not under the IMAP account folder. Maybe that folder is somehow interfering with the main Archive mailbox. If you have no messages in that particular folder, try deleting it and then repeat the procedures in my first reply. If you do have messages in it, select them and archive them from Mail. It should move them to the main archive folder. Then you can delete that folder.
    As I said, archived messages should only appear under the main Archive mailbox and not different archive folders under the IMAP account folders.

  • How to monitor the successful archive log shipment to the standby database

    Hello,
    From the primary database, which data dictionary do I view to get information whether the standby database has received and processed the archive logs from the primary database. Both databases are 11202 on linux. Another question, which views on the primary database contain a flag sent by the standby database to the primary database to let the primary database knows that the standby database is up and functional? My purpose is to query the primary database for infomation that tell me the standby database is alive and functioning. I want to only query the primary database for these information about the standby database. Thank you in advance.

    watson2011 wrote:
    Hello,
    From the primary database, which data dictionary do I view to get information whether the standby database has received and processed the archive logs from the primary database. Both databases are 11202 on linux. Another question, which views on the primary database contain a flag sent by the standby database to the primary database to let the primary database knows that the standby database is up and functional? My purpose is to query the primary database for infomation that tell me the standby database is alive and functioning. I want to only query the primary database for these information about the standby database. Thank you in advance.You can troubleshoot standby by views as
    v$managed_standby (standby)
    v$dataguard_status
    v$dataguard_stats
    Some of the new views are introduced from 11g, check below link too
    http://docs.oracle.com/cd/B28359_01/server.111/b28294/views.htm#i79129

  • Some how i deleted the line that lits file, etc. i was wondering how to put it back.

    i accidentally deleted or removed the line that has file, history, etc. And i was wondering how to replace it. ive gone to firefox properties and even ugraded to the newest version but it didnt bring the tabs back. how do i recover them?

    That's the Menu Bar, and users can hide it in Firefox versions 3.6+
    '''<u>Menu Bar</u>''' (File, Edit, View, History, Bookmarks, Tools, Help)<br /> Firefox 3.6.x versions allow the user to hide the Menu Bar.<br />
    *Tap the ALT key or the F10 key, Menu Bar will display, click View, click Toolbars, click Menu Bar to place a check mark next to it, '''''OR'''''
    *Press and hold the ALT key while pressing the letters VTM on your keyboard, then release the ALT key
    *See: http://support.mozilla.com/en-US/kb/Menu+bar+is+missing
    '''<u>Other Toolbars</u>''', see: https://support.mozilla.com/en-US/kb/Back+and+forward+or+other+toolbar+items+are+missing<br />
    '''<u>Status Bar</u>''': click View, click Status Bar to place a check mark<br />
    '''<u>Full Screen Mode</u>''': If you have no Toolbars or Tab Bar: Press F11 (F11 is an on/off toggle). See: http://kb.mozillazine.org/Netbooks#Full_screen<br />
    Also see: http://kb.mozillazine.org/Toolbar_customization_-_Firefox#Restoring_missing_menu_or_other_toolbars
    <br />
    The information submitted with your question indicates that you have out of date plugins with known security and stability issues that should be updated. To see the plugins submitted with your question, click "More system details..." to the right of your original question post. You can also see your plugins from the Firefox menu, Tools > Add-ons > Plugins.
    *Adobe Shockwave for Director Netscape plug-in, version 11.5
    *Adobe PDF Plug-In For Firefox and Netscape "9.3.3"
    *Shockwave Flash 10.1 r82
    *Next Generation Java Plug-in 1.6.0_15 for Mozilla browsers
    #'''Check your plugin versions''': http://www.mozilla.com/en-US/plugincheck/
    #*'''Note: plugin check page does not have information on all plugin versions'''
    #'''Update Shockwave for Director'''
    #*NOTE: this is not the same as Shockwave Flash; this installs the Shockwave Player.
    #*Use Firefox to download and SAVE the installer to your hard drive from the link in the article below (Desktop is a good place so you can find it).
    #*When the download is complete, exit Firefox (File > Exit)
    #*locate and double-click in the installer you just downloaded, let the install complete.
    #*Restart Firefox and check your plugins again.
    #*'''<u>Download link and more information</u>''': http://support.mozilla.com/en-US/kb/Using+the+Shockwave+plugin+with+Firefox
    #'''Update Adobe Reader (PDF plugin):'''
    #*From within your existing Adobe Reader ('''<u>if you have it already installed</u>'''):
    #**Open the Adobe Reader program from your Programs list
    #**Click Help > Check for Updates
    #**Follow the prompts for updating
    #**If this method works for you, skip the "Download complete installer" section below and proceed to "After the installation" below
    #*Download complete installer ('''if you do <u>NOT</u> have Adobe Reader installed'''):
    #**Use the links below to avoid getting the troublesome "getplus" Adobe Download Manager and other "extras" you may not want
    #**Use Firefox to download and SAVE the installer to your hard drive from the appropriate link below
    #**Click "Save to File"; save to your Desktop (so you can find it)
    #**After download completes, close Firefox
    #**Click the installer you just downloaded and allow the install to continue
    #***Note: Vista and Win7 users may need to right-click the installer and choose "Run as Administrator"
    #**'''<u>Download link</u>''': ftp://ftp.adobe.com/pub/adobe/reader/
    #***Choose your OS
    #***Choose the latest #.x version (example 9.x, for version 9)
    #***Choose the highest number version listed
    #****NOTE: 10.x is the new Adobe Reader X (Windows and Mac only as of this posting)
    #***Choose your language
    #***Download the file, SAVE it to your hard drive, when complete, close Firefox, click on the installer you just downloaded and let it install.
    #***Windows: choose the .exe file; Mac: choose the .dmg file
    #*Using either of the links below will force you to install the "getPlus" Adobe Download Manager. Also be sure to uncheck the McAfee Scanner if you do not want the link forcibly installed on your desktop
    #**''<u>Also see Download link</u>''': http://get.adobe.com/reader/otherversions/
    #**Also see: https://support.mozilla.com/en-US/kb/Using+the+Adobe+Reader+plugin+with+Firefox (do not use the link on this page for downloading; you may get the troublesome "getplus" Adobe Download Manager (Adobe DLM) and other "extras")
    #*After the installation, start Firefox and check your version again.
    #'''Update the [[Managing the Flash plugin|Flash]] plugin''' to the latest version.
    #*Download and SAVE to your Desktop so you can find the installer later
    #*If you do not have the current version, click on the "Player Download Center" link on the "'''Download and information'''" or "'''Download Manual installers'''" below
    #*After download is complete, exit Firefox
    #*Click on the installer you just downloaded and install
    #**Windows 7 and Vista: may need to right-click the installer and choose "Run as Administrator"
    #*Start Firefox and check your version again or test the installation by going back to the download link below
    #*'''Download and information''': http://www.adobe.com/software/flash/about/
    #**Use Firefox to go to the above site to update the Firefox plugin (will also install plugin for most other browsers; except IE)
    #**Use IE to go to the above site to update the IE ActiveX
    #*'''Download Manual installers'''.
    #**http://kb2.adobe.com/cps/191/tn_19166.html#main_ManualInstaller
    #**Note separate links for:
    #***Plugin for Firefox and most other browsers
    #***ActiveX for IE
    #'''Update the [[Java]] plugin''' to the latest version.
    #*Download site: http://www.oracle.com/technetwork/java/javase/downloads/index.html (Java Platform: Download JRE)
    #*Also see "Manual Update" in this article to update from the Java Control Panel in Windows Control Panel: http://support.mozilla.com/en-US/kb/Using+the+Java+plugin+with+Firefox#Updates
    #* Removing old versions (if needed): http://www.java.com/en/download/faq/remove_olderversions.xml
    #* Remove multiple Java Console extensions (if needed): http://kb.mozillazine.org
    #*Java Test: http://www.java.com/en/download/help/testvm.xml

  • How to keep the old jdbc log file

    Hi,
    whenever I restart the wls8.1, the jdbc logs are rewritten. I could not find my
    previous log to debug anymore, how can i config to make write to a new file like
    wls log. Thanks

    Hi Jen!
    This is bug in 8.1ga and sp1 and it is fixed ib 81sp2.
    When you specify jdbc log name with ".log" suffix, jdbc logging doesn't
    rotate as expected. So, the prior log file would be overwrited by new jdbc
    log when you restart WLS.
    Workaround
    Remove ".log" from the file name. It would be added by WLS automatically.
    Thanks,
    Mitesh
    Jen wrote:
    Hi,
    whenever I restart the wls8.1, the jdbc logs are rewritten. I could not find my
    previous log to debug anymore, how can i config to make write to a new file like
    wls log. Thanks

  • How to Monitor the size of log file (Log4j) During its Generation.

    i have made a program using log4j technology. Now i want to know that is there any method that i can restrict the size of the log file. for example if the size of generating log file exceeds the restricted size then it should be placed in backup and a new file should be automatically generate and remaining contents should be written in that file.
    is there any method that can monitor the size of file during the generation of that (say) log file.
    Waiting for ur Urgent response

    I have wrote that code
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
    <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
    <appender name="appender" class="org.apache.log4j.FileAppender">
    <param name="File" value="c:\\abc.txt"/>
    <param name="MaxFileSize" value="100B"/>
    <param name="MaxBackupIndex" value="3"/>
    <param name="Append" value="false"/>
    <layout class="org.apache.log4j.SimpleLayout"></layout>
    </appender>
    <root>
    <priority value ="debug"/>
    <appender-ref ref="appender"/>
    </root>
    </log4j:configuration>
    When i run it it gave me error Message
    log4j:WARN No such property [maxFileSize] in org.apache.log4j.FileAppender.
    log4j:WARN No such property [maxBackupIndex] in org.apache.log4j.FileAppender.

Maybe you are looking for

  • JDBC to Synchronous ABAP Proxy

    Hello, I have one scenario where i am sending data from JDBC Adapter(Communication Channel 1) to ABAP Proxy(Sync)(Communication Channel 2) and as response ABAP Proxy send back data to JDBC Adapter(Communication Channel 3). So is it possible without B

  • I no longer have access to the e-mail address that icloud wants me to use to verify the account with. what do I do?!?!

    I have backed up all of my contacts and messages with icloud but I no longer have access to the e-mail I used for my apple ID to create the account. icloud won't work since i cannot verify the account. HELP. how do I change the e-mail?

  • Query on Correct Toplink Usage for insert/update

    Hi, I have a JSF based web application where-in my backing bean is having the Toplink generated enities as managed properties. i.e. the Toplink entity is being populated by the JSF value binding. Now when I want to insert/update this entity, what app

  • How do you overlay the audio from a clip over a iphoto slideshow clip ?

    How do you overlay the audio from a clip over a iphoto slideshow clip ? I want the audio from a video clip to be playing over the jpg/slideshow iphoto images ...so you see the slideshow elements but do not see the clip but do here the audio ! thanks

  • 70% of all album art disappeared??

    You gotta be kidding me! I recently had to get a new hard drive. But I had to make a copy of my iTunes file folder & drop it back into the iTunes library. This is the only thing I can think of that may have wiped away the album art but only about 30%