How to Find Role Creation Date in Oracle
In this article, we will prepare an SQL command for How to Find ROLE Creation Date in Oracle. View DBA_ROLES doesn’t have a column for ROLE creation date however we fetch other information about ROLE after creation. To achieve it we use the base table SYS.USER$ of DBA_ROLES. Table SYS.USER$ has column CTIME to fulfill this requirement.
⇒ TYPE#: 0 for ROLE, 1 for USER.
⇒ NAME: Name of USER or ROLE
⇒ CTIME: Creation date.
Execute the below command to find the ROLE creation date timestamp.
COL NAME FORMAT A25
COL CREATE_TIME FORMAT A25
SELECT TYPE#, NAME, TO_CHAR(CTIME,'DD-MON-YYYY HH24:MI:SS') CREATE_DATE_TIME FROM SYS.USER$ WHERE NAME = 'USER_GRANT_READ_ONLY';
prompt$$$$$$$**Welcome to DBsGuru!**Share Learn Grow**$$$$$$$
TYPE# NAME CREATE_DATE_TIME
---------- ------------------------- -----------------------------
0 USER_GRANT_READ_ONLY 03-JUN-2021 12:08:30
SQL>
$$$$$$$**Welcome to DBsGuru!**Share Learn Grow**$$$$$$$
Click here to know more about How to Grant READ ONLY Access on Schema Using ROLE in Oracle.
We always encourage the technical person to visit section SCRIPTS to get more daily usage SQL commands.
Hope so you like this Script!
Please share your valuable feedback/comments/subscribe and follow us below and don’t forget to click on the bell icon to get the latest update. Click here to know more about our pursuit.