DBAsupport.com Forums - Powered by vBulletin
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Hot Backup Questions

  1. #1
    Join Date
    Feb 2002
    Posts
    267

    Hot Backup Questions

    Hi,
    Whenever a tablespace is in hot backup mode, Oracle logs the entire image of the block into the Online redolog files.
    My question is does oracle logs the image before it is changed or after the block is changed ?...

    and one more question is, when i add a new datafile to the Tablespace which is in hotbackup mode is this datafile also in backup mode ?...
    what abt the blocks or extents which get allocated to this datafile ??

    anbody has got any idea ?

    Regards
    sonia

  2. #2
    Join Date
    Jan 2002
    Location
    Up s**t creek
    Posts
    1,525
    My understanding is as follows:

    When hot backups of tablespace datafiles are taken any updates continue as normal except file header blocks are not updated for checkpoints. When the backup is complete the header is updated for the last checkpoint so that the file is consistent with that point in time.

    As the OS copy may be inconsistent (as you may have made changes to the blocks) they require the archived logs to be applied as part of the recovery process to ensure they include all the changes missed during the begin and end stages of the backup process.

    Regards
    Jim
    Oracle Certified Professional
    "Build your reputation by helping other people build theirs."

    "Sarcasm may be the lowest form of wit but its still funny"

    Click HERE to vist my website!

  3. #3
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439

    Re: Hot Backup Questions

    Originally posted by Sonia
    Hi,
    Whenever a tablespace is in hot backup mode, Oracle logs the entire image of the block into the Online redolog files.
    Not quite. When a datafile is in hot backup mode, Oracle logs the entire image of the changed block into the Online redolog files only the first time this block is changed since the beginning of the hot backup mode. Any subsequent changes of that same block while the datafile is in backup mode will result only in change vectors being written to the redo log files, exactly the same way as when the datafile is not in backup mode.
    My question is does oracle logs the image before it is changed or after the block is changed ?...
    Redo logs record only the after-the-change informations.
    and one more question is, when i add a new datafile to the Tablespace which is in hotbackup mode is this datafile also in backup mode ?...
    No, the new datafile will not be in backup mode.
    what abt the blocks or extents which get allocated to this datafile ??
    What about them??
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  4. #4
    Join Date
    Feb 2002
    Posts
    267
    Hi
    Thanx Jmodic for the wonderful explination.

    and can u explain me, why does it has to freeze the header of the datafile when it is in hot backup mode. ???
    i mean what is the reason behind this ?

    thanx
    sonia

  5. #5
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    This is necessary to prevent split blocks.

    This phenomenon called split blocks occurs when during hot backup the blocks gets updated on disks. The copy in the backup file could be useless since the front and the back halves of a block may be written at different times.

    To prevent this Oracle logs the before image of a data block to the redo log file before the first change, so that it can be used to reconstruct a fractured block during recovery.

    The alter tablespace… begin backup command will begin logging entire block images on the first change to the block if the INIT.ORA parameter _LOGBLOCKS_DURING_BACKUP is set to true (which is the default value).

    This is necessary to recover from spilt blocks.

    HTH
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

  6. #6
    Join Date
    Feb 2002
    Posts
    267
    adewri,

    My question is what is ther reason behind freezig the datafile header ? why can't it be done without freezing the datafile header ?

    not abt why a hot backup is required.

    regards
    sonia

  7. #7
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    When you give alter tablespace begin backup command, checkpoint occurs for all datafiles in the HOT BACKUP. the datafile header checkpoints are advanced to the SCN captured when the begin backup command is issued. And this SCN goes in the backup file as well.

    Alter tablespace end backup command creates a redo record containing the begin backup checkpoint SCN. Also the datafile checkpoint is advanced to the database checkpoint.

    So from this redo record and the initial SCN in the backup datafile, oracle knows which all redo needs to be applied to the restored backup file to make it consistent.

    (correct me if im wrong)
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

  8. #8
    Join Date
    Jan 2001
    Posts
    2,828
    Originally posted by Sonia
    adewri,

    My question is what is ther reason behind freezig the datafile header ? why can't it be done without freezing the datafile header ?

    well the datafile headers contains the SCN that is why oracle freezes them..when recovery begins it is compared with the SCN in the controlfile that is how oracle will know where to start recovery for that tablespace..

    not abt why a hot backup is required.

    regards
    sonia
    was this your question? or am i missin somethin ?

  9. #9
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    Also my understanding is that when we give the alter tablespace end backup command all the redo generated during the backup is applied to the datafile to advance the datafile SCN to database SCN.

    The same has to be done to the backup file to bring it to consistent state, hence the header is freezed so that oracle knows that redo generated between the SCN at begin backup and end backup need to be applied. (More ever the blocks changed during the backup are rewritten from the redo)

    Or in other words if the SCN were not freezed, they would also be copied in the backup datafile. So how would oracle know if the datafile is inconsistent when its restored, as the SCN of the backup datafile would match the SCN at the alter tablespace end backup command. And Oracle uses SCN numbers to apply the redo.

    HTH
    Last edited by adewri; 02-18-2003 at 06:08 AM.
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

  10. #10
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    Originally posted by adewri
    Also my understanding is that when we give the alter tablespace end backup command all the redo generated during the backup is applied to the datafile to advance the datafile SCN to database SCN.
    Hi all,
    just asked tom and got this reply


    Also my understanding is that when we give the alter tablespace end backup
    command all the redo generated during the backup is applied to the datafile to
    advance the datafile SCN to database SCN.

    is absolutely wrong -- have you ever had an end backup ask you for an archive?
    Nope, never will - we constantly write to the datafiles during the hot backup.
    The SCN recorded in the header tells us how far back in the redo stream one
    needs to go to recover this file.


    Read the answer above again -- things like:

    ...
    Lets say they are and the OS blocking read factor is
    512bytes (the OS reads 512 bytes from disk at a time). The backup program goes
    to read an 8k Oracle block. The OS gives it 4k. Meanwhile -- DBWR has asked to

    rewrite this block. the OS schedules the DBWR write to occur right now. The
    entire 8k block is rewritten. The backup program starts running again
    (multi-tasking OS here) and reads the last 4k of the block.
    .....

    should definitely make it clear that the datafiles are WRITTEN do whilst they
    are being backed up (else we would not have this redo issue at all -- the
    logging of the full block image)
    had some doubt my self, i think its clear now
    Last edited by adewri; 02-21-2003 at 12:02 PM.
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

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