Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, May 3, 2024 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Administration Forums - Database Administration
Forum to discuss SQL Server or Oracle database administration related to SalesLogix databases. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to Database Administration | New ThreadView:  Search:  
 Author  Thread: SQL Maintenance Hangs Because Of SLX Query
Leon Gort
Posts: 127
 
SQL Maintenance Hangs Because Of SLX QueryYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Jul 08 12:29 AM
I have some maintenance scripts that run on a weekend including reindexing, updating statistics etc. What I am finding is when they kick off they get "stuck" by a NETWORKIO lock created by a user that has not closed the SLX client. (just a select statement from a group) It is almost always caused by 1 particular user but it has happened on others. I kill the process for the user and everything runs fine.

It's SLX 5.2 with SQL2000. I have no problems with locks, performance during the week and if I restart the SQL service before the maintenance runs, the maintenance runs without a problem.

Any ideas?
Thx
Leon
[Reply][Quote]
Phil Parkin
Posts: 819
Top 10 forum poster: 819 posts
 
Re: SQL Maintenance Hangs Because Of SLX QueryYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Jul 08 1:44 AM
Do you just want a way of killing user processes on the SQL Server side that runs before your system maintenance jobs?

Phil
[Reply][Quote]
Leon Gort
Posts: 127
 
Re: SQL Maintenance Hangs Because Of SLX QueryYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Jul 08 1:56 AM
That would definitely help in the meantime until I find the cause!
[Reply][Quote]
Phil Parkin
Posts: 819
Top 10 forum poster: 819 posts
 
Re: SQL Maintenance Hangs Because Of SLX QueryYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Jul 08 2:14 AM
OK, I'm plagiarising here - thanks to SQLServerCentral.com and users there.

First thing to do is create a stored procedure somewhere - ideally in your Master database:


CREATE PROCEDURE kill_database_users @arg_dbname sysname with recompile
AS

-- kills all the users in a particular database
-- dlhatheway/3M, 11-Jun-2000

declare @a_spid smallint
declare @msg varchar(255)
declare @a_dbid int

select
@a_dbid = sdb.dbid
from master..sysdatabases sdb
where sdb.name = @arg_dbname

declare db_users insensitive cursor for
select
sp.spid
from master..sysprocesses sp
where sp.dbid = @a_dbid

open db_users

fetch next from db_users into @a_spid
while @@fetch_status = 0
begin
select @msg = 'kill '+convert(char(5),@a_spid)
print @msg
execute (@msg)
fetch next from db_users into @a_spid
end

close db_users
deallocate db_users
GO



Once this is created, to disconnect users from a particular database (let's use 'SalesLogix_Eval' as an example), you just need to issue this command:

exec kill_database_users 'SalesLogix_Eval'

Be careful when you test this

I take no responsibility for the code, by the way - just trying to help.

Phil






[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 5/3/2024 2:14:58 PM