title: Query to get active processes in Oracle
body: <p>I am trying to see what queries are currently running in an oracle DB. However, when I try using the table <code>v$session</code> it gives me an error:</p>
  
  <p><a href="https://i.stack.imgur.com/Npai7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Npai7.png" alt="enter image description here"></a></p>
  
  <p>What's the cause of this and what would be the correct way to get the active processes that are running?</p>
  
  <p>I'm looking to get the necessary information to be able to cancel a query for a given user. Let me give an example:</p>
  
  <p>1) User executes query in the application. We add in a comment so we can 'track' that query:</p>
  
  <pre><code>/* Query-ID-1283849 */ select * from mytable
  </code></pre>
  
  <p>2) Now, if the user clicks the "Cancel" button while the query is running (let's say the query is taking a very long time to respond), we allow the user to cancel that query, given that the user will probably NOT be a sys user but a 'normal' user with read-only privileges.</p>
  
  <p>How could this be done?</p>