Questions tagged [session]

65 questions
94
votes
4 answers

How to drop all connections to a specific database without stopping the server?

I want to drop all connections (sessions) that are currently opened to a specific PostgreSQL database but without restarting the server or disconnecting connections to other databases. How can I do that?
sorin
  • 1,242
  • 3
  • 11
  • 14
79
votes
3 answers

What is the difference between a connection and a session?

What is the difference between a connection and a session and how they are related?
jrara
  • 5,393
  • 20
  • 58
  • 65
9
votes
1 answer

Find which SESSION_CONTEXT key-value pairs was set

I found that the following query shows how many session context variables was set: SELECT cache_address ,name ,pages_kb ,pages_in_use_kb ,entries_count ,entries_in_use_count FROM sys.dm_os_memory_cache_counters WHERE…
tanitelle
  • 447
  • 1
  • 3
  • 9
8
votes
1 answer

ASPState database locking and growth problems

We use an ASPState database to persist .NET Session state on a SQL Server 2005 cluster. We are seeing some strange behavior during peak periods The DeleteExpiredSessions proc is run every minute via an agent job. Sometimes this job is taking many…
reticentKoala
  • 629
  • 1
  • 12
  • 23
6
votes
3 answers

Can you see other users' session variables in MySQL?

In MySQL, Using SHOW GLOBAL VARIABLES gives the ability to see global variables. SHOW SESSION VARIABLES are the variable settings for that session. Is there a way to see the SESSION variables of other active, connected users, from a superuser…
edinor
  • 143
  • 1
  • 2
  • 8
6
votes
1 answer

If sp_ExecuteSql creates a new session, how come I can access a local temp table created (prior to it's execution) outside of the dynamic SQL?

If local temp tables are only available to the current session, and sp_ExecuteSql creates a new session to execute the dynamic SQL string passed into it, how can that dynamic SQL query access a temp table created in the session that executes…
J.D.
  • 40,776
  • 12
  • 62
  • 141
6
votes
2 answers

what is the penalty for NOT setting Disconnect users in the database when restoring backups?

setting up Log shipping between 2 sql server 2016 servers I want my databases read-only standby on the secondary server. there is a tick box saying Disconnect users in the database when restoring backups. what if I don't tick this box? The restore…
Marcello Miorelli
  • 17,274
  • 53
  • 180
  • 320
5
votes
1 answer

Can an active session in oracle be dead?

I have a time consuming query which populates a materialized view. It has been running for 18 hours - which was not expected. SELECT STATUS FROM V$SESSION WHERE SID=194; The above query shows the session as 'ACTIVE'. I was wondering if that is…
Stelios
  • 389
  • 1
  • 5
  • 14
5
votes
2 answers

Session in "Sql*net message from client", but is active

I've Googled around, and my impression is that Sql*net message from client suggests the Oracle DBMS is waiting for the client to send new commands to the DBMS, and therefore any time spent in this event should be client-side time and not consume…
RAY
  • 191
  • 1
  • 1
  • 5
5
votes
2 answers

Can Status of NOEXEC be Checked with a DMV?

On larger DDL scripts for deployments, usage of SET NOEXEC ON as part of error handling is commonplace to prevent execution of downstream code. If coupled with SET NOCOUNT ON, there's a chance code execution may be inadvertently suppressed unless…
MattyZDBA
  • 1,955
  • 3
  • 20
  • 32
4
votes
1 answer

What are the ramifications of long open sessions?

I'm looking after a SQL server having long open sessions. There is no open transaction, or actively running query (requests) for this session. What is the reason why a session may remain open? Is it because a transaction is opened and not…
variable
  • 3,590
  • 4
  • 37
  • 100
4
votes
2 answers

Is it possible to obtain number of prepared statements a connection holds?

I have a heavy loaded application that holds connections persistently (it creates them on start and never releases). During the lifetime it creates and (re)uses prepared statements, which are stored in an LRU structure (so the least used are…
4
votes
1 answer

When does a MySQL session end?

I have a stored procedure as described below. DROP PROCEDURE `GetVoteID`// CREATE DEFINER=`u1037413_manager`@`%` PROCEDURE `GetVoteID`(IN minimum_votes INT(11), IN current_round INT(11), INOUT votes_id TEXT) BEGIN SET SESSION…
4
votes
1 answer

How to only update if nothing has changed? I need to validate several things before I insert

Say I have two tables: runners and waypoint_checkins. I want to add waypoint checkin entries but I can never add a waypoint if the runner has finished the race, (see below for schema). Finally. A runner can never check into a waypoint if the…
user69927
  • 43
  • 2
3
votes
2 answers

How to check if current SQL session has uncommited changes?

Say you are in SQL Developer and want to check if the current user session (i.e. your connection) has uncommitted changes. If you quit SQL Developer, it does such a check and displays a dialog box how to proceed. I want to check it without exiting -…
maxschlepzig
  • 563
  • 4
  • 6
  • 16
1
2 3 4 5