1.
SELECT USERNAME,CASE WHEN EXPIRY_DATE IS NOT NULL THEN TO_CHAR(EXPIRY_DATE,'DD-MON-YYYY HH24:MI:SS') END AS EXPIRY_DATE,CASE WHEN (EXPIRY_DATE > SYSDATE) THEN (trunc(EXPIRY_DATE)-trunc(SYSDATE)) WHEN (ACCOUNT_STATUS!='OPEN') THEN 0 ELSE null END as DAYSTOEXPIRY,ACCOUNT_STATUS,PROFILE FROM DBA_USERS WHERE CREATED > (select CREATED from v$database);
2.
select * from DBA_USERS;