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 > I want to lock whole db only for me?!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-08-04, 03:37
NNicole NNicole is offline
Registered User
 
Join Date: May 2003
Posts: 57
I want to lock whole db only for me?!

Hello all!

I can't find is it possible at all or how I can do this easy.
There is DB2 db v.7.2.5 on AIX v4 and there I have many applications and users... It is 24hours on line. Now I need to do some changes on many tables - at this moment I don't even know how many... I will see that during the work. At the end I need one off-line backup. So I would like to lock db during that time only for me, and don't want to check for users every time and force their applications. I have dbadm authority.
Because there are many users and groups who have very different authorities on db I'd like to avoid revoking, and than granting, authorities to all of them.

Thank you in advance...
NNicole
Reply With Quote
  #2 (permalink)  
Old 06-08-04, 04:47
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
I can think of three options - Choose the one that suits you best:
1) Force off all applications and connect to the database in exclusive mode
$ db2 connect to sample in exclusive mode
Once you terminate, the database will accept connections.
This will prevent new applications connecting to the database.
2) If all clients are remote tcpip clients, then update the svcename to '' , stop-start the instance. So there will be no listner and hence the database will not receive any remote requests. Once you have your job done, change the svcename to the correct value and stop-start the instance.
3) If you have some local clients also, you can probably revoke just the CONNECT Privileges for the group of users before you start your work. On finsihing your work, re-grant the privileges.

Cheers
Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 06-08-04, 08:29
NNicole NNicole is offline
Registered User
 
Join Date: May 2003
Posts: 57
Sathyaram_s, thank you!

NNicole
Reply With Quote
  #4 (permalink)  
Old 06-08-04, 10:00
jthakrar jthakrar is offline
Registered User
 
Join Date: Mar 2004
Posts: 46
Another option is to "quiesce the database".....

Here's the description from the Command Reference Manual -

Quiesce
Forces all users off the specified instance and database and puts it into a
quiesced mode. In quiesced mode, users cannot connect from outside of the
database engine. While the database instance or database is in quiesced mode,
you can perform administrative tasks on it. After administrative tasks are
complete, use the UNQUIESCE command to activate the instance and
database and allow other users to connect to the database but avoid having to
shut down and perform another database start.
In this mode only users with authority in this restricted mode are allowed to
attach or connect to the instance/database. Users with sysadm, sysmaint, and
sysctrl authority always have access to an instance while it is quiesced, and
users with sysadm authority always have access to a database while it is
quiesced.
Reply With Quote
  #5 (permalink)  
Old 06-08-04, 16:59
Marcus_A Marcus_A is online now
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Is that available on version 7?
__________________
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
  #6 (permalink)  
Old 06-08-04, 17:28
dbamota dbamota is offline
Registered User
 
Join Date: Sep 2003
Posts: 237
You could, as an alternative, catalog the database with a different, YOUR OWN alias and then uncatalog the usual alias. You connect with your alias, force others out, finish your work and then catalog the db with the original alias.
__________________
mota
Reply With Quote
  #7 (permalink)  
Old 06-09-04, 09:07
NNicole NNicole is offline
Registered User
 
Join Date: May 2003
Posts: 57
Just thank you all!
Reply With Quote
  #8 (permalink)  
Old 06-09-04, 09:25
NNicole NNicole is offline
Registered User
 
Join Date: May 2003
Posts: 57
...and one notice more...
Quiesce db is not possible in v.7.
But I have other solutions.
:-)
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