Solved

SQL 2005 - Database Restore Question

Posted on 2007-12-04
5
403 Views
Last Modified: 2010-05-18
Hi community. Please help.

Looking to restore SQL Server 2005 databases between DELL PowerEdge 1850 servers.

Hardware and SQL 2005 systems are all same build and release, service packs.

However, there are quite a few databases: see below
1  4 SystemDatabases (Master, model, msdb, tempdb)
5 Database Snapshots
DBA_Maint
6 ReportServer
7 ReportServerTempDB
8 STS_Config_TFS
9 STS_Content_TFS
TfsActivityLogging
10 TFsBuild
11 TfsIntegration
12 TfsVersionControl
13 TfsWarehouse
14 TfsWorkItemTracking
15 TfsWorkItemTrackingAttachments

I am just slightly confused here. Although all databases are being backed up to:

F:\SQL_Backups\<Server Name>\<DB Name Folder>...these files are present inside each folder and several of them.
EAHAHTFS01_2007.12.04_00.20.01.000_Trans_Log_Backup_LOG_TfsBuild.trn or
EAHAHTFS01_2007.12.01_04.30.00.347_Trans_Log_Backup_LOG_STS_Content_TFS.trn

Transaction log files maybe.

But think I also need the .mdf Files?  

All database files have .mdf and .ldf files @ location: "F:\Microsoft SQL Server\MSSQL.1\MSSQL\Data"

Can anybody recommend reading, how to screenshots or tips, comments on SQL Server 2005 restores?

The application to restore here is Team Foundation Server, but if necessary, I  will raise another question on that one.  The article found here:  http://msdn2.microsoft.com/en-us/library/ms404869(VS.80).aspx  states how to restore, but not how to backup.

 I've got server database here, just need to backup and restore in SQL Server 2005.
0
Comment
Question by:ActiveInfoSys
5 Comments
 
LVL 25

Accepted Solution

by:
imitchie earned 500 total points
Comment Utility
Ideally, you would not use the automated daily backups if you are transferring servers. Perform a proper backup of all databases at the point of moving. You can specify the backup file name+location then.  The TRN files are transaction log backups, which won't help you much here.

IF using backup/restore, you need to wait for the backup, then the restore.
The faster option in this case is to stop SQL Server completely, and then copy all .MDF+.LDF files across.  From the new SQL Server, attach the databases using Enterprise Manager (2000) or Management Studio (2005).  The UI is quite intuitive, right-click "Databases", task, attach.

Whether you backup/restore or attach, remember to either
a) create all the same nt users; or
b) issue sp_changedbowner on all the databases to a user on the new SQL Server
0
 

Author Comment

by:ActiveInfoSys
Comment Utility
Wow. This is excellent.

Just please give me the full syntax for sp_changedbowner....having issues with this.  Not spelling. This is OK.

Can you give me some samples?  And where to run as well? In what window?
0
 
LVL 8

Expert Comment

by:i2mental
Comment Utility
If you had an owner of dbo on the other server, you likely don't need to do this part, but the syntax for attaching the the system admin account is:

EXEC sp_changedbowner 'sa'

Just run it once for each database specified
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now