Oracle user created information

data dictionaryoracle

Is it possible to determine what user created another user's account in Oracle database?

I have two types of users in database:

  • Users having system and object privileges
  • Users having only system privileges

I can find the owner of all users having system and object privileges.

select distinct d.username,d.account_status,t.privilege,t.owner 
from dba_users d,dba_tab_privs t where d.username=t.grantee
and d.account_status='OPEN';

But this query doesn't fetch the users having only system Privileges. Please help how to find the owner of all those users having only system privileges?

Best Answer

DBA_USERS (Table) will give you access to WHEN your user was created, but AFAIK the only way to get WHO created your user is if auditing is turned on.

This also requires you to have access to the DBA_AUDIT_TRAIL table.

SELECT OS_USERNAME,
   USERNAME AS USER_WHO_CREATED_YOU,
   USERHOST,
   TERMINAL,
   TIMESTAMP,
   OBJ_NAME AS USER_CREATED,
   ACTION_NAME
 FROM DBA_AUDIT_TRAIL
 WHERE 
TIMESTAMP > SYSDATE-90
AND ACTION_NAME ='CREATE USER'
--AND OBJ_NAME = 'YOURUSERNAMEGOESHERE'

Further Reading: https://docs.oracle.com/cd/B19306_01/server.102/b14237/statviews_3056.htm#i1619732