Solved

SQL 2005 - Database Restore Question

Posted on 2007-12-04
5
406 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
ID: 20402164
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
ID: 20402565
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
ID: 20402721
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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

867 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

23 Experts available now in Live!

Get 1:1 Help Now