Results 1 to 9 of 9
  1. #1
    Join Date
    Sep 2003
    Location
    London
    Posts
    17

    Red face Unanswered: DB2 Backups for a MSQL DBA

    Hello all,

    I am a SQL server DBA. I have just become the proud owner of a DB2 server. Howerver I have never used it before in my life.

    Its DB2 on v8.1.9.762 Build Level s041221 on windows server 2003.

    What I would like to be able to do is a backup, howerver from what I have read there is a diffreance between offline and online backups.

    I used the built in backup notebook and managed to get a backup out of it. Howerver it crashed the aplication it supports.

    I would like to be able to create a batch job that stops the aplications service does a full backup, then starts the service.

    What would be the best way of doing this?

    Also I am still having problems telling the diffrance between online and offline backups.

    Forgive my ignrance but I guess we all start some where.

    Thanks in advance for all your help.

    Dave
    __________________

    HEY HEY MY MY

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Offline backup = No users can use the database while the backup is in progress.
    Online backup = Users can use the database while the backup is in progress.

    Andy

  3. #3
    Join Date
    Sep 2003
    Location
    London
    Posts
    17
    Hi Andy,

    Yeah thats what I figured. But what is the difrance between the two in regards to the file that falls out the bottom of the back its self.
    __________________

    HEY HEY MY MY

  4. #4
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Offline backup = Is used to recreate the database at the point in time the backup was initiated.

    Online backup = Is used to recreate the DB and apply any changes made during the backup. Make sure you use the "INCLUDE LOGS" clause in the BACKUP command.

    There really is not much difference on what comes out the back end. If you include the logs with an online backup, you will get a backup image with either method that you can then recreate a usable database from.

    Andy

  5. #5
    Join Date
    Sep 2003
    Location
    London
    Posts
    17
    Great thanks Andy,

    so I guess in my case I want a off line backup.

    So what commands would I need to issue from Dos to get this?

    Thanks so much for all your help.

    Dave
    __________________

    HEY HEY MY MY

  6. #6
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Your script would look something like this:

    Code:
    db2 connect to MyDB
    db2 quiesce db immediate force connections 
    db2 disconnect all
    db2 backup database MyDB to c:\backups
    db2 unquiesce db
    Andy

  7. #7
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    I should note that by forcing the connections will probably make the application crash if they do not properly handle having their connections to the database disconnected without their control.

    Andy

  8. #8
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    This article is a good introduction to DB2 Backup:
    DB2 Basics: The IBM DB2 Universal Database for Linux, UNIX, and Windows Backup Utility

    It's 5 yrs old but most of the info is still relevant.

  9. #9
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    if you are new to db2, then
    IBM developerWorks : New to IBM Information Management

    is a good place to start
    Visit the new-look IDUG Website , register to gain access to the excellent content.

Tags for this Thread

Posting Permissions

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