If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Db2 Roles

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-29-07, 03:12
Neharao Neharao is offline
Registered User
 
Join Date: Dec 2007
Posts: 49
Db2 Roles

Can I Create a ROLE in DB2 with a validity as in PostgreSQL

Here is the CREATE role syntax in PostGreSQL

CREATE ROLE XX LOGIN PASSWORD 'xxx'
NOINHERIT CREATEDB CREATEROLE
VALID UNTIL 'infinity';
Reply With Quote
  #2 (permalink)  
Old 12-29-07, 23:12
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Roles have been implemented in DB2 V9.5 which was recently released.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #3 (permalink)  
Old 12-31-07, 04:17
Neharao Neharao is offline
Registered User
 
Join Date: Dec 2007
Posts: 49
Hi Marcus

Thanks alot for the reply

I am using IBM UDB DB2 9.1 version. Please let me know if i can create only in 9.5 version? If it is so , can you please let me know from where i can Download it ?

And I am trying to create role in my local system. I am not connected to anyt server. Is it so that i need SYSADM and SYSCTRL authorities.

I was issuing the comand as CREATE ROLE {ROLENAME}

I have one more question as

In PosteGreSQL I was issuing the command as

CREATE ROLE ROLE2 LOGIN PASSWORD 'XXX'
INHERIT
VALID UNTIL 'infinity'
IN ROLE ROLE1;

So even in UDB DB2 as well can i create one role in another role ?

My Criteria is i am migrating my .NET application DB from PostgreSQL to IBM UDB Db2. I faced this ROLES problem

Thanks in Anticipation
Reply With Quote
  #4 (permalink)  
Old 12-31-07, 17:36
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Check out the SQL Reference Vol 2 manual for DB2 9.5.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #5 (permalink)  
Old 01-04-08, 23:47
Neharao Neharao is offline
Registered User
 
Join Date: Dec 2007
Posts: 49
Post

Hi I installed Db2 9.5 on my system and trying to create the ROLE in the local database it gives me an error saying :

------------------------------ Commands Entered ------------------------------
CREATE ROLE ROLE1;
------------------------------------------------------------------------------
CREATE ROLE ROLE1
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0552N "ADMINISTRATOR" does not have the privilege to perform operation
"CREATE ROLE". SQLSTATE=42502

SQL0552N "ADMINISTRATOR" does not have the privilege to perform operation "CREATE ROLE ".

How can i check the Privileges of administrator ?
Can i grant the privilege of Creating ROLE SECADM authority to administrator?
Reply With Quote
  #6 (permalink)  
Old 01-07-08, 07:35
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
To determine your authorizations you have, run the GET AUTHORIZATIONS command.

SECADM is an authorization - not a privileges. (Privileges are for database objects.)
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #7 (permalink)  
Old 01-10-08, 03:49
Neharao Neharao is offline
Registered User
 
Join Date: Dec 2007
Posts: 49
Where does the roles which are created will be listed in the Control center. I dont find them in Tree view listing of control view.

Can someone please let me know
Reply With Quote
  #8 (permalink)  
Old 01-10-08, 08:41
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
You can query the catalog view SYSCAT.ROLES directly.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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