Results 1 to 10 of 10
  1. #1
    Join Date
    Sep 2003
    Location
    canada
    Posts
    230

    Unanswered: Rollforwarding problem

    I am working with db2 v8.2 aix 5.2
    I am doing restore from online backup when I enter :
    db2 "rollforward db dbadb to 2004-11-11-10.59.14.000000 and stop"
    I get massages;

    The stoptime passed to roll-forward must be greater than or equal to
    "2004-11-11-15.59.36.000000", because database "DB_NAME" on node(s) "0" contains
    information later than the specified time.

    where this "2004-11-11-15.59.36.000000", comes from, the time is 5 hours ahead of backup image time stamp, please help

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Looks like a timezone problem... what is the backup timestamp?

    When a backup is created its timestamp is set using local time. However, in your command (ROLLFORWARD .. TO <timestamp>) time is assumed to be universal.

    Try: ROLLFORWARD .. TO <timestamp> USING LOCAL TIME
    Last edited by n_i; 11-11-04 at 15:55.

  3. #3
    Join Date
    Sep 2003
    Location
    canada
    Posts
    230
    Quote Originally Posted by n_i
    Looks like a timezone problem... what is the backup timestamp?
    Hi n_i, Thank you for your reply, the backup timestamp is :
    20041111105921 and when I do query staus I get

    db2 "rollforward db db_name query status using local time"

    Rollforward Status

    Input database alias = db_name
    Number of nodes have returned status = 1

    Node number = 0
    Rollforward status = DB working
    Next log file to be read = S0000003.LOG
    Log files processed = -
    Last committed transaction = 2004-11-11-10.59.14.000000

  4. #4
    Join Date
    Mar 2003
    Posts
    343
    As far as I know, you have to supply GMT to the rollforward command. Is the timezone of where you are located 5 hours behind GMT?

    Eitherways, supply the timestamp that is returned. I have done so and successfully rolled forward.

    Hope this helps.

  5. #5
    Join Date
    Sep 2003
    Location
    canada
    Posts
    230
    Quote Originally Posted by cchattoraj
    As far as I know, you have to supply GMT to the rollforward command. Is the timezone of where you are located 5 hours behind GMT?

    Eitherways, supply the timestamp that is returned. I have done so and successfully rolled forward.

    Hope this helps.
    I am living in Canada, Ontario, you are right if I use the prompted time stamp it will work but if I want to rolforward to 11 AM (backup has been taken at 8 PM ) should I add 3 hours to 2004-11-11-15.59.36.000000 and rollforward to
    2004-11-11-18.59.36.000000?

  6. #6
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by M_RAS
    backup has been taken at 8 PM
    Quote Originally Posted by M_RAS
    backup timestamp is : 20041111105921
    so, which statement is true?

    Anyway, to roll forward to 11am EST on Nov. 11 you need to run:
    Code:
    db2 "rollforward db dbadb to 2004-11-11-10.59.14.000000 using local time and stop"
    provided of course that the timezone on your machine is set to EST.

  7. #7
    Join Date
    Sep 2003
    Location
    canada
    Posts
    230
    Quote Originally Posted by n_i
    so, which statement is true?

    Anyway, to roll forward to 11am EST on Nov. 11 you need to run:
    Code:
    db2 "rollforward db dbadb to 2004-11-11-10.59.14.000000 using local time and stop"
    provided of course that the timezone on your machine is set to EST.
    8 AM was just sample but when i used 2004-11-11-10.59.14.000000 I got masage That I should use 2004-11-11-15.59.26.000000 or bigger ,it is 5 hours ahead I need just 3 hours ahead, should I use
    2004-11-11-18.59.14.000000 ?

  8. #8
    Join Date
    Mar 2004
    Posts
    448
    The backup time of the image is the local server time, according to time zone, which is also the DB2 server time


    In unix , we set it using TZ variable.Use echo $TZ to find it.

    Now what is your DB2 server time zone in other word, the question is what time should I use to rollforward.

    The rollforward command needs CUT or GMT time.

    If you use db2 values current time zone , you will get like 50000 which means your local time is 5 hours ahead of GMT(CUT time).

    so for your rollforward command , you should use.

    Your local time - db2 values current time zone +/- 1 (if you are using daytime saving time).

    Your db2diag.log file also shows your DB2 server local time (Unix time).
    Same can be same to history file.

    So why DB2 uses this CUT time, because it keeps track of LSN with
    this CUT time to make a single global time.

    regards

    Mujeeb

  9. #9
    Join Date
    Sep 2003
    Location
    canada
    Posts
    230
    Quote Originally Posted by bmujeeb
    The backup time of the image is the local server time, according to time zone, which is also the DB2 server time


    In unix , we set it using TZ variable.Use echo $TZ to find it.

    Now what is your DB2 server time zone in other word, the question is what time should I use to rollforward.

    The rollforward command needs CUT or GMT time.

    If you use db2 values current time zone , you will get like 50000 which means your local time is 5 hours ahead of GMT(CUT time).

    so for your rollforward command , you should use.

    Your local time - db2 values current time zone +/- 1 (if you are using daytime saving time).

    Your db2diag.log file also shows your DB2 server local time (Unix time).
    Same can be same to history file.

    So why DB2 uses this CUT time, because it keeps track of LSN with
    this CUT time to make a single global time.

    regards

    Mujeeb
    Thank you Mujeed your information was very usefull, I am a lit bit confused, it means in rollforward command I should use "using local time" cluse ? could you please explain more.
    Thanks alot for your help

  10. #10
    Join Date
    Mar 2004
    Posts
    448
    local time is an option, but remember that its the server time(not client time). I never used the local time in my rollforward(recover command is
    introduced in ver8.2).But I have seen DBA's using local time all the time.
    Also,the db2diag.log file in v8.2 also shows the difference between the local time and the cut time.

    regards

    Mujeeb

Posting Permissions

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