title: How to create an Oracle stored procedure to lock user accounts not logged onto database for more than 90 days
body: <p>How do I create an Oracle Stored Procedure to lock user accounts that's not logged onto the database for more than 90 days?</p>
  
  <p>I assumed that I could create a Profile Object and list the Resource Parameters in my database but I am using Oracle 11g and it appears that feature doesn't exist.</p>
  
  <p>This is what I tried so far:</p>
  
  <pre><code>select username from dba_audit_trail
  where  action_name = 'LOGON'
  group  by username
  having max(timestamp) &lt; sysdate - 90
  </code></pre>
  
  <p>I also attempted to create a profile attempting to use INACTIVE_ACCOUNT_TIME as my Resource Parameters but it does not exist in Oracle 11g:</p>
  
  <pre><code>CREATE PROFILE time_limit LIMIT 
  INACTIVE_ACCOUNT_TIME 90;
  </code></pre>