sql server - How do I kill connections to Azure SQL database if I can't access it? -
today migrated azuresql v12. tonight site offline, because of persistent issue following message:
resource id : 3. loginlimit limit database 90 , has been reached. see 'http://go.microsoft.com/fwlink/?linkid=267637' assistance. (microsoft sql server, error: 10928)
i've tried following:
- restarted web site's server (also tried iisreset , restarting web app)
- removed ip filters in azure portal (including access azure services)
- upscaled next tier in azure (it stuck on "in progress" , not changing, guess connections preventing upscale)
i can't connect database via ssms. same error message. has lasted hours now, , site offline, yet number of logins not changing.
i need way disconnect of these connections can on , diagnose issue might be.
to see existing connections on azure sql db use query:
select c.session_id, c.net_transport, c.encrypt_option, s.status, c.auth_scheme, s.host_name, s.program_name, s.client_interface_name, s.login_name, s.nt_domain, s.nt_user_name, s.original_login_name, c.connect_time, s.login_time sys.dm_exec_connections c join sys.dm_exec_sessions s on c.session_id = s.session_id --where c.session_id = @@spid; --where status = 'sleeping' order c.connect_time asc to kill connections except mine (spid) use query:
declare @kill varchar(8000) = ''; select @kill = @kill + 'kill ' + convert(varchar(5), c.session_id) + ';' sys.dm_exec_connections c join sys.dm_exec_sessions s on c.session_id = s.session_id c.session_id <> @@spid --where status = 'sleeping' order c.connect_time asc exec(@kill)
Comments
Post a Comment