Re: script to alter a user with default role

  • From: David Fitzjarrell <oratune@xxxxxxxxx>
  • To: adar666@xxxxxxxxxxxx, lyallbarbour@xxxxxxxxxxxxxxx
  • Date: Thu, 8 Apr 2010 09:21:07 -0700 (PDT)

Syntactically it's the  double quotes; strings are enclosed in single quotes.  
As to setting 'default role all' that really depends upon which roles these 
users are granted and whether or not those roles SHOULD be set as default.  
Administrative roles granted to essentially non-administrative users should not 
be default (in my opinion) as they are (or should be) granted for emergency use 
(the department manager is off in Aruba and the only DBA was hit by a bus on 
her way back to the office from lunch and is now in the emergency room).
 
David Fitzjarrell





________________________________
From: Yechiel Adar <adar666@xxxxxxxxxxxx>
To: lyallbarbour@xxxxxxxxxxxxxxx
Cc: oracle-l@xxxxxxxxxxxxx
Sent: Thu, April 8, 2010 11:59:29 AM
Subject: Re: script to alter a user with default role

What is wrong with:
select "alter user " || username || " default role all;" from all_users;

Adar Yechiel
Rechovot, Israel

lyallbarbour@xxxxxxxxxxxxxxx wrote: 
Has someone done this before?  it's hurting my brain.
>  i want to grab all the roles that are granted to a user and add it to an 
>alter statement on the fly.
>
>alter user foo default role "granted_role", "granted_role", append, append, 
>append 
>
>as needed depending on how many roles a user has.  I was hoping to make a 
>select 'alter user... ' type of thing.
>
>Lyall
>
>


      

Other related posts: