Questions tagged [session]

57 questions
82
votes
3 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,092
  • 3
  • 10
  • 14
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
  • 9
  • 23
7
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
  • 397
  • 1
  • 2
  • 9
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
  • 133
  • 1
  • 2
  • 8
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
  • 339
  • 1
  • 4
  • 14
5
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.
  • 22,196
  • 3
  • 34
  • 78
5
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
  • 14,544
  • 46
  • 126
  • 249
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,913
  • 2
  • 19
  • 26
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
  • 515
  • 3
  • 6
  • 15
3
votes
2 answers

How are DB locks tied to connections and sessions?

I've heard of page- and row-level locks, but never heard them used with regards to sessions and connections. Today, our (MySQL) DBA was talking about row locks and implied that their scope can be set at the connection or session level. Is this true,…
Mara
  • 237
  • 1
  • 3
  • 5
2
votes
2 answers

How to change SESSION_CACHED_CURSORS for all sessions

how Can I do to change SESSION_CACHED_CURSORS for all sessions? I found on google and oracle website: Alter Session... but I need to changed it for all the session and not only for one of them. How can I do it? UPDATE 1: SQL> alter session set…
jcho360
  • 1,960
  • 7
  • 23
  • 31
2
votes
1 answer

Diagnosing Blocking issues using Blocked Process report

I have an application that is going down as a result of timeouts. During these times we see a massive spike in response times from the database that holds ASP session state. In an effort to to diagnose the issue I have used SP_CONFIGURE'blocked…
reticentKoala
  • 629
  • 1
  • 9
  • 23
1
2 3 4