Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to GRANT permissions on Packages?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: How to GRANT permissions on Packages?
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    Post subject:
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    Post subject: Re: How to GRANT permissions on Packages?
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts list of executed but not commited pac... ramsri CA Products 4 Sat May 17, 2014 12:33 pm
No new posts Query to list packages bound under a ... gylbharat DB2 7 Wed Jul 03, 2013 2:06 pm
No new posts Multiple Packages - Confusion gylbharat DB2 10 Mon Jun 10, 2013 12:23 am
No new posts understand about collection ID and pa... arjun.h DB2 8 Fri Mar 15, 2013 1:56 pm
No new posts Grant or revoke access to a cobol/db2... dbzTHEdinosauer DB2 11 Mon Feb 27, 2012 3:48 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us