From the course: Database Foundations: Administration

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Closing user sessions

Closing user sessions

From the course: Database Foundations: Administration

Start my 1-month free trial

Closing user sessions

- [Instructor] Sometimes users connect to a database server, perform some tasks and then leave, but the server doesn't drop the connection. These connections can remain open, consuming system resources. You can periodically review and close unneeded connections as part of a routine maintenance activity. In PostgreSQL, we can go ahead and open up a new query, and then we can review connection details by pulling information from the PG stat activity catalog view. This shows me connections to each database on the server in the dat name column. Now it's probably useful to focus on just the two trees database, so I'm going to add a where clause up here to the select query. So we'll focus the results to just the rows where the dat name, or the database name, is equal to two trees DBF4. Each row in this result set, represents an open connection to the two trees database. The PID column lists the unique connection ID number for…

Contents