Search code examples
sqlamazon-redshiftdbeaver

How can we find running queries on redshift?


We are struggling to find the equivalent of v$SQLAREA from Oracle on Redshift.

Basically, we need to find the whole queries that are running on Redshift. So far, we could only find a table where we see only a part from a query that is running.


Solution

  • I recommend that you look at svl_statementtext - https://docs.aws.amazon.com/redshift/latest/dg/r_SVL_STATEMENTTEXT.html

    This is a view that looks at queries, ddl, and utility statements and contains the full text of each. Often people want all statements made to the database not just queries. Be aware that for longer statements the text will be split between multiple rows (parts or segments) and will need to be pasted back together with list_agg().