Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 SQL Server 7 disaster recovery: How to rebuild from files?

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-01-12 : 08:35:56
Mark writes "The server on which we have SQL Server 7 has crashed but we managed to copy out all of the D: drive which contains the SQL Server installation, database files, etc.

Without having taken database backups before the crash, is there any way to rebuild the SQL Server installation on a different machine using only those directories and files which we copied? We're hoping to rebuild not only the databases but (more importantly) the DTS packages as well.

Any help would be appreciated!

Thanks & regards,
Mark"

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-01-12 : 13:19:28
You could try sp_attach_db using the MDFs and LDFs but it doesn't always work. It does when you copy these files once the MSSQLSERVER service is stopped OR you ran sp_detach_db prior to the copy.

Tara
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2005-01-13 : 19:29:31
1. Install SQL 7 on the new server drive D with the same directory structure as the old server and apply the SQL Server service packs to get to the same level as the old server.
2. Shutdown SQL Server, and rename the directory with the databases, probably D:\MSSQL7\Data to D:\MSSQL7\DataOld
3. Create a new directory with the same name, D:\MSSQL7\Data, and copy all of the database files to the new directory. Copy any other database files to directories with the exact same Drive\directory name as the old server.
4. Start SQL Server. If it starts OK you are good.
5. You might want to update the server name in master.dbo.sysservers to reflect the new server name, and to get the value of @@servername to match the new server name. I forget the exact procedure for that, but it's the row with srvid = 0. You have to restart SQL Server after you do this.

quote:
Originally posted by AskSQLTeam

Mark writes "The server on which we have SQL Server 7 has crashed but we managed to copy out all of the D: drive which contains the SQL Server installation, database files, etc.

Without having taken database backups before the crash, is there any way to rebuild the SQL Server installation on a different machine using only those directories and files which we copied? We're hoping to rebuild not only the databases but (more importantly) the DTS packages as well.

Any help would be appreciated!

Thanks & regards,
Mark"



Codo Ergo Sum
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2005-01-14 : 16:43:15
Code to update the server name in sysservers


use master
go
-- Allow updates to system tables
exec sp_configure @configname = 'allow updates' , @configvalue = '1'
go
reconfigure with override
go
exec sp_configure
go

--exec sp_help sysservers

-- Display the current valuse from sysservers
select * from sysservers
select srvname from sysservers where srvid = 0
select datasource from sysservers where srvid = 0
select srvnetname from sysservers where srvid = 0
select [@@servername] = @@servername

declare @newname sysname
-- Enter new server name
select @newname = 'NEWSERVERNAME'

update sysservers
set
srvname = @newname
,datasource = @newname
where
srvid = 0

go
-- Turn off updates to system tables
exec sp_configure @configname = 'allow updates' , @configvalue = '0'
go
reconfigure with override
go
exec sp_configure
go
-- Shutdown SQL Server and restart it after changing the server name to update


quote:
Originally posted by Michael Valentine Jones


5. You might want to update the server name in master.dbo.sysservers to reflect the new server name, and to get the value of @@servername to match the new server name. I forget the exact procedure for that, but it's the row with srvid = 0. You have to restart SQL Server after you do this.




Codo Ergo Sum
Go to Top of Page
   

- Advertisement -