Wednesday, March 21, 2012

Restore database file with difference name

I have SQL 2000 SP3 running on Windows Server 2003, I've backup one of the
database to a file and I'll like to copy that file to another SQL 2000
Server and restore it with a difference name. what is the procedures and
how to go about doing it. I did tried to restore but getting the error:
Exclusive access could not be obtained because the database is in use.
Thanks in advance.Hi,
You have to use RESTORE DATABASE with MOVE option.
Eg:-
Restore database <new_dbname> from disk='c;\backup\dbname.bak'
with move 'logical_data_filename' to 'physical_data_filename',
move 'logical_log_filename' to 'physical_log_filename', stats=10
Thanks
Hari
SQL Server MVP
"toby one" <support@.re.com> wrote in message
news:%23ee8Dq6ZFHA.3488@.tk2msftngp13.phx.gbl...
>I have SQL 2000 SP3 running on Windows Server 2003, I've backup one of the
> database to a file and I'll like to copy that file to another SQL 2000
> Server and restore it with a difference name. what is the procedures and
> how to go about doing it. I did tried to restore but getting the error:
> Exclusive access could not be obtained because the database is in use.
> Thanks in advance.
>|||Seems like you want to overwrite an existing database with the overwrite
function in "Restore Database", try specifyin another name and perhpas
change the file locations the data will be restored in. If you make a
restore in the EM, the GUI will read the original destination of the data
and log files. If they already exists and error is thrown, if the directory
doesn´t exists you have to create it first.
--
HTH, Jens Suessmeyer.
--
http://www.sqlserver2005.de
--
"toby one" <support@.re.com> schrieb im Newsbeitrag
news:%23ee8Dq6ZFHA.3488@.tk2msftngp13.phx.gbl...
>I have SQL 2000 SP3 running on Windows Server 2003, I've backup one of the
> database to a file and I'll like to copy that file to another SQL 2000
> Server and restore it with a difference name. what is the procedures and
> how to go about doing it. I did tried to restore but getting the error:
> Exclusive access could not be obtained because the database is in use.
> Thanks in advance.
>|||There's nothing special here. Do the backup, copy the backup file and then do the restore,
specifying the desired database name and possibly using the MOVE option to specify the desired
physical filenames. See the BACKUP DATABASE and RESTORE DATABASE commands in Books Online.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"toby one" <support@.re.com> wrote in message news:%23ee8Dq6ZFHA.3488@.tk2msftngp13.phx.gbl...
>I have SQL 2000 SP3 running on Windows Server 2003, I've backup one of the
> database to a file and I'll like to copy that file to another SQL 2000
> Server and restore it with a difference name. what is the procedures and
> how to go about doing it. I did tried to restore but getting the error:
> Exclusive access could not be obtained because the database is in use.
> Thanks in advance.
>

No comments:

Post a Comment