If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > DB2 Backups for a MSQL DBA

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-05-10, 10:00
dirtydavey dirtydavey is offline
Registered User
 
Join Date: Sep 2003
Location: London
Posts: 16
Red face 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
Reply With Quote
  #2 (permalink)  
Old 03-05-10, 10:10
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
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
Reply With Quote
  #3 (permalink)  
Old 03-05-10, 10:12
dirtydavey dirtydavey is offline
Registered User
 
Join Date: Sep 2003
Location: London
Posts: 16
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
Reply With Quote
  #4 (permalink)  
Old 03-05-10, 10:20
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
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
Reply With Quote
  #5 (permalink)  
Old 03-05-10, 10:46
dirtydavey dirtydavey is offline
Registered User
 
Join Date: Sep 2003
Location: London
Posts: 16
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
Reply With Quote
  #6 (permalink)  
Old 03-05-10, 10:57
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
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
Reply With Quote
  #7 (permalink)  
Old 03-05-10, 11:00
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
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
Reply With Quote
  #8 (permalink)  
Old 03-05-10, 11:26
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
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.
Reply With Quote
  #9 (permalink)  
Old 03-05-10, 15:13
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
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.
Reply With Quote
Reply

Tags
backups, online offline

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On