rman NOT BACKED UP SINCE TIME
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 8 of 8

Thread: rman NOT BACKED UP SINCE TIME

Hybrid View

  1. #1
    Join Date
    Jul 2006
    Posts
    195

    rman NOT BACKED UP SINCE TIME

    Can somebody tell me what is wrong with this rman command. When it run
    it's having a problem with the delete.

    rman < connect target /
    connect catalog rman/rman
    sql "alter system archive log current";
    backup filesperset 5 archivelog NOT BACKED UP SINCE TIME 'SYSDATE-1/24'
    format $FILE_DEST_ARCH
    delete input ;
    resync catalog;
    EOT

  2. #2
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,554
    Error message?
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

  3. #3
    Join Date
    Jul 2006
    Posts
    195
    RMAN>
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-00558: error encountered while parsing input commands
    RMAN-01009: syntax error: found "not": expecting one of: "all, from, high, like,
    logseq, low, scn, sequence, time, until"
    RMAN-01007: at line 1 column 37 file: standard input


    I looks like a syntax error but I just can't seem to get it correct. FYI, I am
    running 11.1.0.7.0 version of the DB

  4. #4
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,554
    I think the "NOT BACKED UP SINCE TIME" option is designed to be used at database level when restarting a failed backup and not wanting to backup the files already processed by failed attempt.

    Please somebody correct me if I'm wrong.
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

  5. #5
    Join Date
    Jul 2006
    Posts
    195
    Paul, thanks for your reply. I will try digging a bit further as I did not see
    that in the documentation

  6. #6
    Join Date
    Mar 2006
    Location
    Charlotte, NC
    Posts
    865
    Thou, it may not be answer to the actual question I am posting 2 recipes from "RMAN recipes for Oracle Database 11g" book ...

    7-25. Backing Up Only Those Files Previously Not Backed Up

    Problem
    You want to create a backup of only new files that have been recently added or those files that
    failed to get backed up during the normal backup schedule.

    Solution
    You can limit RMAN to backing up only specific files using the not backed up or since time
    clause within a backup command. Using the not backed up clause, you can instruct RMAN to
    back up only those datafiles or archived log files that were never backed up previously. Hereís
    the backup command that shows how to back up only previously backed-up files:
    RMAN> backup database not backed up;
    Starting backup at 15-NOV-06
    using channel ORA_DISK_1
    skipping datafile 1; already backed up on 14-NOV-06
    skipping datafile 2; already backed up on 14-NOV-06
    skipping datafile 3; already backed up on 14-NOV-06
    skipping datafile 4; already backed up on 14-NOV-06
    skipping datafile 5; already backed up on 14-NOV-06
    Finished backup at 15-NOV-06
    RMAN>
    You can also use the not backed up command with additional specifications such as the
    number of backups. The following example shows how to back up only those archived redo
    logs that were backed up less than twice on tape:
    RMAN> backup device type sbt archivelog all not backed up 2 times;
    RMAN considers only backups created on identical device type as the current backup when
    counting the number of backups it has already made. Thus, the not backed up clause is ideal for
    specifying the number of archived redo logs to be stored on a specific type of media. The previous
    example specifies RMAN to keep at least two copies of archived redo logs on tape.
    How It Works
    The backup ... not backed up command comes in handy when you add one or more new
    files and want to ensure that the new fileís contents are backed up soon rather than waiting for
    the regular scheduled time for backup.
    If youíre making backup sets (instead of image copies), RMAN considers the completion
    time for any file in the backup set as the completion time for the entire backupset. That is, all
    files in a backup set must have the same finishing time. Letís say youíre making a backup that
    involves multiple backup sets. If the target database crashes midway through a database
    backup, you donít have to start the backup from the beginning. You can use the not backed up
    since time command to back up only those datafiles that havenít been backed up since the
    specified time, as shown in the following example:
    RMAN> backup database not backed up since time 'sysdate-31';
    If you use the not backed up since time clause when you restart the RMAN backup,
    RMAN will skip backing up the files it already backed up prior to the instance failure. Recipe 7-26 explains this in more detail. If youíre using the since time clause, you can specify either a
    date in the nls_date_format or a SQL data expression such as sysdate-7. Note that RMAN considers
    only backups made on the same device type as the current backup when figuring out
    whether a new backup ought to be made.

    7-26. Restarting Backups After a Crash

    Problem
    The RMAN backup process fails midway through a database backup, say, because of a database
    instance crash or because of the unavailability of some datafiles. You want to resume the
    backup but save time by backing up only those parts of the database that failed to be backed
    up the first time.

    Solution
    Use the restartable backup feature to back up only those files that failed to be backed up the
    first time around. Use the not backed up since time clause of the backup command to restart a backup after it partially completes. If the time you specify for the since time clause is a more
    recent time than the backup completion time, RMAN backs up the database file.
    Hereís an example that shows how to restart an RMAN backup that failed midway through
    a nightly backup. You discover the backup failure in the morning and decide to back up only
    those parts of the database that werenít backed up by RMAN before the backup failed. Simply
    run the following backup command to achieve your goal.
    ■Note If you use the backup database not backed up command without the since time clause,
    RMAN backs up only those files that were never backed up before by RMAN.
    RMAN> backup not backed up since time 'sysdate-1'
    database plus archivelog;
    The previous backup command will back up all the database files and archivelogs that
    werenít backed up during the past 24 hours. Any database file or archivelogs that were backed
    up during the last 24 hours wonít be backed up again. You thus avoid backing up files you
    already backed up. When RMAN encounters database files that it had already backed up
    before the backup failed, it issues messages such as these:
    RMAN-06501: skipping datafile 1; already backed up on APR11 2007 20:12:00
    RMAN-06501: skipping datafile 2; already backed up on APR 11 2007 20:13:35
    RMAN-06501: skipping datafile 3; already backed up on APR 11 2007 20:14:50
    The backup command that produced this output used a SQL expression of type date
    (sysdate-1). You may also specify a date string as a literal string that matches the nls_date_
    format environment variable setting.
    How It Works
    The restartable backup feature backs up only those files that werenít backed up since a specified
    date and uses the last completed backup set or image copy as the restart point for the new
    backup. By using the restartable backup feature after a backup failure, you back up the parts
    of the database that the failed backup didnít back up. If your backup consists of multiple
    backup sets and the backup fails midway, you donít have to back up the backup sets that were
    already backed up. However, if your backup consists only of a single backup set, a backup failure
    means that the entire backup must be rerun.
    All the database files are affected when you place the not backed up since clause right
    after the backup command, as shown in our example. By placing the not backed up since
    clause after a specific backupset, you can limit the backup to only the objects that are part of
    the backup set.
    Itís important to understand that when considering the number of backups, RMAN takes
    into account only those backups made on an identical device as the device in the current
    backup command.
    Thanks,
    Vijay Tummala

    Try hard to get what you like OR you will be forced to like what you get.

  7. #7
    Join Date
    Apr 2001
    Location
    Bangalore, India
    Posts
    727
    That is a simple mistake.. "ALL" was missing..

    RMAN> backup filesperset 5 archivelog ALL NOT BACKED UP SINCE TIME 'SYSDATE-1/24' delete input ;

    Starting backup at 01-JUL-11
    current log archived
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=1154 device type=DISK
    Other comments...

    1) sql "alter system archive log current"; ==> is not required.

    Any archivelog backup will archive the current log as marked above.


    2) connect target /
    connect catalog rman/rman


    Both are connecting locally RMAN is in the target database?

    Thanks,
    Thomas Saviour(royxavier@yahoo.com)
    Technical Lead (Databases)
    Thomson Reuters (Markets)

    http://ora600tom.wordpress.com/

  8. #8
    Join Date
    Jul 2006
    Posts
    195
    Thomas thanks for the syntax correction. It works great now.
    Can closed :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width