forked from buckaroo-labs/OracleSQL
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusers.sql
More file actions
43 lines (41 loc) · 1.09 KB
/
Copy pathusers.sql
File metadata and controls
43 lines (41 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
set pages 200 lines 250
col username for A25
col account_status for A20
col profile for A20
col INITIAL_RSRC_CONSUMER_GROUP for A30
col default_tablespace for A20
select username, created, profile, account_status, default_tablespace, INITIAL_RSRC_CONSUMER_GROUP
from dba_users
where regexp_like (username,'^([[:alpha:]]{3}[[:digit:]]{4})$')
or regexp_like (username,'^([[:alpha:]]{3}[[:digit:]]{3})$')
or regexp_like (username,'^V_([[:alpha:]]{3}[[:digit:]]{3})$')
order by 1
/
set pages 200 lines 250
col username for A25
select username, created, profile, account_status, default_tablespace, INITIAL_RSRC_CONSUMER_GROUP
from dba_users
where not regexp_like (username,'^([[:alpha:]]{3}[[:digit:]]{4})$')
and not regexp_like (username,'^([[:alpha:]]{3}[[:digit:]]{3})$')
and not regexp_like (username,'^V_([[:alpha:]]{3}[[:digit:]]{3})$')
--and nvl(password,'x') != 'EXTERNAL'
--and username not between 'M00000' and 'M99999'
and username not in (
'ANONYMOUS'
,'APPQOSSYS'
,'DBA_DBG'
,'DBA_MON'
,'DBSNMP'
,'DIP'
,'EXFSYS'
,'GGSUSER'
,'ORACLE_OCM'
,'OUTLN'
,'SYS'
,'SYSTEM'
,'WMSYS'
,'XDB'
,'XS$NULL'
)
order by 1
/