472,954 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,954 software developers and data experts.

granting db2expln for the public?

Hello,

I have DB2 v8.1 for Linux for a class environment; each user has
his/her own database as dbadm and they are suppose to study queries
from another database.

They have the right permissions to this database so they can do the
SELECTS but they cannot alter the tables.

Now I want them to be able to study the query plans.

My question is how to grant them permission to run db2expln.
From the documentation (for example:
http://webdocs.caspur.it/ibm/web/udb...0/db2d0369.htm) they have
to have EXECUTE authority for the db2expln package.

Now, I'm not able to do that; the syntax is: db2 GRANT EXECUTE ON
PACKAGE name TO PUBLIC

what's the package name for db2expln? I've tried "db2expln",
"db2expln.pkga" and it's not found.

If after the permission error message I grant execute to the mention
package it works, but the name is of the form "NULLID.SQLNAE00" and it
changes.
I've been able to get query plans in part by:
Creating plan table by running EXPLAIN.DDL.
then: $ db2 set current explain mode explain
and finally they can run db2exfmt.

(I had to struggle with the permissions, finally by granting CREATE
TABLE permissions to the common database it worked)
Nov 12 '05 #1
2 9978
<snip>
Note:
Not all of the tables above are created by default. To create them, run
the EXPLAIN.DDL script found in the misc subdirectory of the sqllib
subdirectory.
Explain tables might be common to more than one user. However, the explain
tables can be defined for one user, and then aliases can be defined for each
additional user using the same name to point to the defined tables. Each
user sharing the common explain tables must have insert permission on those
tables.

<snip>

<snip2>
The db2expln program connects and uses the |db2expln.bnd, db2exsrv.bnd, and
|db2exdyn.bnd files to bind itself to a database the first |time the
database is accessed.
|To run db2expln, you must have the SELECT privilege on |the system catalog
views as well as the EXECUTE privilege for the |db2expln, db2exsrv, and
db2exdyn |packages. To run dynexpln, you must have BINDADD authority |for
the database, and the schema you are using to connect to the database must
|exist or you must have the IMPLICIT_SCHEMA authority for the database. |To
explain dynamic SQL using either db2expln or |dynexpln, you must also have
any privileges needed for the SQL |statements being explained. (Note that if
you have SYSADM or DBADM |authority, you will automatically have all these
authorization |levels.)

<snip2>
BIND ... Grant ... TO ...
may not be necessary if you have SQLNAE00 under NULLID.

If i remember correctly, this utility is 'auto-bind'.

If you want to know the bind file to package name link, use this under
sqllib/bnd
DDCSPKGN db2expln.bnd

Bind File Package Name
------------------------------ ------------------------------
db2expln.bnd SQLNAE00
I think all you need is

-- do this section for each user of the group students

db2 create alias someuser.EXPLAIN_ARGUMENT FOR SharedSchema.EXPLAIN_ARGUMENT

db2 create alias someuser.EXPLAIN_INSTANCE FOR SharedSchema.EXPLAIN_INSTANCE

db2 create alias someuser.EXPLAIN_OBJECT FOR SharedSchema.EXPLAIN_OBJECT

db2 create alias someuser.EXPLAIN_OPERATOR FOR SharedSchema.EXPLAIN_OPERATOR

db2 create alias someuser.EXPLAIN_PREDICATE FOR
SharedSchema.EXPLAIN_PREDICATE

db2 create alias someuser.EXPLAIN_STATEMENT FOR
SharedSchema.EXPLAIN_STATEMENT

db2 create alias someuser.EXPLAIN_STREAM FOR SharedSchema.EXPLAIN_STREAM

-- then

DB2 GRANT INSERT ON TABLE SharedSchema.EXPLAIN_ARGUMENT TO GROUP students

DB2 GRANT INSERT ON TABLE SharedSchema.EXPLAIN_INSTANCE TO GROUP students

DB2 GRANT INSERT ON TABLE SharedSchema.EXPLAIN_OBJECT TO GROUP students

DB2 GRANT INSERT ON TABLE SharedSchema.EXPLAIN_OPERATOR TO GROUP students

DB2 GRANT INSERT ON TABLE SharedSchema.EXPLAIN_PREDICATE TO GROUP students

DB2 GRANT INSERT ON TABLE SharedSchema.EXPLAIN_STATEMENT TO GROUP students

DB2 GRANT INSERT ON TABLE SharedSchema.EXPLAIN_STREAM TO GROUP students

-- then.... maybe this....

DB2 GRANT SELECT ON TABLE SharedSchema.EXPLAIN_ARGUMENT TO GROUP students

DB2 GRANT SELECT ON TABLE SharedSchema.EXPLAIN_INSTANCE TO GROUP students

DB2 GRANT SELECT ON TABLE SharedSchema.EXPLAIN_OBJECT TO GROUP students

DB2 GRANT SELECT ON TABLE SharedSchema.EXPLAIN_OPERATOR TO GROUP students

DB2 GRANT SELECT ON TABLE SharedSchema.EXPLAIN_PREDICATE TO GROUP students

DB2 GRANT SELECT ON TABLE SharedSchema.EXPLAIN_STATEMENT TO GROUP students

DB2 GRANT SELECT ON TABLE SharedSchema.EXPLAIN_STREAM TO GROUP students

-- test with a student account

db2 explain all for values 1

PM

"LazyAnt" <so***********@hotmail.com> a écrit dans le message de
news:f6**************************@posting.google.c om...
Hello,

I have DB2 v8.1 for Linux for a class environment; each user has
his/her own database as dbadm and they are suppose to study queries
from another database.

They have the right permissions to this database so they can do the
SELECTS but they cannot alter the tables.

Now I want them to be able to study the query plans.

My question is how to grant them permission to run db2expln.
From the documentation (for example:
http://webdocs.caspur.it/ibm/web/udb...0/db2d0369.htm) they have
to have EXECUTE authority for the db2expln package.

Now, I'm not able to do that; the syntax is: db2 GRANT EXECUTE ON
PACKAGE name TO PUBLIC

what's the package name for db2expln? I've tried "db2expln",
"db2expln.pkga" and it's not found.

If after the permission error message I grant execute to the mention
package it works, but the name is of the form "NULLID.SQLNAE00" and it
changes.
I've been able to get query plans in part by:
Creating plan table by running EXPLAIN.DDL.
then: $ db2 set current explain mode explain
and finally they can run db2exfmt.

(I had to struggle with the permissions, finally by granting CREATE
TABLE permissions to the common database it worked)

Nov 12 '05 #2
thank you very much!

"PM \(pm3iinc-nospam\)" <PM(pm3iinc-nospam)@sympatico.ca> wrote in message
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ted | last post by:
How do I grant all privileges for a schema that has a large number of existing tables, procedures, functions, etc to a newly created role, without having to issue a grant statement for each object...
3
by: Tim Werth | last post by:
I have a Windows Service that is running as an administrator account. Some of it methods create files for a COM+ client to digest and puts them in C:\Documents and Settings\All Users\Application...
2
by: APAPF | last post by:
Hi, I'm trying to interpet a db2 explain. I'm trying to determine if the SQL is being executed as I expect/hope. The sql is generally: select key from table where key1=value and key2 >...
3
by: Terry | last post by:
Hi All, Im trying to run db2expln over some sql in order to find out why its so slow. I receive the following error message. LINE MESSAGES FOR DYNEXPLN.sqc ------ ...
0
by: Charles A. Lackman | last post by:
Hello, I have a web site that is supose to create an Excel file out of a dataset. In my code where: "Dim Excel as new Excel.Application" is placed I receive the following exception: ...
4
by: tuarek | last post by:
Hi all, Can you suggest any reference on analyzing db2expln results? Regards, Mehmet
1
by: jefftyzzer | last post by:
Colleagues: Can anyone tell me what the number to the right of "Index Prefetch: Eligible" designates in the output from db2expln, e.g., "Index Prefetch: Eligible 14409"? I see such a number...
1
by: Troels Arvin | last post by:
Hello, In a DB2 LUW v. 8.1.1.96, I have a hard time giving users access to the db2expln utility. Let's say that user FOOBAR needs to be able to run the db2expln utility. I do: - provide...
3
by: Rahul B | last post by:
Hi, I want to grant only the connect, select, insert, update privileges on all the tables of a schema to a particular user/group Initially, i had revoked all the privileges from public. It...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.