question regarding alter system switch log file
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 7 of 7

Thread: question regarding alter system switch log file

Hybrid View

  1. #1
    Join Date
    Feb 2001
    Posts
    114
    Hi Friends,
    My question is regarding alter sysem switch log file.
    Assuming that I will put my 5 tablespaces in backup mode.
    Then I do an OS copy of the datafiles to second location.
    I take out the tablespaces out of Backup mode.

    To generate the archived log files i connect internal and the do alter system switch log file.

    If I have 5 datafiles, do i have to do alter system switch log file 5 times ?

    Does it depend on the # of datafiles or i can just do it a couple of times ?How many times have to repeat that?


    Thanks in advance

  2. #2
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    One word of advice is don't take all the tablespaces off line in one shot. The log switch would talke place in when the logfile is full, or when the check point is to occour. The alter system switch log file, would force a log switch and that would enable you to archive that log file. It would be better if you are going to do a force switch between every tablespace backup. Other wise, you can do this logswitch once at the end, to make sure that your next set of transactions would use the new log file.

    So the choice is now yours. Did you ever had a chance to take a look into Oracle's RMAN backup, if you had not, I would suggest that you check that out. Using RMAN, you are not in a state to take the tablespace offline to do a hot backup.

    Good luck,
    Sam
    Thanx
    Sam



    Life is a journey, not a destination!


  3. #3
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Sambavan, why are you mentioning "taking tablespace offline" for hot backups? You don't need to take tablespaces offline while doing hot backup. You just have to put tablespace in "backup mode", which is something totaly different from taking it offline (and using RMAN or do it manually plays no role here).

    As for original question:
    The number of db files have no influence on the number of log switches you have to perform hot backup. Hot backup is valid if you backup all the archived logs holding database changes that took place during the time any of your tablespaces was in backup mode. So you have to remember the log sequence immediately before you start your backup and the log sequence at the moment you put your last tablespace out of backup mode and you have to backup all the archlogs between those two sequences. So usually it is necessary to perform a log switch only immediately after the end of your backup session to force the archiver to archive this last redo log. IMHO it is a good practice to perform a log switch also at the very begining of your backup session so that your backup set starts with a "clean" first archived log (that is, the first archlog will not contain any changes that are not relevant for this backup set).

    Switching redo logs after putting each tablespace out of backup mode is simply unnecessary, it serves no purpose at all.

    HTH,
    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
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    Jurij, thanx for pointing that out. I think I was brain dead :o when I had posted the message. For instance, when you use some of the third party tools, they tend to take the table space off line during the period of backup. But as far as this question is concerned, I was wrong in my answer.

    Sam
    Thanx
    Sam



    Life is a journey, not a destination!


  5. #5
    Join Date
    Feb 2001
    Posts
    114

    If Switching redo logs after putting each tablespace out of backup mode is simply unnecessary, where does switching log files play a role ?

    Thanks a lot guys

  6. #6
    Join Date
    Jan 2001
    Posts
    126
    Hi,

    You should switch log at the end of backup so that you have all the redologs generated for the duration of the entire backup. If you want to use this backup for recovery purposes then you need the datafiles and all the redo logs to come to a consistent state.

    Baliga

  7. #7
    Join Date
    Feb 2001
    Posts
    114
    I guess i will switch log at the end of backup so that i can always use it for recovery purposes rite?

    thanks


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