Forum Stats

  • 3,767,747 Users
  • 2,252,712 Discussions
  • 7,874,326 Comments

Discussions

How to specify recovery timestamp where DB in another timezone

Duncan Gardner
Duncan Gardner Member Posts: 122
edited Apr 10, 2019 6:02AM in Recovery Manager (RMAN)

I have a DB that is being recovered. The box it is being recovered on is in timezone GMT+8 Australia West).

It is a recovery of a database created in GMT+10 (actually Australia EST, so has daylight savings)

The source and recovery DB both have DBTIMEZONE = 10.

I need to recover the DB to 01-nov-2018 23:55 - as specified in the source DB

If I run this, will it recover to 23:55 in GMT+10 or GMT+8 (which would be 01:55 on Nov 2nd)?

run {

set until time "to_date('01 nov 2018 23:55:00','dd mon yyyy hh24:mi:ss')";

recover database}

If I run this before invoking rman, will that sort it out?

export TZ=Australia/Sydney

Tagged:

Answers

  • f10r1n-Oracle
    f10r1n-Oracle Posts: 60 Employee
    edited Apr 10, 2019 4:42AM

    Hi,

    RMAN uses the host time for backup and restore. If your backup is completed at 20:00:00 and you move the piece to a different timezone it should know to transform that completion_time string to the new timezone...20:00:00 +- x hours.

    Best approach would be to do below:

    run {

    set until time "to_date('01 nov 2018 23:55:00','dd mon yyyy hh24:mi:ss')";

    restore database preview}

    and

    run {

    set until time "to_date('02 nov 2018 01:55:00','dd mon yyyy hh24:mi:ss')";

    restore database preview}

    And see what backup pieces are being used for restore and recover...based on the completion_time of each piece.

    Regards

  • Dude!
    Dude! Member Posts: 22,826 Black Diamond
    edited Apr 10, 2019 6:02AM

    Time is relative . However, RMAN uses the current time and recorded time. The date and time when RMAN starts a backup is the time of the instance performing the backup. A recorded time does not change because you change your current time zone. Hence, if you need to restore and recover a database to a previous point in time, simply specify the time you need - whether or not the past or recorded time was in a different timezone is irrelevant. For example, if you need to restore a past backup from 11 PM, that's the time you would use in your "set until" statement.