Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: (HELP !!! ) NEED TO WRITE A SCRIPT SHOWING ONLY EXCEPTIONS

Re: (HELP !!! ) NEED TO WRITE A SCRIPT SHOWING ONLY EXCEPTIONS

From: stiffness <vze2t7nz_at_verizon.net>
Date: Sun, 03 Jun 2007 23:42:02 GMT
Message-ID: <elI8i.736$0x3.265@trnddc06>


Thanks for your response helped me greatly.

"Maxim Demenko" <mdemenko_at_gmail.com> wrote in message news:4662020B.1080204_at_gmail.com...
> stiffness schrieb:
>> Hello,
>>
>> I am querying the data dictionary for anyone with a improperly defined
>> default tablespace. The default table space for DBA_USER should be
>> either USERS or DATA*. I need my script to SHOW ONLY THE EXCEPTIONS
>> meaning those individuals who have improperly defined table spaces that
>> are not by either of the above. HERE IS WHAT I HAVE ATTEMPTED.
>>
>> Attempt 1.
>>
>> SQL> select username, default_tablespace, created
>> 2 FROM dba_users
>> 3 WHERE default_tablespace<>'USERS''DATA';
>>
>> The above script worked BUT in the reverse showing users in USERS AND
>> DATA
>> default_tablespace.
>>
>> Attempt 2.
>>
>> SQL> select username, default_tablespace, created
>> 2 FROM dba_users
>> 3 WHERE NOT default_tablespace='USERS'
>> 4 OR NOT default_tablespace='DATA';
>>
>> The above script also worked but in the reverse. HELP !!!
>>
>>
>>
>
> Some thoughts...
> According De Morgan laws
> http://en.wikipedia.org/wiki/De_Morgan%27s_laws
> zero IS NOT (red OR black) => zero IS NOT red AND zero IS NOT black
> oracle IS NOT (mssql OR sybase) => oracle IS NOT mssql AND oracle IS NOT
> sybase
>
> The list of OR's can be in Oracle rewritten as well to an in list:
> ten IS (positive OR natural OR even) => ten IN (positive,natural,even)
>
> Since Oracle 10g the default tablespace can be specified at the database
> level.
>
> Best regards
>
> Maxim
Received on Sun Jun 03 2007 - 18:42:02 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US