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 > General DB2 8.2 backup questions

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-22-05, 17:59
PanamaMike PanamaMike is offline
Registered User
 
Join Date: Jan 2004
Location: Austin
Posts: 62
General DB2 8.2 backup questions

I'm a newbie to DBA scripting. I've been tasked to build a set of maintenance scripts on a SuSe box for DB2 8.2. I'd like to know where I could go for good
information on backup and recovery scripts.

I've thus far been able to do a simple backup and recovery, but I'm not sure
of the commands I'll need for a standalone script. For instance I need to know
how to take the datbase "offline".

I've been using a command

db2 force applications all

To kick all pending applications off the database, but I'm not sure how to make sure the database is offline so that no new processes won't try to connect during or right before the backup process.

The other key item I'm trying to determine is how to hide a password.
The script will have to login in order to perform the backup, and the
simple way to do this is to add the login and password in the command in
plain text. Is there another way to have the proper login access to perform
the required backup and restore commands without having the password
in plain text, "sight".

Any help is much appreciated.

Regards,

Michael
Reply With Quote
  #2 (permalink)  
Old 11-22-05, 18:06
wangzhonnew wangzhonnew is offline
Registered User
 
Join Date: Nov 2005
Location: Toronto
Posts: 65
__________________
IBM Certified DBA for DB2 UDB
IBM Certified Database Developer for DB2 UDB
DB2 Tech Support, IBM Toronto Software Lab
Reply With Quote
  #3 (permalink)  
Old 11-22-05, 18:38
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Go to the Control Center and do a backup with the GUI. Right before you submit the backup, do a show SQL, which will give you the recommended script to use.

You can create a cron job using the instance owner id, so you will already be logged on (no password required).
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #4 (permalink)  
Old 11-23-05, 11:03
PanamaMike PanamaMike is offline
Registered User
 
Join Date: Jan 2004
Location: Austin
Posts: 62
Thanks for the info!

Great tip Marcus_A, thanks for the help.
I appreciate the links Wang.

Regards,

Mike
Reply With Quote
Reply

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