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 > Keeping users out for a backup

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-12-05, 09:13
PanamaMike PanamaMike is offline
Registered User
 
Join Date: Jan 2004
Location: Austin
Posts: 62
Question Keeping users out for a backup

Hello,

I've recently been working on a backup script for DB2. I've tried a few different things and ended up with determining that DEACTIVE DATABASE after
FORCE APPLICATIONS ALL would be a good way to keep users off of the database while performing a backup.

I haven't had a good way to test if this would work well, I'd like to know if DEACTIVATE will actually keep users out of the database during the backup.

I tried QUIESCE DATABASE, but apparently you can't perform a backup or restore, can't remember which, when in this mode. This is why I resorted to
DEACTIVE DATABASE, but I'm unclear who can ACTIVATE or establish a connection once DEACTIVATED.

Also, I'd like to know a good way to ensure all users have been booted off of the database using command line command.

Any info. is much appreciated.

Regards,

Michael
Reply With Quote
  #2 (permalink)  
Old 12-12-05, 09:39
przytula przytula is offline
Registered User
 
Join Date: Nov 2004
Posts: 374
backup

we always use quiesce database force for offline backup
we never had a problem for backup/restore
for online backup this is not needed....
__________________
Best Regards, Guy Przytula
DB2/ORA/SQL Services
DB2 DBA & Advanced DBA Certified
DB2 Dprop Certified
http://users.skynet.be/przytula/dbss.html
Reply With Quote
  #3 (permalink)  
Old 12-12-05, 10:34
udbraja udbraja is offline
Registered User
 
Join Date: Sep 2004
Posts: 111
Arrow

Deactiate database is the best choice for an offline backup.
Users will be thrown away with message "Database is in use" when they try to connect to the database at the time of offline database backup.

-RJ
Reply With Quote
  #4 (permalink)  
Old 12-12-05, 15:14
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
Wouldn't it be less intrusive to revoke access followed by the force?

One pit fall when using diactivate is you need to keep in mind that id that issues this command can not be connected to any db.

Also, youa re talking about doing an ofline back ups, correct? Other wise users can be connected
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
  #5 (permalink)  
Old 12-14-05, 18:20
PanamaMike PanamaMike is offline
Registered User
 
Join Date: Jan 2004
Location: Austin
Posts: 62
Offline backup indeed

Yes, it will be an offline backup. I'd just like to know the best way to guarantee that users will not be able to connect. My concern is the time between the kicking off users and gettting to start the backup. My concern is that a process setup to automatically connect will cause a problem.

I'm trying to make this a hands off backup process.

Regards,

Mike
Reply With Quote
  #6 (permalink)  
Old 12-15-05, 09:04
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
I just looked up our old script when we were doing an offline backups and you do need to diactivate the db, however it wont keep users out. Users still can get connected until you actually start a back up.

What you need to do is to revoke connect on the db followed by diactivating this db followed by forcing everyone off the system.

Before you force everyone off it would be worth checking to make sure that you do not have any of your other processes still running i.e. runstats or loads. It is one thing killing someone elses processes, it is a shame killing your own
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
  #7 (permalink)  
Old 12-15-05, 09:24
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
As an alternative, after forcing the existing connections you could just put up a firewall for the duration of backup to reject new remote connections.
Reply With Quote
  #8 (permalink)  
Old 12-15-05, 09:29
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
BTW, are you on a EEE?
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
  #9 (permalink)  
Old 12-15-05, 10:27
dbamota dbamota is offline
Registered User
 
Join Date: Sep 2003
Posts: 237
As I read somewhere, howabout cataloging a database with a USERALIAS and a DBAALIAS. When ready to take a backup, uncatalog USERALIAS; force applications; take the backup; then recatalog USERALIAS. As long as cold(offline) backup is active nobody can connect. So you can recatalog USERALIAS once backup is active.
__________________
mota
Reply With Quote
  #10 (permalink)  
Old 12-15-05, 11:16
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
Quote:
Originally Posted by dbamota
As I read somewhere, howabout cataloging a database with a USERALIAS and a DBAALIAS. When ready to take a backup, uncatalog USERALIAS; force applications; take the backup; then recatalog USERALIAS. As long as cold(offline) backup is active nobody can connect. So you can recatalog USERALIAS once backup is active.
Good point, but what do you do if they know the real name
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
  #11 (permalink)  
Old 12-15-05, 11:21
dbamota dbamota is offline
Registered User
 
Join Date: Sep 2003
Posts: 237
follow the standard operating procedure; deal with them with "extreme prejudice"
__________________
mota
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