Current running queries in Google Bigquery via system tables

Viewed 2682

Is there any system tables in Google Bigquery to check all the current running queries? I am looking similar to V$SQL table and v$Session tables in Oracle.

1 Answers

You can query the INFORMATION_SCHEMA.JOBS_BY_* view to retrieve real-time metadata about BigQuery jobs. This view contains currently running jobs, as well as the last 180 days of history of completed jobs.

for example

SELECT
 job_id,
 creation_time,
 query
FROM `region-us`.INFORMATION_SCHEMA.JOBS_BY_USER
WHERE state != "DONE"

Note: Valid states include PENDING, RUNNING, and DONE.

Related