Delete flashback log dynamically.

i want to delete flashback log dynamically.
suppose today is 1st feb while running shell script it will remove flashback log 31stjan ...
i have set retention policy 1 days.
following is the my sh script
=====================
#!/bin/sh
# Daily Backup
. oraenv.oratest
export NLS_DATE_FORMAT="Dy DD-Mon-YYYY HH24:MI:SS"
LOG_DIR="/var/log/oracle"
LOG_FILE="$LOG_DIR/$ORACLE_SID-daily-backup.log"
EMAIL_TO="[email protected]"
echo -e "\nBackup Commenced: " $(date) "\n"
pushd $HOME/rman
rman target / cmdfile="daily-backup.rman" log="$LOG_FILE" append
retcode=$?
if [ "$retcode" -ne "0" ]; then
echo -e "\n***\n*** BACKUP FAILURE: Database $ORACLE_SID on $HOSTNAME \n***"
mail -s "BACKUP FAILURE: Database $ORACLE_SID on $HOSTNAME" $EMAIL_TO < $LOG_FILE
exit 1
else
mail -s "INFO: Backup success: $ORACLE_SID on $HOSTNAME" $EMAIL_TO << EOF
Database $ORACLE_SID on $HOSTNAME backed up successfully.
EOF
fi
popd
echo -e "\nBackup Completed: " $(date) "\n"
rman script
run {
# Remove any obsolete files prior to backup
crosscheck backupset;
crosscheck copy;
delete noprompt obsolete;
delete noprompt expired backup;
delete noprompt expired copy;
# Incremental backup and update of current image copy
allocate channel oem_disk_backup device type disk;
recover copy of database with tag 'ORA\$OEM_LEVEL_0';
delete noprompt obsolete;
delete noprompt expired backup;
delete noprompt expired copy;
backup incremental level 1 cumulative copies=1 for recover of copy with tag 'ORA\$OEM_LEVEL_0' database;
# Following backup - remove any now-obsolete files
delete noprompt obsolete;
delete noprompt expired backup;
delete noprompt expired copy;

RMAN cannot delete flashback logs, these are maintained automatically according to parameter 'db_flashback_retention_target'. Don't confuse FLASHBACK DATABASE with RMAN point-in-time recovery.
RMAN backups become obsolete as soon as no longer needed to meet the defined retention policy, 'delete obsolete' will never delete flashback logs.

Similar Messages

  • Automatically Deleting Flashback logs

    Hi all,
    Platform: oracle 10g R2, Win 2003 server
    Is there a way someone can delete flashback logs automatically without doing it the normal way?
    The normal way: startup nomount
    alter database flashback off;
    My manager said I can keep on shutting down the database, he wants it done automatically.
    Any help please???
    Thanks.
    Creems

    Hi,
    Set the parameter DB_FLASHBACK_RETENTION_TARGET initialization parameter which determines exactly how far a database can be flashed back. The default value is 1440 minutes (one full day), but this can be modified to suit the needs of your database.

  • Problem with deleting Flashback logs

    Hi all,
    I configured flashback database on my Oracle10g R2 DB that sits on Win 2003 server.
    When I issued the command to delete the flashback logs I see that the logs are not deleted.
    Please what could be the problem here?
    Regards,
    Creems

    Sorry, I should be clearer.
    My flashback retention target is 1 day - 1440 ... but that doesnt get deleted automatically, ERROR from Oracle so I hear.
    So, I tried to do it manually by putting the DB in mount state and issuing:
    ALTER DATABASE FLASHBACK OFF;
    Yet never get deleted.
    What could the problem be?
    Thanks.
    Creems

  • Oracle not using space occupied by flashback logs

    Hi,
    oracle 10g R2 10.2.0.1 on RHEL 4 64-bits.
    my db_flashback_retention_target is set to 1440 and my db_recover_file_dest_size is set to 40G.
    flashback logs are occupying about 36G so whenever rman tries to backup the database, it breaks saying it cannot reclaim enough space from the 40G limit.
    when checking the flashback logs,i saw that the DB is keeping 3 day old logs. should it not reclaim the space occupied by these logs and delete them?

    Others have reported similar issues: http://www.wayneadamsconsulting.com/
    >
    One thing that I have not seen the database do, however, is delete reclaimable flashback logs in order to make room for a backup. If there is not enough free space in you FRA for a backup but there is plenty of space used by relcaimable flashback logs, RMAN and the database will not delete flashback logs to free up room in the FRA for the backup. This seems like a fairly large gap in the flashback log functionality, but hopefully Oracle will handle it in a future release.
    >
    See MOS note: Space issue in Flash Recovery Area( FRA ) [ID 829755.1] .
    Note also that 10.2.0.1 is a old 10.2 release and that you could consider upgrading to 10.2.0.4.

  • Remove the flashback logs in EBS envoirnment.

    Hi,
    In my production database(primary) machine flashback is ON.
    So, logs are creating in following directory:
    /d01/silprod/SILP/db/apps_st/data/archives/SILP01_SER/flashback
    In my physical standby database flashback is OFF.
    So, My question is that:
    Can I remove the flashback logs from production safely?
    Thanks.

    Hi,
    How to identified that which archive logs no longer needed and can delete, and how to reclaim the archive space?
    Is below steps are correct?
    Archive location: /d01/silprod/SILP/db/apps_st/data/archives/SILP01_SER/archivelog
    Archive files name like: o1_mf_1_894_5jpkly8k_.arc -------------> Sequence#=894
    Archive Size occupied:
    > du -sh archivelog/ ------------> 2.7G archivelog/
    STEP#1:
    SQL> SELECT THREAD#, SEQUENCE# FROM V$LOG WHERE STATUS='CURRENT'; -----------> RESULT: THREAD#=1 AND SEQ$= 894
    SQL> ALTER SYSTEM ARCHIVE LOG CURRENT;---------------->DONE
    SQL> SELECT THREAD#, SEQUENCE# FROM V$LOG WHERE STATUS='CURRENT'; -----------> RESULT: THREAD#=1 AND SEQ$= 895
    Confirm the current file have been applied to the standby database with the below query
    SQL> SELECT MAX(SEQUENCE#) FROM V$LOG_HISTORY; -----------------> RESULT: THREAD#=1 AND SEQ$= 894
    Step#2:(Memory)
    > delete unwanted archive log files from disk (rm, del commands)---------> all archives files deleted expected of PROD_1_894.arc
    RMAN> crosscheck archivelog all; - marks the controlfile that the archives have been deleted
    RMAN> delete expired archivelog all; - deletes the log entries identified above.
    But, How to identified that which flashback files no longer needed and can delete, and how to reclaim the flashback space?
    Flashback location: /d01/silprod/SILP/db/apps_st/data/archives/SILP01_SER/flashback
    Flashback files name like: o1_mf_5jlc8gb0_.flb, o1_mf_5jlcb2bv_.flb etc ------------> how to identified which file(File Name has no sequence#) should I delete?
    Flashback Size occupied:
    > du -sh flashback/ ------------> 3.5G flashback/

  • How to Force Flashback Logs to Grow

    Hi, I want to test RMAN and Oracle's handling of disk space over time as a database is used, specifically flashback logs.
    For this I want to increase the size of the flashback logs and see oracle delete the old flashback logs as the sizes grow. Is there a way to force the flashback logs to grow? Or at least an efficient way to do it? I know flashback logs are block level deltas of my datafiles but I don't want to modify the entire database to generate flashback data.
    Thanks

    Hi,
    Is there a way to force the flashback logs to grow? Or at least an efficient way to do it? I know flashback logs are block level deltas of my datafiles but I don't want to modify the entire database to generate flashback dataThe size of flashback logs generated by the database for a given time period can vary considerably, however, depending on the specific database workload.
    When flashback is in use, a before image of each block that is updated is copied to the flashback log ; this only needs to be done once since no matter how many times the same block is updated as, if we flash back, we only care about the initial contents of the block. The size of the before image will be the same as db_blocksize. So the key to understanding how much flashback data will be generated is not just how much redo is generated but how many physical blocks are updated. If more blocks are affected by database updates during a given interval, then more disk space is used by the flashback log data generated for that interval and you will find that the size of the flashback data may greatly exceed the size of the redo generated.
    Read it:
    CALCULATE THE VOLUME OF FLASHBACK LOG GENERATION [ID 761126.1]
    Regards,
    Levi Pereira

  • Excessive flashback log generates with select statement

    Hi everyone;
    We have some extractions taken from a "flashback on" database.
    Extractions are just select statements but when they are run, database produces excessive flashback logs.
    What may be the reason database produce flashback logs with just select statements?
    (It's certain that there are no insert-update-delete operations)
    Version: 10.2.0.4.3
    Thanks...

    Do you do heavy update/delete before you select the statements ?
    I am not very sure if delayed block cleanout also have the same effect on flashback logs but the output below is leading me to think that way
    HR@ORACOS> select * from v$flashback_database_stat;
    BEGIN_TIME        END_TIME          FLASHBACK_DATA    DB_DATA  REDO_DATA ESTIMATED_FLASHBACK_SIZE
    20100527 15:32:53 20100527 15:50:16      875266048 1207132160 2038729728                        0
    20100527 14:32:50 20100527 15:32:53      248160256  127295488  450139648               1.3215E+10
    20100527 13:32:48 20100527 14:32:50       10452992   15646720    4400640               1.5549E+10
    20100527 12:32:43 20100527 13:32:48      745693184  948461568 1311620608               2.2789E+10
    20100527 11:25:56 20100527 12:32:43     1262026752 1984741376 2358546432               2.7212E+10
    HR@ORACOS> set autotrace traceonly statistics
    HR@ORACOS>  update base_table_np set y='INVALID';
    commit;
    4021808 rows updated.
    Statistics
           2512  recursive calls
        8341430  db block gets
        4069140  consistent gets
         120569  physical reads
    1908471980  redo size
            848  bytes sent via SQL*Net to client
            793  bytes received via SQL*Net from client
              3  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
        4021808  rows processed
    HR@ORACOS> set autotrace off;
    HR@ORACOS> select * from v$flashback_database_stat; 
    HR@ORACOS>
    BEGIN_TIME        END_TIME          FLASHBACK_DATA    DB_DATA  REDO_DATA ESTIMATED_FLASHBACK_SIZE
    20100527 15:32:53 20100527 16:00:36     1236664320 2021974016 4019910656                        0
    20100527 14:32:50 20100527 15:32:53      248160256  127295488  450139648               1.3215E+10
    20100527 13:32:48 20100527 14:32:50       10452992   15646720    4400640               1.5549E+10
    20100527 12:32:43 20100527 13:32:48      745693184  948461568 1311620608               2.2789E+10
    20100527 11:25:56 20100527 12:32:43     1262026752 1984741376 2358546432               2.7212E+10
    HR@ORACOS> set autotrace traceonly statistics
    HR@ORACOS> select * from base_table_np;
    4021808 rows selected.
    Statistics
            139  recursive calls
              0  db block gets
          53908  consistent gets
           4404  physical reads
        1652384  redo size                                                  ------->delayed block cleanout effect
      175008833  bytes sent via SQL*Net to client
          88996  bytes received via SQL*Net from client
           8045  SQL*Net roundtrips to/from client
              4  sorts (memory)
              0  sorts (disk)
        4021808  rows processed
    HR@ORACOS> set autotrace off
    HR@ORACOS> select * from v$flashback_database_stat;    ----flashback data size increases
    HR@ORACOS>
    BEGIN_TIME        END_TIME          FLASHBACK_DATA    DB_DATA  REDO_DATA ESTIMATED_FLASHBACK_SIZE
    20100527 15:32:53 20100527 16:01:11     1305264128 2054594560 4021728256                        0
    20100527 14:32:50 20100527 15:32:53      248160256  127295488  450139648               1.3215E+10
    20100527 13:32:48 20100527 14:32:50       10452992   15646720    4400640               1.5549E+10
    20100527 12:32:43 20100527 13:32:48      745693184  948461568 1311620608               2.2789E+10
    20100527 11:25:56 20100527 12:32:43     1262026752 1984741376 2358546432               2.7212E+10Basically what I do is I update a 4 million table big redo generated with flashback logs
    When I do select after the update I still see the redo generated because of delayed block cleanout but what I also see is the slight increase in flashback data size (check the first row of flashback_database_stat) which suits what you asking for. Select statement generates flashback log
    Tested on 11.2.0.1 with single active session on the db
    Coskan Gundogar
    Blog: http://coskan.wordpress.com
    Twitter: http://www.twitter.com/coskan
    Linkedin: http://uk.linkedin.com/in/coskan
    ---------

  • Flashback log purge

    Hi
    I`ve set db_recovery_file_dest_size to 20m and flashback retention target to 60mins.
    As far as I know flashback logs are automatically deleted when the fra is filled up.
    I notice that there are 4 flashback logs and they are never deleted in the last two days.
    What is the reason for that ?
    log_1.287.760141739
    log_2.281.759973635
    log_2.285.760141745
    log_3.298.760145161

    It only possible it will reuse it.
    Most of the time it will create a new log from my experience.
    It all depends on your settings.
    I watch v$flash_recovery_area_usage fairly close on my systems and the flashback logs are a fairly small piece of my FRA.
    Archive and RMAN backups use up most of the space. For the most part I let Oracle just handle the flashback logs.
    Best Regards
    mseberg
    Query I like for this :
    SELECT
      ROUND((A.SPACE_LIMIT / 1024 / 1024 / 1024), 2) AS FLASH_IN_GB,
      ROUND((A.SPACE_USED / 1024 / 1024 / 1024), 2) AS FLASH_USED_IN_GB,
      ROUND((A.SPACE_RECLAIMABLE / 1024 / 1024 / 1024), 2) AS FLASH_RECLAIMABLE_GB,
      SUM(B.PERCENT_SPACE_USED)  AS PERCENT_OF_SPACE_USED
    FROM
      V$RECOVERY_FILE_DEST A,
      V$FLASH_RECOVERY_AREA_USAGE B
    GROUP BY
      SPACE_LIMIT,
      SPACE_USED ,
      SPACE_RECLAIMABLE ;And
    column FILE_TYPE format a20
    select * from v$flash_recovery_area_usage;Edited by: mseberg on Aug 24, 2011 9:01 PM

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

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

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

  • How to delete records from dynamic internal table.

    Hi Experts,
    Need urgent help!!!
    Issue is with Dynamic internal tables.
    Below is code written by me :
    FORM select_query USING Lw_tabnam
                      TYPE  t682i-kotabnr.
      DATA :  lw_line  TYPE REF TO data,
              lw_line1 TYPE REF TO data.
        CREATE DATA Lw_line    TYPE (lw_TABNAM).
        ASSIGN      Lw_line->* TO   <WA_tbl>.
        CREATE DATA LW_LINE    TYPE STANDARD TABLE OF (Lw_tabnam)
                               WITH NON-UNIQUE DEFAULT KEY.
        ASSIGN      Lw_line->* TO <TBL>.
        SELECT * FROM  (Lw_tabnam)
                 INTO CORRESPONDING FIELDS OF TABLE <TBL>
                 WHERE (t_keys).
    Endform.
    code is working fine.
    here even the table name and where condition are dynamic,everything is fine upto this point.
    Now i have to delete some record from <TBL> based on some conditons.
         for ex : ( here lc_fieldname is KUNNR)
          loop at t_kunnr.
              lw_tabix = sy-tabix.
            Read table <tbl>
                    with key (lc_fieldname) = t_kunnr-kunnr ASSIGNING <wa_tbl>.
            If sy-subrc = 0.
            *Delete
            delete <tbl> from <wa_tbl>
    delete <tbl> index  lw_tabix.
            Endif.
         Endloop.
    The above delete statement doesn't work ,even we can't use index as it gives a syntax error " something related to "index is not allowed in standard table or hash table.
    Can you help me ab't how to delete records in Dynamic internal table?
    Other option that i am thinking of is to create a static table of type dynamic table.
    means, data itab type standard table of <tbl> .I know the syntax is wrong ,however is there any way to do this?
    Thanks in advance ,
    If you have any suggestion ab't this then do let me know.
    bye,
    Gaurav.

    Hi
    I wrote this code and it works fine:
    DATA LW_TABNAM(10) VALUE 'LFA1'.
    DATA : LW_LINES TYPE REF TO DATA,
           LW_LINE  TYPE REF TO DATA.
    FIELD-SYMBOLS: <TABLE> TYPE TABLE,
                   <WA>    TYPE ANY.
    CREATE DATA LW_LINES TYPE TABLE OF (LW_TABNAM)
    WITH NON-UNIQUE DEFAULT KEY.
    ASSIGN LW_LINES->* TO <TABLE>.
    CREATE DATA LW_LINE TYPE (LW_TABNAM).
    ASSIGN LW_LINE->* TO <WA>.
    DO 10 TIMES.
      APPEND INITIAL LINE TO <TABLE>.
    ENDDO.
    SY-TABIX = 4.
    DELETE <TABLE> INDEX SY-TABIX.
    WRITE SY-SUBRC.
    I hope it help you
    Max

  • GRC:AC:SPM: How to ensure SAP_ALL in not deleting FF log files?

    Hi Guys,
    Due to some critical business requirements occuring occasionally, I wanted to set up a FF ID having SAP_ALL. This would be besides the other FF IDs, which I have already created for each of the modules. I.e basically this SAP_ALL FFID would be to handle emengency and cross module tasks.
    Now, I have a limitation here that this FFID having SAP_ALL profile may do anything and then even clear all the logs for what all it did (as it would have unlimited access to even delete the logs for FFID usage). Any workaround solution for this?
    Regards.
    Hersh.
    http://www.linkedin.com/in/hersh13

    Zaheer is exactly correct. The main point of SAP_ALL is to be (almost) unrestricted and that is why it is recommended to not assign it.
    Although Firefighter allows you to gain elevated access in a controlled manner, if you just assign firefighter ID's SAP_ALL then you will be allowing that access in the systems effectively, invalidating any controls which you had there previously.
    There are loads of ways of trimming SAP_ALL but I would generate a role based on the SAP_ALL template and de-activate the key authorisations (GRCFF_0001).
    Simon

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

  • Why the flashback log'size smaller than the archived log ?

    hi, all . why the flashback log'size smaller than the archived log ?

    Lonion wrote:
    hi, all . why the flashback log'size smaller than the archived log ?Both are different.
    Flash logs size depends on parameter DB_FLASHBACK_RETENTION_TARGET , how much you want to keep.
    Archive log files is dumped file of Online redo log files, It can be either size of Online redo log file size or less depending on online redo size when switch occurred.
    Some more information:-
    Flashback log files can be created only under the Flash Recovery Area (that must be configured before enabling the Flashback Database functionality). RVWR creates flashback log files into a directory named “FLASHBACK” under FRA. The size of every generated flashback log file is again under Oracle’s control. According to current Oracle environment – during normal database activity flashback log files have size of 8200192 bytes. It is very close value to the current redo log buffer size. The size of a generated flashback log file can differs during shutdown and startup database activities. Flashback log file sizes can differ during high intensive write activity as well.
    Source:- http://dba-blog.blogspot.in/2006/05/flashback-database-feature.html
    Edited by: CKPT on Jun 14, 2012 7:34 PM

  • Deleting obsolete logging tables in SLT system

    Hi Experts,
    Need help to sort out below issue,
    There are many obsolete logging tables in SLT system ,might have been left out after dropping SLT schemas, previous replications.
    These logging tables exist in ABAP dictionary but not in database. Due to this, it shows inconsistencies in DB02 > Diagnostics > Missing Tables and Indexes. There are in total 252 missing tables in DB. Currently DB migration is stuck due to this issue.
    Is there any way to remove the tables from dictionary without deleteing them manually through SE14 ?
    How to avoid having such tables ? Am I missing any steps while deleting the previous schemas?
    Regards
    Kartik

    Hi Kartik,
    these obsolete objects/logging could be also there becasue someone refreshed/copied the systems.
    There is also one transaction IUUC_REMOTE in the source system to delete the logging tables. But I am not sure if it distinguish between db or ddic level. Have a try and post the result.
    Best,
    Tobias

  • How to delete archive log on standby site

    hi
    i configured dataguard on 10g. could anyone suggest how to delete archived log on standby site..

    Hi,
    There is no automatic feature out-of-the-box but you have the following views:
    1) Shows archive logs transfered:
    select sequence#, first_time, next_time from v$archived_log order by sequence#;
    2) Shows archive logs applied:
    select sequence#, archived, applied from v$archived_log order by sequence#;
    If you see your archivelogs applied you can safely remove archive log files from your disk. It is your decision if you keep or delete them completely.

Maybe you are looking for

  • *Soap TO RFC  :-Empty SOAP RESPONSE*

    Dear Friends,                         I am doing a SOAP TO RFC scenario.And while testing the scenario using SOAP UI TOOL the response is EMPTY its like this. <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">    <SOAP:Header/>   

  • Incorrect number of color values Error

    Hi All, I am getting an error stating "Incorrect number of color values was given" in the following Indesign Script. var currentPage = myDocument.pages.item(0); var myColor = myDocument.colors.add(); myColor.colorValue = [82,60,0,0]; var recFrame = c

  • AVI geht nicht

    Hallo habe das problem das Pr CC meine AVI nicht nimmt der WMP und der VLC player liest es. Habe eine AVI Code Pack installiert aber geht immer noch nicht. Was kann ich tun? LG Micha

  • Cannot verify signature block SecurityException during version update

    Hi all, I have my application installed on few systems using webstart. All the jars(including third party are signed by my certificate). After that, during an update, I signed all the jars using a new certificate. I have placed new jars in the cache

  • Play/Pause magic?

    My new 2nd Gen. 1 GB shuffle arrived today and it seems to be fine except trying to play/pause during a song or book seems to do nothing. I have had a 40 GB iPod for over a year and it's been fine and worked as expected. If I have a song playing and