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 user privileges

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-12-11, 06:11
xquadrat xquadrat is offline
Registered User
 
Join Date: Jan 2011
Posts: 3
db2 user privileges

Hi,
I'm developing a product installer for an application that has to create a database on a DB2 during installation process. Since the database to be imported is very complex we have to check that the user has DB2 administrative privileges. Is this possible via command line call, or do I need to use a specific API library?

Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 01-12-11, 12:40
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
What version of DB2 are you on ? and what platform ?
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 01-13-11, 01:25
xquadrat xquadrat is offline
Registered User
 
Join Date: Jan 2011
Posts: 3
db2 9.1 to 9.7 on Windows and Unix
Reply With Quote
  #4 (permalink)  
Old 01-13-11, 01:36
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
I think the simplest way to do it is to rely on DB2 to determine user authorizations: issue the create database command and handle the error if it occurs.
Reply With Quote
  #5 (permalink)  
Old 01-13-11, 01:44
xquadrat xquadrat is offline
Registered User
 
Join Date: Jan 2011
Posts: 3
that's exactly the case we want to avoid with this check ;-)
Reply With Quote
  #6 (permalink)  
Old 01-13-11, 05:27
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by xquadrat View Post
that's exactly the case we want to avoid with this check ;-)
Can you explain why?

The user needs SYSADM or SYSCTRL authority to create a database. How you determine that depends on the DB2 version, operating system, a number of registry variables, security plugin in place, and some instance configuration settings.
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