Viewing backup in a different location
am 21.06.2007 16:54:15 von steve f
i have a copy of a SQL Server 2000 database on an external hardrive.
I have SQL Enterprise Manager 2005 on my laptop and was wondering if
it is possible to view the backup on my laptop when external hard
drive is plugged in.
What other software/tools/procedures do i need to do to make the
backup "viewable"
Regards
Steve F
Re: Viewing backup in a different location
am 22.06.2007 00:02:33 von Erland Sommarskog
Steve F (scfisher@gmail.com) writes:
> i have a copy of a SQL Server 2000 database on an external hardrive.
>
> I have SQL Enterprise Manager 2005 on my laptop and was wondering if
> it is possible to view the backup on my laptop when external hard
> drive is plugged in.
>
> What other software/tools/procedures do i need to do to make the
> backup "viewable"
It is not fully clear to me if you have a backup of the database,
or a copy of the MDF and LDF files. But assuming you have a backup,
first to:
RESTORE FILELISTONLY FROM DISK ='X:\...\backup.bak'
where X is the drive-letter for your removable disk. Pay attention to
the column logical name. Then restore the database with this command:
RESTORE DATABASE db FROM DISK='X:\...\backup.bak' WITH
MOVE 'LogicalName1' TO
'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\db.mdf',
MOVE 'LogicalName2' TO
'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\db.ldf',
REPLACE
You could choose other physical locations for the database if you wish.
You could also use the GUI in Management Studio to perform the RESTORE,
but I don't use that myself.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downlo ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books .mspx