473,624 Members | 2,447 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.p kga" 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.SQLNAE0 0" 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 10107
<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.EXPLAI N_ARGUMENT FOR SharedSchema.EX PLAIN_ARGUMENT

db2 create alias someuser.EXPLAI N_INSTANCE FOR SharedSchema.EX PLAIN_INSTANCE

db2 create alias someuser.EXPLAI N_OBJECT FOR SharedSchema.EX PLAIN_OBJECT

db2 create alias someuser.EXPLAI N_OPERATOR FOR SharedSchema.EX PLAIN_OPERATOR

db2 create alias someuser.EXPLAI N_PREDICATE FOR
SharedSchema.EX PLAIN_PREDICATE

db2 create alias someuser.EXPLAI N_STATEMENT FOR
SharedSchema.EX PLAIN_STATEMENT

db2 create alias someuser.EXPLAI N_STREAM FOR SharedSchema.EX PLAIN_STREAM

-- then

DB2 GRANT INSERT ON TABLE SharedSchema.EX PLAIN_ARGUMENT TO GROUP students

DB2 GRANT INSERT ON TABLE SharedSchema.EX PLAIN_INSTANCE TO GROUP students

DB2 GRANT INSERT ON TABLE SharedSchema.EX PLAIN_OBJECT TO GROUP students

DB2 GRANT INSERT ON TABLE SharedSchema.EX PLAIN_OPERATOR TO GROUP students

DB2 GRANT INSERT ON TABLE SharedSchema.EX PLAIN_PREDICATE TO GROUP students

DB2 GRANT INSERT ON TABLE SharedSchema.EX PLAIN_STATEMENT TO GROUP students

DB2 GRANT INSERT ON TABLE SharedSchema.EX PLAIN_STREAM TO GROUP students

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

DB2 GRANT SELECT ON TABLE SharedSchema.EX PLAIN_ARGUMENT TO GROUP students

DB2 GRANT SELECT ON TABLE SharedSchema.EX PLAIN_INSTANCE TO GROUP students

DB2 GRANT SELECT ON TABLE SharedSchema.EX PLAIN_OBJECT TO GROUP students

DB2 GRANT SELECT ON TABLE SharedSchema.EX PLAIN_OPERATOR TO GROUP students

DB2 GRANT SELECT ON TABLE SharedSchema.EX PLAIN_PREDICATE TO GROUP students

DB2 GRANT SELECT ON TABLE SharedSchema.EX PLAIN_STATEMENT TO GROUP students

DB2 GRANT SELECT ON TABLE SharedSchema.EX PLAIN_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.goo gle.com...
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.p kga" 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.SQLNAE0 0" 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)@sympati co.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
8559
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 and each privilege? I want the role to have all of the rights of the schema owner. Is there any kind of blanket granting of all privileges to a role?
3
417
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 Data\... The file is created with a StreamWriter. When the COM+ client (running as a non-admin user) is finished with the file, it tries to clean it up but gets a Permission denied error. How can the service programmatically grant delete...
2
6638
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 > value2 and key2 < maxkey order by key2 fetch first 1 row only
3
2952
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 ------ -------------------------------------------------------------------- SQL0060W The "C" precompiler is in progress.
0
1299
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: System.UnauthorizedAccessException: Access is denied. ASP.NET is not authorized to access the requested resource. Consider
4
3024
by: tuarek | last post by:
Hi all, Can you suggest any reference on analyzing db2expln results? Regards, Mehmet
1
2845
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 in many examples of dynexpln output on the web, but can only find explanations such as this one, which lacks any mention of the number:
1
3605
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 IMPLICIT_SCHEMA, CREATETAB, BINDADD, IMPLICIT_SCHEMA to the user - ask the user to run /home/db2inst1/sqllib/misc/EXPLAIN.DDL; this
3
4667
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 seems that the privileges Select, Insert, Update can be given only on a table level and not on the schema level. I can iterate and get the script for the select privileges for all the tables and execute it.
0
8231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8168
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8614
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8330
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7153
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6107
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2603
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1474
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.