有些时候,我们要清理数据库时,想把数据库中所有非系统自带的用户全部删除,在12C以前,我们只能通过人肉的方式,从12C 开始,多了一个字段: ORACLE_MAINTAINED如果时系统自带的,该值为Y,否则为N
就很好办了,直接使用以下语句就可以找出系统自带的用户了。
select username,account_status,
ORACLE_MAINTAINED from dba_users where ORACLE_MAINTAINED='Y';
SQL> r
1* SELECT username,account_status from dba_users where ORACLE_MAINTAINED='Y'
USERNAME ACCOUNT_STATUS
------------------------------ --------------------------------
SYS OPEN
SYSTEM OPEN
XS$NULL EXPIRED & LOCKED
OJVMSYS LOCKED
LBACSYS LOCKED
OUTLN LOCKED
SYS$UMF LOCKED
DBSNMP LOCKED
APPQOSSYS LOCKED
DBSFWUSER LOCKED
GGSYS LOCKED
ANONYMOUS EXPIRED & LOCKED
CTXSYS EXPIRED & LOCKED
DVF LOCKED
DVSYS LOCKED
GSMADMIN_INTERNAL LOCKED
MDSYS LOCKED
OLAPSYS LOCKED
XDB LOCKED
WMSYS LOCKED
GSMCATUSER LOCKED
MDDATA LOCKED
REMOTE_SCHEDULER_AGENT LOCKED
SYSBACKUP LOCKED
GSMUSER LOCKED
GSMROOTUSER LOCKED
SYSRAC LOCKED
SI_INFORMTN_SCHEMA LOCKED
AUDSYS LOCKED
DIP LOCKED
ORDPLUGINS LOCKED
ORDDATA LOCKED
SYSKM LOCKED
ORACLE_OCM LOCKED
ORDSYS LOCKED
SYSDG LOCKED
36 rows selected.
|