7. Configuring and Managing VectorH : Session Management : Remove a Vector Session
 
Share this page                  
Remove a Vector Session
You can list or remove Vector sessions, for example, if a query is taking longer than expected to complete. These tasks can be performed using SQL, the iimonitor utility, or the Interactive Performance Monitor.
To remove a session using SQL
1. Connect to the imadb database:
sql imadb
2. Execute the following SQL, which will return a list of active sessions (queries):
SELECT s.server, s.session_id, db_name, session_query,
  (BIGINT((CURRENT_TIMESTAMP - TIMESTAMP_WITH_TZ('1970-01-01 00:00:00+00:00'))/INTERVAL '1' second) - query_start_secs) AS elapsedsecs
FROM ima_server_sessions s,ima_server_sessions_extra e
WHERE s.session_id = e.session_id and s.effective_user != ''
  AND (e.session_state != 'CS_EVENT_WAIT' or e.session_wait_reason != 'BIOR')
  AND db_name NOT IN ('', 'imadb') \g
Results similar to the following (truncated here to fit the space) are returned. Elapsed time is shown further to the right in the actual result.
|server                         |session_id            |db_name|session_query
+-------------------------------+----------------------+-------+-------------
|phantom.vectorwise.com::/@34131|0000000139656236786176|z      | select a.col
Note:  Alternatively, execute this SQL:
EXECUTE PROCEDURE show_session_list \g
3. To remove a session, use the session_id and server_id values returned in Step 2 as parameters on the ima_remove_session procedure. For example:
EXECUTE PROCEDURE ima_remove_session(session_id='0000000139656236786176',server_id='phantom.vectorwise.com::/@34131') \g
Note:  Alternatively, execute this SQL, for example:
EXECUTE PROCEDURE kill_session(session_id='0000000139656236786176') \g
4. To remove all sessions, use this statement:
EXECUTE PROCEDURE ima_drop_all_sessions \g
To remove a session using iimonitor
1. Start the iinamu utility:
iinamu
2. At the IINAMEU> prompt, enter this command to display the server number (GCF address) of your Vector Server:
show ingres
The running servers and their associated server numbers are shown.
3. Start iimonitor using the Vector Server number shown in Step 2:
iimonitor server_number
4. At the IIMONITOR> prompt, list sessions:
show sessions formatted
Session ID and other information are shown. For example:
Session 00007F04412D0200:1093457680
5. Remove the session by using the remove command with the hex number that precedes the colon (:). For example:
remove 00007F04412D0200