Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

locks.sql after server move

Status
Not open for further replies.

barbola

Technical User
Feb 27, 2003
1,132
CA
We moved to a new server, and one of the last steps was to run locks.sql against tempdb.

I couldn't find the sql statement (permissions were messed up) on the weekend, but now I have it and want to run it.

Do I need all the users logged out of Great Plains before I run this?



Thanks!
Barb E.
 
locks.sql is used to create the 2 tables in the tempdb database. Here is the script:

/*Count : 2 */

/*Begin_Clear out TempDB Database */
use tempdb
go
if exists (select * from dbo.sysobjects where id = Object_id('.DEX_LOCK') and type = 'U')
begin
drop table DEX_LOCK
end
go
if exists (select * from dbo.sysobjects where id = Object_id('.DEX_SESSION') and type = 'U')
begin
drop table DEX_SESSION
end
go
/*End_Clear out TempDB Database */

/*Begin_BuildLocks smDEX_Build_Locks */
use master
go
if exists (select * from dbo.sysobjects where id = Object_id('.smDEX_Build_Locks') and type = 'P')
begin
drop procedure smDEX_Build_Locks
end
go
create procedure smDEX_Build_Locks
as
exec ('create table tempdb..DEX_LOCK (session_id int, row_id int, table_path_name char(100))')
exec ('create unique index PK_DEX_LOCK on tempdb..DEX_LOCK(row_id,table_path_name)')
exec ('create table tempdb..DEX_SESSION (session_id int identity, sqlsvr_spid smallint)')
exec ('create unique index PK_DEX_SESSION on tempdb..DEX_SESSION(session_id)')
exec ('use tempdb grant insert,update,select,delete on DEX_LOCK to public')
exec ('use tempdb grant insert,update,select,delete on DEX_SESSION to public')
return
go

sp_procoption 'smDEX_Build_Locks','startup','true'
go

smDEX_Build_Locks
go

/*End_BuildLocks smDEX_Build_Locks */

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top