Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 10:46 AM
Andy S.
Guest
 
Posts: n/a
Default viewing privileges for stored procedures

Hi,

I'm new to DB2. I want to view all the exisiting privileges (i.e. which
users have which privilegens) for a given stored procedure that exists
on the database.

How do I do this?

Thanks in advance!

  #2  
Old November 12th, 2005, 10:46 AM
N. Shamsundar
Guest
 
Posts: n/a
Default Re: viewing privileges for stored procedures

Andy S. wrote:[color=blue]
> Hi,
>
> I'm new to DB2. I want to view all the exisiting privileges (i.e. which
> users have which privilegens) for a given stored procedure that exists
> on the database.
>
> How do I do this?
>
> Thanks in advance!
>[/color]

The information you want is in syscat.routineauth; look at columns grantee,GranteeType, SpecificName,RoutineType and ExecuteAuth.

N. Shamsundar
University of Houston
  #3  
Old November 12th, 2005, 10:46 AM
Andy S.
Guest
 
Posts: n/a
Default Re: viewing privileges for stored procedures

When I ran the "select * from syscat.routineauth" logged in as
db2admin, I got the following error: (I'm running DB2 v7.2 FP 9; when I
looked at the Views in my DB, I didn't see ROUTINEAUTH )

DBA2191E SQL execution error.

com.ibm.db.DataException: A database manager error occurred. :
[IBM][CLI Driver][DB2/NT] SQL0204N "SYSCAT.ROUTINEAUTH" is an
undefined name. SQLSTATE=42704

Any ideas?

  #4  
Old November 12th, 2005, 10:46 AM
Rhino
Guest
 
Posts: n/a
Default Re: viewing privileges for stored procedures


"Andy S." <andys506@hotmail.com> wrote in message
news:1115757502.605369.222430@o13g2000cwo.googlegr oups.com...[color=blue]
> When I ran the "select * from syscat.routineauth" logged in as
> db2admin, I got the following error: (I'm running DB2 v7.2 FP 9; when I
> looked at the Views in my DB, I didn't see ROUTINEAUTH )
>
> DBA2191E SQL execution error.
>
> com.ibm.db.DataException: A database manager error occurred. :
> [IBM][CLI Driver][DB2/NT] SQL0204N "SYSCAT.ROUTINEAUTH" is an
> undefined name. SQLSTATE=42704
>
> Any ideas?
>[/color]
Unless you made a simple typo in the table name in the query you wrote, it
looks like you don't have SYSCAT.ROUTINEAUTH on your system. That seems
rather odd to me unless perhaps SYSCAT.SYSROUTINEAUTH was new with Version 8
of DB2 for Unix/Linux/Windows. Unfortunately, I can't find a Version 7 SQL
Reference at the IBM site so I can't determine if the table is new to
Version 8.

I can think of two options but I'm not sure you're going to like either one:
1. Upgrade to Version 8 so that you have the new version of the catalog.
That seems like a lot of work to do just to check privileges for a stored
procedure but you'll want to upgrade to Version 8 sooner or later; Version 7
went out of service several months back so you've got that incentive to
upgrade.
2. Figure out why SYSCAT.ROUTINEAUTH is not on your system. I can't think of
any reason for that offhand so I don't know what to suggest.

Rhino


  #5  
Old November 12th, 2005, 10:46 AM
Serge Rielau
Guest
 
Posts: n/a
Default Re: viewing privileges for stored procedures

Rhino wrote:[color=blue]
> "Andy S." <andys506@hotmail.com> wrote in message
> news:1115757502.605369.222430@o13g2000cwo.googlegr oups.com...
>[color=green]
>>When I ran the "select * from syscat.routineauth" logged in as
>>db2admin, I got the following error: (I'm running DB2 v7.2 FP 9; when I
>>looked at the Views in my DB, I didn't see ROUTINEAUTH )
>>
>>DBA2191E SQL execution error.
>>
>>com.ibm.db.DataException: A database manager error occurred. :
>>[IBM][CLI Driver][DB2/NT] SQL0204N "SYSCAT.ROUTINEAUTH" is an
>>undefined name. SQLSTATE=42704
>>
>>Any ideas?
>>[/color]
>
> Unless you made a simple typo in the table name in the query you wrote, it
> looks like you don't have SYSCAT.ROUTINEAUTH on your system. That seems
> rather odd to me unless perhaps SYSCAT.SYSROUTINEAUTH was new with Version 8
> of DB2 for Unix/Linux/Windows. Unfortunately, I can't find a Version 7 SQL
> Reference at the IBM site so I can't determine if the table is new to
> Version 8.
>
> I can think of two options but I'm not sure you're going to like either one:
> 1. Upgrade to Version 8 so that you have the new version of the catalog.
> That seems like a lot of work to do just to check privileges for a stored
> procedure but you'll want to upgrade to Version 8 sooner or later; Version 7
> went out of service several months back so you've got that incentive to
> upgrade.
> 2. Figure out why SYSCAT.ROUTINEAUTH is not on your system. I can't think of
> any reason for that offhand so I don't know what to suggest.
>
> Rhino
>
>[/color]
EXECUTE privilege on functions is new in DB2 V8.1 for LUW. Also prior to
V8 there were to sets of view: SYSCAT.PROCEDURES and SYSCAT.FUNCTIONS.
SYSCAT>ROUTINES is new.
Now, w.r.t privileges on procedures I have a hard time remembering. I
suspect the way to control those was via package authorization only.
Anyway: Look for packages and procedures. "routine" is a V8 beast.

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
  #6  
Old November 12th, 2005, 10:47 AM
Andy S.
Guest
 
Posts: n/a
Default Re: viewing privileges for stored procedures

Thanks everyone! I will look into it and post if I have any more
troubles...

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,174 network members.