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 > Restrict priveleges on all table except one IN DB2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-10-09, 01:33
Faiyaaz Faiyaaz is offline
Registered User
 
Join Date: Feb 2009
Posts: 14
Question Restrict priveleges on all table except one IN DB2

I'm totally new to DB2 and need some assistance please, I need to create a user to have access to only one table on a schema. I was able to create the user. On the table permissions i gave it the relevant priveleges as well as on the schema but the user has access to the other tables as well in that schema. How is it possible to restrict access on all the other tables (NO read update insert etc. on any other tables)
Please assist
Reply With Quote
  #2 (permalink)  
Old 02-10-09, 02:09
rahul_s80 rahul_s80 is offline
Registered User
 
Join Date: Jul 2006
Location: Pune , India
Posts: 433
Dont give schema priv
__________________
Rahul Singh
Certified DB2 9 DBA / Application Developer
Reply With Quote
  #3 (permalink)  
Old 02-10-09, 02:39
Faiyaaz Faiyaaz is offline
Registered User
 
Join Date: Feb 2009
Posts: 14
I removed the access from the schema, but user still has access to the other tables. User can still update read insert on other tables. Need to restrict him on all tables except one
Reply With Quote
  #4 (permalink)  
Old 02-10-09, 02:58
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
You should create the database using the RESTRICTIVE keyword. Then you grant only those privileges that your users shall have.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #5 (permalink)  
Old 02-10-09, 03:09
Faiyaaz Faiyaaz is offline
Registered User
 
Join Date: Feb 2009
Posts: 14
The database is already created, the schemas already exist for some time now. Just need to create a new user with restricted access on all the other tables except one. There is a way but it will take alot of time (to grant the exclude permssions for the user on each table, and there are alot of tables really alot. There must me simple way of doing this
Reply With Quote
  #6 (permalink)  
Old 02-10-09, 08:18
Faiyaaz Faiyaaz is offline
Registered User
 
Join Date: Feb 2009
Posts: 14
Unhappy

Does anyone have a solution to my problem Theres 3000 tables I dont want to go to the permissions of each table, please assist in this question
Reply With Quote
  #7 (permalink)  
Old 02-10-09, 08:30
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
The simple answer is : Create a OS user and grant CONNECT privilege on the database and SELECT access to the table to that user.

--
Connect to the database as the user and post the output of

db2 get authorizations

---

What are the permissions on the other tables ? Granted to public? Granted to a group in which the user is a part of ?

Cheers
Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #8 (permalink)  
Old 02-10-09, 08:38
Faiyaaz Faiyaaz is offline
Registered User
 
Join Date: Feb 2009
Posts: 14
I have done that, I created the user granted access to the database and relevant table, but it has access to the other table by default somehow. The
public user has change access(read, add, update, delete, execute).
Reply With Quote
  #9 (permalink)  
Old 02-10-09, 08:42
Faiyaaz Faiyaaz is offline
Registered User
 
Join Date: Feb 2009
Posts: 14
I have done that, I created the user granted access to the database and relevant table, but it has access to the other table by default somehow. The
public user has change access(read, add, update, delete, execute) and the user i created i did not place it in any group
Reply With Quote
  #10 (permalink)  
Old 02-10-09, 09:00
rahul_s80 rahul_s80 is offline
Registered User
 
Join Date: Jul 2006
Location: Pune , India
Posts: 433
are you on windows ? check the user you are creating dont have admin rights on the server
__________________
Rahul Singh
Certified DB2 9 DBA / Application Developer
Reply With Quote
  #11 (permalink)  
Old 02-10-09, 09:07
Faiyaaz Faiyaaz is offline
Registered User
 
Join Date: Feb 2009
Posts: 14
This is a OS400 machine, and I created the user on the database level only User doesn't have admin privileges or any other privileges on the operating system level
Reply With Quote
  #12 (permalink)  
Old 02-10-09, 09:13
Faiyaaz Faiyaaz is offline
Registered User
 
Join Date: Feb 2009
Posts: 14
This is a OS400 machine, and I created the user on the database level only User doesn't have admin privileges or any other privileges on the operating system level
Reply With Quote
  #13 (permalink)  
Old 02-10-09, 10:26
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
DB2 on os400 is a totally different beast ..

The access may be due to the operating system policies ... Request your os400 admin to check if the new user has read access to the data file.

Unlike other platforms, in simple terms, db2 on iseries is a SQL wrapper to access the native data files. Therefore, the permissions you grant for tables is same as the OS permissions you grant to the data file.
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #14 (permalink)  
Old 02-11-09, 01:03
Faiyaaz Faiyaaz is offline
Registered User
 
Join Date: Feb 2009
Posts: 14
so in other words if the user has read,update access to the datafile, he'll have read, update access to all the tables. I have to individually set the permissions for each table to restrict access. Thats not very user friendly
Reply With Quote
  #15 (permalink)  
Old 02-11-09, 05:13
Faiyaaz Faiyaaz is offline
Registered User
 
Join Date: Feb 2009
Posts: 14
I guess there no true answer to this question, thanks all for your assistance, logged a call with IBM/DB2 speacilists will update this subject if they come up with anything positive.
Thanks again
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