Some or all of the information on this page might not apply to Trusted Cloud by S3NS.
Terminating sessions
This document describes how session termination works in BigQuery.
It is intended for users who already have a general understanding of
BigQuery sessions.
Before you complete these steps, ensure you have the necessary
permissions to
terminate a session.
Terminating a session
A session can be terminated manually or automatically.
The history of a terminated session is available for 20 days after termination.
Auto-terminate a session
A session is terminated
automatically after 24 hours of inactivity or after 7 days, whichever happens
first.
Terminate the current session
You can terminate your current session with a SQL statement or in the
Trusted Cloud console, if the session was created there.
Console
In the Trusted Cloud console, go to the BigQuery page.
Go to BigQuery
Find the editor tab that contains your session and close it. The session is terminated.
SQL
Do the following to terminate your session:
In the Trusted Cloud console, go to the BigQuery page.
Go to BigQuery
In the query editor, enter the following statement:
CALL BQ.ABORT_SESSION();
Click play_circle Run.
For more information about how to run queries, see Run an interactive query.
Terminate a session by ID
You can terminate a session using its ID. You do not need to be
in the session to terminate it this way.
Get the session ID, and then run the following statement:
CALL BQ.ABORT_SESSION(SESSION_ID);
Replace SESSION_ID with the ID of the session to terminate.
What's next
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-02 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-02 UTC."],[[["Sessions in BigQuery can be terminated either manually or automatically, with a history available for 20 days post-termination."],["Automatic termination occurs after 24 hours of inactivity or 7 days, whichever comes first."],["The current session can be terminated by closing the relevant editor tab in the Google Cloud console, or by using the `CALL BQ.ABORT_SESSION();` SQL statement."],["Any session can be terminated by its unique ID using the SQL statement `CALL BQ.ABORT_SESSION(SESSION_ID);`, even without being in the session."]]],[]]