IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to GRANT permissions on Packages?


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Karthigaiselvan

New User


Joined: 11 Dec 2006
Posts: 35
Location: India

PostPosted: Wed Jul 04, 2007 8:05 pm
Reply with quote

Hi,

I am creating new packages which will be used by some plans. Should i need to GRANT permissions (BIND, EXECUTE, COPY) on these packages?

If yes,
1.What's the syntax for the same. A sample GRANT statement will be very helpful.
2.Then why we dont use RETAIN option in ACTION(REPLACE) while binding a package as RETAIN is used to retain the existing authority permissions?

If no,
Does that mean that any plans including these packages will be able to execute them.
Back to top
View user's profile Send private message
Nimesh.Srivastava

New User


Joined: 30 Nov 2006
Posts: 78
Location: SINGAPORE

PostPosted: Thu Jul 05, 2007 2:08 pm
Reply with quote

Karthigaiselvan,
No you dont need to do so, what you need is when you create the collection id you need to grant execute access using
GRANT EXECUTE ON PACKAGE XYZ.* TO definer/user;
So by default when you include a new package it has the EXECUTE permission as long as the collection id is the same.
ex. BIND PACKAGE(XYZ) MEMBER(ABC)

For executing the program having SQL statements you need to have a plan bound to the database.
ex. BIND PLAN(PLANXYZ) PKLIST(XYZ.*)

RETAIN preserves EXECUTE privileges when you replace the plan so if the plan name is same always then you dont need to use RETAIN.

Hope this helps
Nimesh
Back to top
View user's profile Send private message
Karthigaiselvan

New User


Joined: 11 Dec 2006
Posts: 35
Location: India

PostPosted: Fri Jul 20, 2007 9:59 pm
Reply with quote

Hi,

I just wanted to post what i learnt in this. When i created packages in a collection, say XYZ and included them in a Plan (BIND PLAN (plan-name) INCLUDE PKLIST (XYZ.*)...), the plan automatically got execute access for the package. The only thing we have to do after creating the package is GRANT BIND to users.

Also i learnt that using ACTION (REPLACE) doesn not expect a plan / package to be present. Instead, it will create a new one if it does not exist.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Packages - Versioning DB2 1
No new posts Number of Packages required for stati... DB2 4
No new posts list of executed but not commited pac... CA Products 4
No new posts Query to list packages bound under a ... DB2 7
No new posts Multiple Packages - Confusion DB2 14
Search our Forums:

Back to Top