Return-Path: <oracle-l-bounce@freelists.org>
Delivered-To: 2-oracle-l@orafaq.com
Received: (qmail 11035 invoked from network); 19 Dec 2007 08:38:19 -0600
Received: from freelists-180.iquest.net (HELO turing.freelists.org) (206.53.239.180)
  by static-ip-69-64-49-119.inaddr.intergenia.de with SMTP; 19 Dec 2007 08:38:17 -0600
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 48A047DC7CC;
 Wed, 19 Dec 2007 09:38:15 -0500 (EST)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 21885-03-2; Wed, 19 Dec 2007 09:38:15 -0500 (EST)
Received: from turing (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id AB2317DC82D;
 Wed, 19 Dec 2007 09:38:14 -0500 (EST)
Received: with ECARTIS (v1.0.0; list oracle-l); Wed, 19 Dec 2007 09:36:05 -0500 (EST)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 15B487DC7BF
 for <oracle-l@freelists.org>; Wed, 19 Dec 2007 09:36:05 -0500 (EST)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 21164-04 for <oracle-l@freelists.org>;
 Wed, 19 Dec 2007 09:36:04 -0500 (EST)
Received: from plmler11.mail.eds.com (plmler11.mail.eds.com [199.228.142.91])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id D33E77DC78A
 for <oracle-l@freelists.org>; Wed, 19 Dec 2007 09:36:04 -0500 (EST)
Received: from plmlir5.mail.eds.com (plmlir5-2.mail.eds.com [199.228.142.135])
 by plmler11.mail.eds.com (8.13.8/8.13.8) with ESMTP id lBJEa4RZ026731
 for <oracle-l@freelists.org>; Wed, 19 Dec 2007 08:36:04 -0600
Received: from usplsdlp305.amer.corp.eds.com ([148.94.169.152])
 by plmlir5.mail.eds.com (8.13.8/8.12.10) with SMTP id lBJEa3BQ026053
 for <oracle-l@freelists.org>; Wed, 19 Dec 2007 08:36:04 -0600
Received: from plmlir5.mail.eds.com (localhost [127.0.0.1])
 by plmlir5.mail.eds.com (8.13.8/8.12.10) with ESMTP id lBJEZwnd025469
 for <oracle-l@freelists.org>; Wed, 19 Dec 2007 08:35:58 -0600
Received: from usplm016.amer.corp.eds.com ([148.94.166.9])
 by plmlir5.mail.eds.com (8.13.8/8.12.10) with ESMTP id lBJEZwtG025464
 for <oracle-l@freelists.org>; Wed, 19 Dec 2007 08:35:58 -0600
Received: from usahm208.amer.corp.eds.com ([130.175.198.40]) by usplm016.amer.corp.eds.com with Microsoft SMTPSVC(6.0.3790.3959);
	 Wed, 19 Dec 2007 08:35:58 -0600
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by Ecartis
Subject: RE: Scripting the addition of  a Default Role
Date: Wed, 19 Dec 2007 09:35:57 -0500
Message-ID: <D1DC33E67722D54A93F05F702C99E2A901BC66F9@usahm208.amer.corp.eds.com>
In-Reply-To: <4768C17D.7000504@wp-sa.pl>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: Scripting the addition of  a Default Role
From: "Powell, Mark D" <mark.powell@eds.com>
To: <oracle-l@freelists.org>
X-OriginalArrivalTime: 19 Dec 2007 14:35:58.0658 (UTC) FILETIME=[787EC220:01C8424C]
X-CFilter-Loop: Reflected
X-archive-position: 4016
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-to: oracle-l-bounce@freelists.org
X-original-sender: mark.powell@eds.com
Precedence: normal
Reply-to: mark.powell@eds.com
List-help: <mailto:ecartis@freelists.org?Subject=help>
List-unsubscribe: <oracle-l-request@freelists.org?Subject=unsubscribe>
List-software: Ecartis version 1.0.0
List-Id: oracle-l <oracle-l.freelists.org>
X-List-ID: oracle-l <oracle-l.freelists.org>
List-subscribe: <oracle-l-request@freelists.org?Subject=subscribe>
List-owner: <mailto:steve.adams@ixora.com.au>
List-post: <mailto:oracle-l@freelists.org>
List-archive: <http://www.freelists.org/archives/oracle-l>
X-list: oracle-l
X-Virus-Scanned: Debian amavisd-new at localhost.localdomain

 
Sam, what is the point in dropping and recreating role F every night?  I
do not understand what benefit there is do this action.  

-- Mark D Powell --
Phone (313) 592-5148


-----Original Message-----
From: oracle-l-bounce@freelists.org
[mailto:oracle-l-bounce@freelists.org] On Behalf Of Remigiusz Sokolowski
Sent: Wednesday, December 19, 2007 2:00 AM
To: sbootsma@georgebrown.ca
Cc: oracle-l@freelists.org
Subject: Re: Scripting the addition of a Default Role

Sam Bootsma wrote:
>
> Hello all,
>
> Can anybody tell me if there is a simple way to script the addition of

> a role as a default role? Without breaking future additions of default

> or non-default roles? Here is an example to show what I mean:
>
> User X has been granted roles A,B,C,D, and E. Roles A,B, and C are 
> default roles; roles D and E are non-default.
>
> If I add a new role F that I want to give user X as a default role I 
> can do it by issuing: alter user X default role all except D,E;
>
> This works. In fact, I regenerate role F every night by dropping the 
> role, recreating it, granting privileges to the role, and then 
> granting it to the appropriate users, including user X. And, I have 
> this scripted (of course) and scheduled to run every night.
>
> This works fine until six months later somebody else grants user X an 
> additional role G as a non-default role. Oops, the script runs at 
> night and all of a sudden user X has role G as a default role.
>
> Can anybody tell me if there is a simple way to work-around this 
> problem? I know I can change the script to be "alter user default role

> A,B,C;", but this doesn't really solve my problem either. All it does 
> is cause a newly added default role to not be a default role the next
day.
>
I think You could simply change Your set of roles into something more
dynamic 1. ask dba_role_privs about non-default roles (Your script needs
much privileges anyway, so I assume it is not a problem) 2. concatenate
them into comma-separated string 3. issue execute immediate 'alter user
X default role all except '||my_string;

Am I miss anything?


-- 

------------------------------------------------------------------------
Remigiusz Sokolowski <rems@wp-sa.pl>
WP/PTI/DIP/ZAB (+04858) 52 15 770
MySQL v04.x,05.x; Oracle v10.x

Zastrzezenia:
1. Wylaczenie danej funkcjonalnosci oznacza, ze niezwlocznie przystapimy
   lub juz pracujemy nad jej uruchomieniem 2. Niniejsza wiadomosc
stanowi jedynie wyraz prywatnych pogladow autora 
   i nie jest w zadnym wypadku zwiazana ze stanowiskiem przedsiebiorstwa

   Wirtualna Polska S.A.
------------------------------------------------------------------------



WIRTUALNA  POLSKA  SA, ul. Traugutta 115c, 80-226 Gdansk; NIP:
957-07-51-216; Sad Rejonowy Gdansk-Polnoc KRS 0000068548, kapital
zakladowy 62.880.024 zlotych (w calosci wplacony)
--
http://www.freelists.org/webpage/oracle-l


--
http://www.freelists.org/webpage/oracle-l


