Showing posts with label restore. Show all posts
Showing posts with label restore. Show all posts

Thursday, March 29, 2012

Copy MDF and LDF files Over Existing Database

I am not a DBA and it will be obvious to you soon. I have two
databases on the same server. I want to basically restore a db from an
existing db on the same server. The catch is that I don't want to
restore from a backup file and I have to enable this process to run by
the class instructor through an ASP page calling a stored proc. Due to
time limitations between training classes I would just like to copy the
.MDF and .LDF from the Source db to the destination db and attach it.
I was trying the code below:
RESTORE DATABASE train
FROM train_devo
WITH RECOVERY,
MOVE 'c:\train_devo_data.mdf' TO 'c:\train_data.mdf',
MOVE 'c:\train_devo_log.ldf' TO 'c:\train_log.ldf'
GO
I am getting the error:
Server: Msg 3206, Level 16, State 1, Line 1
No entry in sysdevices for backup device 'train_devo'. Update
sysdevices and rerun statement.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
I know that I will need to kill active processes and that my record
doesn't exist in the sysdevices table but I don't have enough time
right now to study this completely.
Any help is greatly appreciated.
Thanks
BenBACKUP and RESTORE are fast operations on small databases, you might want to
try that method.
You could restore
FROM FILE = 'x:\train.bak'
or
from the "device" train_devo. You have to set up this device first, so it
might just be easier to to restore from file.
You will want to (need to) use REPLACE to replace the files if they already
exist.
Keith Kratochvil
<bcumminsr@.yahoo.com> wrote in message
news:1153259948.748817.240020@.m73g2000cwd.googlegroups.com...
>I am not a DBA and it will be obvious to you soon. I have two
> databases on the same server. I want to basically restore a db from an
> existing db on the same server. The catch is that I don't want to
> restore from a backup file and I have to enable this process to run by
> the class instructor through an ASP page calling a stored proc. Due to
> time limitations between training classes I would just like to copy the
> .MDF and .LDF from the Source db to the destination db and attach it.
> I was trying the code below:
> RESTORE DATABASE train
> FROM train_devo
> WITH RECOVERY,
> MOVE 'c:\train_devo_data.mdf' TO 'c:\train_data.mdf',
> MOVE 'c:\train_devo_log.ldf' TO 'c:\train_log.ldf'
> GO
> I am getting the error:
> Server: Msg 3206, Level 16, State 1, Line 1
> No entry in sysdevices for backup device 'train_devo'. Update
> sysdevices and rerun statement.
> Server: Msg 3013, Level 16, State 1, Line 1
> RESTORE DATABASE is terminating abnormally.
> I know that I will need to kill active processes and that my record
> doesn't exist in the sysdevices table but I don't have enough time
> right now to study this completely.
> Any help is greatly appreciated.
> Thanks
> Ben
>|||bcumminsr@.yahoo.com wrote:
> I am not a DBA and it will be obvious to you soon. I have two
> databases on the same server. I want to basically restore a db from an
> existing db on the same server. The catch is that I don't want to
> restore from a backup file and I have to enable this process to run by
> the class instructor through an ASP page calling a stored proc. Due to
> time limitations between training classes I would just like to copy the
> .MDF and .LDF from the Source db to the destination db and attach it.
> I was trying the code below:
> RESTORE DATABASE train
> FROM train_devo
> WITH RECOVERY,
> MOVE 'c:\train_devo_data.mdf' TO 'c:\train_data.mdf',
> MOVE 'c:\train_devo_log.ldf' TO 'c:\train_log.ldf'
> GO
> I am getting the error:
> Server: Msg 3206, Level 16, State 1, Line 1
> No entry in sysdevices for backup device 'train_devo'. Update
> sysdevices and rerun statement.
> Server: Msg 3013, Level 16, State 1, Line 1
> RESTORE DATABASE is terminating abnormally.
> I know that I will need to kill active processes and that my record
> doesn't exist in the sysdevices table but I don't have enough time
> right now to study this completely.
> Any help is greatly appreciated.
> Thanks
> Ben
>
Hi
You can use BACKUP/RESTORE as suggested by Keith, or you can detach the
existing database, copy the files, and then reattach the db's again.
Try to look up RESTORE and sp_detach_db/sp_attach_db in Books On Line
for details.
Regards
Steen Schlter Persson
Databaseadministrator / Systemadministrator|||underprocessable|||Steen Persson (DK) wrote:
> bcumminsr@.yahoo.com wrote:
> Hi
> You can use BACKUP/RESTORE as suggested by Keith, or you can detach the
> existing database, copy the files, and then reattach the db's again.
> Try to look up RESTORE and sp_detach_db/sp_attach_db in Books On Line
> for details.
>
> --
> Regards
> Steen Schl=FCter Persson
> Databaseadministrator / Systemadministrator
> --030204050507050003020602
> Content-Type: text/html; charset=3DISO-8859-1
> X-Google-AttachSize: 2025
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> <meta content=3D"text/html;charset=3DISO-8859-1" http-equiv=3D"Content-=
Type">
> </head>
> <body bgcolor=3D"#ffffff" text=3D"#000000">
> <a class=3D"moz-txt-link-abbreviated" href=3D"mailto:bcumminsr@.yahoo.com"=
>bcumminsr@.yahoo.com</a> wrote:
> <blockquote
> cite=3D"mid1153259948.748817.240020@.m73g2000cwd.googlegroups.com"
> type=3D"cite">
> <pre wrap=3D"">I am not a DBA and it will be obvious to you soon. I=
have two
> databases on the same server. I want to basically restore a db from an
> existing db on the same server. The catch is that I don't want to
> restore from a backup file and I have to enable this process to run by
> the class instructor through an ASP page calling a stored proc. Due to
> time limitations between training classes I would just like to copy the
> .MDF and .LDF from the Source db to the destination db and attach it.
> I was trying the code below:
> RESTORE DATABASE train
> FROM train_devo
> WITH RECOVERY,
> MOVE 'c:\train_devo_data.mdf' TO 'c:\train_data.mdf',
> MOVE 'c:\train_devo_log.ldf' TO 'c:\train_log.ldf'
> GO
> I am getting the error:
> Server: Msg 3206, Level 16, State 1, Line 1
> No entry in sysdevices for backup device 'train_devo'. Update
> sysdevices and rerun statement.
> Server: Msg 3013, Level 16, State 1, Line 1
> RESTORE DATABASE is terminating abnormally.
> I know that I will need to kill active processes and that my record
> doesn't exist in the sysdevices table but I don't have enough time
> right now to study this completely.
> Any help is greatly appreciated.
> Thanks
> Ben
> </pre>
> </blockquote>
> <font size=3D"-1"><font face=3D"Arial">Hi<br>
> <br>
> You can use BACKUP/RESTORE as suggested by Keith, or you can detach the
> existing database, copy the files, and then reattach the db's again. <br>
> <br>
> Try to look up RESTORE and sp_detach_db/sp_attach_db in Books On Line
> for details.<br>
> <br>
> <br>
> -- <br>
> Regards<br>
> Steen Schlüter Persson<br>
> Databaseadministrator / Systemadministrator<br>
> </font></font>
> </body>
> </html>
> --030204050507050003020602--
Thanks for all of your help. I need to do this using T-SQL and I can't
get the RESTORE command to work. Is it possible to copy the MDF and LDF
using T-SQL to a different location? Thanks|||Why doesn't it work? What errors do you receive?
Keith Kratochvil
<bcumminsr@.yahoo.com> wrote in message
news:1153327247.825744.46880@.75g2000cwc.googlegroups.com...
Thanks for all of your help. I need to do this using T-SQL and I can't
get the RESTORE command to work. Is it possible to copy the MDF and LDF
using T-SQL to a different location? Thanks|||bcumminsr@.yahoo.com wrote:
> Steen Persson (DK) wrote:
>
> Thanks for all of your help. I need to do this using T-SQL and I can't
> get the RESTORE command to work. Is it possible to copy the MDF and LDF
> using T-SQL to a different location? Thanks
>
You'll have to give us some more than just "it doesn't work". If you
want to copy the files using T-sql, you can look up xp_cmdshell in Books
On Line.
Regards
Steen Schlter Persson
Databaseadministrator / Systemadministrator

Copy MDF and LDF files Over Existing Database

I am not a DBA and it will be obvious to you soon. :) I have two
databases on the same server. I want to basically restore a db from an
existing db on the same server. The catch is that I don't want to
restore from a backup file and I have to enable this process to run by
the class instructor through an ASP page calling a stored proc. Due to
time limitations between training classes I would just like to copy the
.MDF and .LDF from the Source db to the destination db and attach it.
I was trying the code below:
RESTORE DATABASE train
FROM train_devo
WITH RECOVERY,
MOVE 'c:\train_devo_data.mdf' TO 'c:\train_data.mdf',
MOVE 'c:\train_devo_log.ldf' TO 'c:\train_log.ldf'
GO
I am getting the error:
Server: Msg 3206, Level 16, State 1, Line 1
No entry in sysdevices for backup device 'train_devo'. Update
sysdevices and rerun statement.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
I know that I will need to kill active processes and that my record
doesn't exist in the sysdevices table but I don't have enough time
right now to study this completely.
Any help is greatly appreciated.
Thanks
BenBACKUP and RESTORE are fast operations on small databases, you might want to
try that method.
You could restore
FROM FILE = 'x:\train.bak'
or
from the "device" train_devo. You have to set up this device first, so it
might just be easier to to restore from file.
You will want to (need to) use REPLACE to replace the files if they already
exist.
Keith Kratochvil
<bcumminsr@.yahoo.com> wrote in message
news:1153259948.748817.240020@.m73g2000cwd.googlegroups.com...
>I am not a DBA and it will be obvious to you soon. :) I have two
> databases on the same server. I want to basically restore a db from an
> existing db on the same server. The catch is that I don't want to
> restore from a backup file and I have to enable this process to run by
> the class instructor through an ASP page calling a stored proc. Due to
> time limitations between training classes I would just like to copy the
> .MDF and .LDF from the Source db to the destination db and attach it.
> I was trying the code below:
> RESTORE DATABASE train
> FROM train_devo
> WITH RECOVERY,
> MOVE 'c:\train_devo_data.mdf' TO 'c:\train_data.mdf',
> MOVE 'c:\train_devo_log.ldf' TO 'c:\train_log.ldf'
> GO
> I am getting the error:
> Server: Msg 3206, Level 16, State 1, Line 1
> No entry in sysdevices for backup device 'train_devo'. Update
> sysdevices and rerun statement.
> Server: Msg 3013, Level 16, State 1, Line 1
> RESTORE DATABASE is terminating abnormally.
> I know that I will need to kill active processes and that my record
> doesn't exist in the sysdevices table but I don't have enough time
> right now to study this completely.
> Any help is greatly appreciated.
> Thanks
> Ben
>|||This is a multi-part message in MIME format.
--030204050507050003020602
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
bcumminsr@.yahoo.com wrote:
> I am not a DBA and it will be obvious to you soon. :) I have two
> databases on the same server. I want to basically restore a db from an
> existing db on the same server. The catch is that I don't want to
> restore from a backup file and I have to enable this process to run by
> the class instructor through an ASP page calling a stored proc. Due to
> time limitations between training classes I would just like to copy the
> .MDF and .LDF from the Source db to the destination db and attach it.
> I was trying the code below:
> RESTORE DATABASE train
> FROM train_devo
> WITH RECOVERY,
> MOVE 'c:\train_devo_data.mdf' TO 'c:\train_data.mdf',
> MOVE 'c:\train_devo_log.ldf' TO 'c:\train_log.ldf'
> GO
> I am getting the error:
> Server: Msg 3206, Level 16, State 1, Line 1
> No entry in sysdevices for backup device 'train_devo'. Update
> sysdevices and rerun statement.
> Server: Msg 3013, Level 16, State 1, Line 1
> RESTORE DATABASE is terminating abnormally.
> I know that I will need to kill active processes and that my record
> doesn't exist in the sysdevices table but I don't have enough time
> right now to study this completely.
> Any help is greatly appreciated.
> Thanks
> Ben
>
Hi
You can use BACKUP/RESTORE as suggested by Keith, or you can detach the
existing database, copy the files, and then reattach the db's again.
Try to look up RESTORE and sp_detach_db/sp_attach_db in Books On Line
for details.
Regards
Steen Schlüter Persson
Databaseadministrator / Systemadministrator
--030204050507050003020602
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<a class="moz-txt-link-abbreviated" href="http://links.10026.com/?link=mailto:bcumminsr@.yahoo.com">bcumminsr@.yahoo.com</a> wrote:
<blockquote
cite="mid1153259948.748817.240020@.m73g2000cwd.googlegroups.com"
type="cite">
<pre wrap="">I am not a DBA and it will be obvious to you soon. :) I have two
databases on the same server. I want to basically restore a db from an
existing db on the same server. The catch is that I don't want to
restore from a backup file and I have to enable this process to run by
the class instructor through an ASP page calling a stored proc. Due to
time limitations between training classes I would just like to copy the
.MDF and .LDF from the Source db to the destination db and attach it.
I was trying the code below:
RESTORE DATABASE train
FROM train_devo
WITH RECOVERY,
MOVE 'c:\train_devo_data.mdf' TO 'c:\train_data.mdf',
MOVE 'c:\train_devo_log.ldf' TO 'c:\train_log.ldf'
GO
I am getting the error:
Server: Msg 3206, Level 16, State 1, Line 1
No entry in sysdevices for backup device 'train_devo'. Update
sysdevices and rerun statement.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
I know that I will need to kill active processes and that my record
doesn't exist in the sysdevices table but I don't have enough time
right now to study this completely.
Any help is greatly appreciated.
Thanks
Ben
</pre>
</blockquote>
<font size="-1"><font face="Arial">Hi<br>
<br>
You can use BACKUP/RESTORE as suggested by Keith, or you can detach the
existing database, copy the files, and then reattach the db's again. <br>
<br>
Try to look up RESTORE and sp_detach_db/sp_attach_db in Books On Line
for details.<br>
<br>
<br>
-- <br>
Regards<br>
Steen Schlüter Persson<br>
Databaseadministrator / Systemadministrator<br>
</font></font>
</body>
</html>
--030204050507050003020602--|||By the way: I mentioned that you should use backup and restore because of
this blurb related to sp_attach_db within the SQL Server 2005 Books Online:
Important:
This feature will be removed in a future version of Microsoft SQL
Server. Avoid using this feature in new development work, and plan to modify
applications that currently use this feature. We recommend that you use
CREATE DATABASE database_name FOR ATTACH instead. For more information, see
CREATE DATABASE (Transact-SQL).
Keith Kratochvil
"Keith Kratochvil" <sqlguy.back2u@.comcast.net> wrote in message
news:OLkoterqGHA.4912@.TK2MSFTNGP05.phx.gbl...
> BACKUP and RESTORE are fast operations on small databases, you might want
> to
> try that method.
> You could restore
> FROM FILE = 'x:\train.bak'
> or
> from the "device" train_devo. You have to set up this device first, so it
> might just be easier to to restore from file.
>
> You will want to (need to) use REPLACE to replace the files if they
> already
> exist.
>
> --
> Keith Kratochvil
>
> <bcumminsr@.yahoo.com> wrote in message
> news:1153259948.748817.240020@.m73g2000cwd.googlegroups.com...
>>I am not a DBA and it will be obvious to you soon. :) I have two
>> databases on the same server. I want to basically restore a db from an
>> existing db on the same server. The catch is that I don't want to
>> restore from a backup file and I have to enable this process to run by
>> the class instructor through an ASP page calling a stored proc. Due to
>> time limitations between training classes I would just like to copy the
>> .MDF and .LDF from the Source db to the destination db and attach it.
>> I was trying the code below:
>> RESTORE DATABASE train
>> FROM train_devo
>> WITH RECOVERY,
>> MOVE 'c:\train_devo_data.mdf' TO 'c:\train_data.mdf',
>> MOVE 'c:\train_devo_log.ldf' TO 'c:\train_log.ldf'
>> GO
>> I am getting the error:
>> Server: Msg 3206, Level 16, State 1, Line 1
>> No entry in sysdevices for backup device 'train_devo'. Update
>> sysdevices and rerun statement.
>> Server: Msg 3013, Level 16, State 1, Line 1
>> RESTORE DATABASE is terminating abnormally.
>> I know that I will need to kill active processes and that my record
>> doesn't exist in the sysdevices table but I don't have enough time
>> right now to study this completely.
>> Any help is greatly appreciated.
>> Thanks
>> Ben
>
begin 666 note.gif
M1TE&.#EA"@.`*`+,)`/\$`/]=6L;#QM;3UO_/`(2&A(R.C ```/__SO___P``
M`````````````````````"'Y! $```D`+ `````*``H```0HT,@.Y1 `&Z7T(
AWEIW)!E'C.16G$.2(L-1((5;%D-H@._H+HH>@.,.B*```[
`
end|||Steen Persson (DK) wrote:
> bcumminsr@.yahoo.com wrote:
> > I am not a DBA and it will be obvious to you soon. :) I have two
> > databases on the same server. I want to basically restore a db from an
> > existing db on the same server. The catch is that I don't want to
> > restore from a backup file and I have to enable this process to run by
> > the class instructor through an ASP page calling a stored proc. Due to
> > time limitations between training classes I would just like to copy the
> > .MDF and .LDF from the Source db to the destination db and attach it.
> >
> > I was trying the code below:
> >
> > RESTORE DATABASE train
> > FROM train_devo
> > WITH RECOVERY,
> > MOVE 'c:\train_devo_data.mdf' TO 'c:\train_data.mdf',
> > MOVE 'c:\train_devo_log.ldf' TO 'c:\train_log.ldf'
> > GO
> >
> > I am getting the error:
> > Server: Msg 3206, Level 16, State 1, Line 1
> > No entry in sysdevices for backup device 'train_devo'. Update
> > sysdevices and rerun statement.
> > Server: Msg 3013, Level 16, State 1, Line 1
> > RESTORE DATABASE is terminating abnormally.
> >
> > I know that I will need to kill active processes and that my record
> > doesn't exist in the sysdevices table but I don't have enough time
> > right now to study this completely.
> >
> > Any help is greatly appreciated.
> > Thanks
> > Ben
> >
> >
> Hi
> You can use BACKUP/RESTORE as suggested by Keith, or you can detach the
> existing database, copy the files, and then reattach the db's again.
> Try to look up RESTORE and sp_detach_db/sp_attach_db in Books On Line
> for details.
>
> --
> Regards
> Steen Schl=FCter Persson
> Databaseadministrator / Systemadministrator
> --030204050507050003020602
> Content-Type: text/html; charset=3DISO-8859-1
> X-Google-AttachSize: 2025
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> <meta content=3D"text/html;charset=3DISO-8859-1" http-equiv=3D"Content-=Type">
> </head>
> <body bgcolor=3D"#ffffff" text=3D"#000000">
> <a class=3D"moz-txt-link-abbreviated" href=3D"mailto:bcumminsr@.yahoo.com"=>bcumminsr@.yahoo.com</a> wrote:
> <blockquote
> cite=3D"mid1153259948.748817.240020@.m73g2000cwd.googlegroups.com"
> type=3D"cite">
> <pre wrap=3D"">I am not a DBA and it will be obvious to you soon. :) I= have two
> databases on the same server. I want to basically restore a db from an
> existing db on the same server. The catch is that I don't want to
> restore from a backup file and I have to enable this process to run by
> the class instructor through an ASP page calling a stored proc. Due to
> time limitations between training classes I would just like to copy the
> .MDF and .LDF from the Source db to the destination db and attach it.
> I was trying the code below:
> RESTORE DATABASE train
> FROM train_devo
> WITH RECOVERY,
> MOVE 'c:\train_devo_data.mdf' TO 'c:\train_data.mdf',
> MOVE 'c:\train_devo_log.ldf' TO 'c:\train_log.ldf'
> GO
> I am getting the error:
> Server: Msg 3206, Level 16, State 1, Line 1
> No entry in sysdevices for backup device 'train_devo'. Update
> sysdevices and rerun statement.
> Server: Msg 3013, Level 16, State 1, Line 1
> RESTORE DATABASE is terminating abnormally.
> I know that I will need to kill active processes and that my record
> doesn't exist in the sysdevices table but I don't have enough time
> right now to study this completely.
> Any help is greatly appreciated.
> Thanks
> Ben
> </pre>
> </blockquote>
> <font size=3D"-1"><font face=3D"Arial">Hi<br>
> <br>
> You can use BACKUP/RESTORE as suggested by Keith, or you can detach the
> existing database, copy the files, and then reattach the db's again. <br>
> <br>
> Try to look up RESTORE and sp_detach_db/sp_attach_db in Books On Line
> for details.<br>
> <br>
> <br>
> -- <br>
> Regards<br>
> Steen Schlüter Persson<br>
> Databaseadministrator / Systemadministrator<br>
> </font></font>
> </body>
> </html>
> --030204050507050003020602--
Thanks for all of your help. I need to do this using T-SQL and I can't
get the RESTORE command to work. Is it possible to copy the MDF and LDF
using T-SQL to a different location? Thanks|||Why doesn't it work? What errors do you receive?
--
Keith Kratochvil
<bcumminsr@.yahoo.com> wrote in message
news:1153327247.825744.46880@.75g2000cwc.googlegroups.com...
Thanks for all of your help. I need to do this using T-SQL and I can't
get the RESTORE command to work. Is it possible to copy the MDF and LDF
using T-SQL to a different location? Thanks|||This is a multi-part message in MIME format.
--050402070308080300020405
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
bcumminsr@.yahoo.com wrote:
> Steen Persson (DK) wrote:
>> bcumminsr@.yahoo.com wrote:
>> I am not a DBA and it will be obvious to you soon. :) I have two
>> databases on the same server. I want to basically restore a db from an
>> existing db on the same server. The catch is that I don't want to
>> restore from a backup file and I have to enable this process to run by
>> the class instructor through an ASP page calling a stored proc. Due to
>> time limitations between training classes I would just like to copy the
>> .MDF and .LDF from the Source db to the destination db and attach it.
>> I was trying the code below:
>> RESTORE DATABASE train
>> FROM train_devo
>> WITH RECOVERY,
>> MOVE 'c:\train_devo_data.mdf' TO 'c:\train_data.mdf',
>> MOVE 'c:\train_devo_log.ldf' TO 'c:\train_log.ldf'
>> GO
>> I am getting the error:
>> Server: Msg 3206, Level 16, State 1, Line 1
>> No entry in sysdevices for backup device 'train_devo'. Update
>> sysdevices and rerun statement.
>> Server: Msg 3013, Level 16, State 1, Line 1
>> RESTORE DATABASE is terminating abnormally.
>> I know that I will need to kill active processes and that my record
>> doesn't exist in the sysdevices table but I don't have enough time
>> right now to study this completely.
>> Any help is greatly appreciated.
>> Thanks
>> Ben
>>
>> Hi
>> You can use BACKUP/RESTORE as suggested by Keith, or you can detach the
>> existing database, copy the files, and then reattach the db's again.
>> Try to look up RESTORE and sp_detach_db/sp_attach_db in Books On Line
>> for details.
>>
>> --
>> Regards
>> Steen Schlüter Persson
>> Databaseadministrator / Systemadministrator
>> --030204050507050003020602
>> Content-Type: text/html; charset=ISO-8859-1
>> X-Google-AttachSize: 2025
>> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>> <html>
>> <head>
>> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
>> </head>
>> <body bgcolor="#ffffff" text="#000000">
>> <a class="moz-txt-link-abbreviated" href="http://links.10026.com/?link=mailto:bcumminsr@.yahoo.com">bcumminsr@.yahoo.com</a> wrote:
>> <blockquote
>> cite="mid1153259948.748817.240020@.m73g2000cwd.googlegroups.com"
>> type="cite">
>> <pre wrap="">I am not a DBA and it will be obvious to you soon. :) I have two
>> databases on the same server. I want to basically restore a db from an
>> existing db on the same server. The catch is that I don't want to
>> restore from a backup file and I have to enable this process to run by
>> the class instructor through an ASP page calling a stored proc. Due to
>> time limitations between training classes I would just like to copy the
>> .MDF and .LDF from the Source db to the destination db and attach it.
>> I was trying the code below:
>> RESTORE DATABASE train
>> FROM train_devo
>> WITH RECOVERY,
>> MOVE 'c:\train_devo_data.mdf' TO 'c:\train_data.mdf',
>> MOVE 'c:\train_devo_log.ldf' TO 'c:\train_log.ldf'
>> GO
>> I am getting the error:
>> Server: Msg 3206, Level 16, State 1, Line 1
>> No entry in sysdevices for backup device 'train_devo'. Update
>> sysdevices and rerun statement.
>> Server: Msg 3013, Level 16, State 1, Line 1
>> RESTORE DATABASE is terminating abnormally.
>> I know that I will need to kill active processes and that my record
>> doesn't exist in the sysdevices table but I don't have enough time
>> right now to study this completely.
>> Any help is greatly appreciated.
>> Thanks
>> Ben
>> </pre>
>> </blockquote>
>> <font size="-1"><font face="Arial">Hi<br>
>> <br>
>> You can use BACKUP/RESTORE as suggested by Keith, or you can detach the
>> existing database, copy the files, and then reattach the db's again. <br>
>> <br>
>> Try to look up RESTORE and sp_detach_db/sp_attach_db in Books On Line
>> for details.<br>
>> <br>
>> <br>
>> -- <br>
>> Regards<br>
>> Steen Schlüter Persson<br>
>> Databaseadministrator / Systemadministrator<br>
>> </font></font>
>> </body>
>> </html>
>> --030204050507050003020602--
> Thanks for all of your help. I need to do this using T-SQL and I can't
> get the RESTORE command to work. Is it possible to copy the MDF and LDF
> using T-SQL to a different location? Thanks
>
You'll have to give us some more than just "it doesn't work". If you
want to copy the files using T-sql, you can look up xp_cmdshell in Books
On Line.
Regards
Steen Schlüter Persson
Databaseadministrator / Systemadministrator
--050402070308080300020405
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<a class="moz-txt-link-abbreviated" href="http://links.10026.com/?link=mailto:bcumminsr@.yahoo.com">bcumminsr@.yahoo.com</a> wrote:
<blockquote
cite="mid1153327247.825744.46880@.75g2000cwc.googlegroups.com"
type="cite">
<pre wrap="">Steen Persson (DK) wrote:
</pre>
<blockquote type="cite">
<pre wrap=""><a class="moz-txt-link-abbreviated" href="http://links.10026.com/?link=mailto:bcumminsr@.yahoo.com">bcumminsr@.yahoo.com</a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I am not a DBA and it will be obvious to you soon. :) I have two
databases on the same server. I want to basically restore a db from an
existing db on the same server. The catch is that I don't want to
restore from a backup file and I have to enable this process to run by
the class instructor through an ASP page calling a stored proc. Due to
time limitations between training classes I would just like to copy the
.MDF and .LDF from the Source db to the destination db and attach it.
I was trying the code below:
RESTORE DATABASE train
FROM train_devo
WITH RECOVERY,
MOVE 'c:\train_devo_data.mdf' TO 'c:\train_data.mdf',
MOVE 'c:\train_devo_log.ldf' TO 'c:\train_log.ldf'
GO
I am getting the error:
Server: Msg 3206, Level 16, State 1, Line 1
No entry in sysdevices for backup device 'train_devo'. Update
sysdevices and rerun statement.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
I know that I will need to kill active processes and that my record
doesn't exist in the sysdevices table but I don't have enough time
right now to study this completely.
Any help is greatly appreciated.
Thanks
Ben
</pre>
</blockquote>
<pre wrap="">Hi
You can use BACKUP/RESTORE as suggested by Keith, or you can detach the
existing database, copy the files, and then reattach the db's again.
Try to look up RESTORE and sp_detach_db/sp_attach_db in Books On Line
for details.
Regards
Steen Schlüter Persson
Databaseadministrator / Systemadministrator
--030204050507050003020602
Content-Type: text/html; charset=ISO-8859-1
X-Google-AttachSize: 2025
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<a class="moz-txt-link-abbreviated" href=<a class="moz-txt-link-rfc2396E" href="http://links.10026.com/?link=mailto:bcumminsr@.yahoo.com">"mailto:bcumminsr@.yahoo.com"</a>><a class="moz-txt-link-abbreviated" href="http://links.10026.com/?link=mailto:bcumminsr@.yahoo.com">bcumminsr@.yahoo.com</a></a> wrote:
<blockquote
cite=<a class="moz-txt-link-rfc2396E" href="http://links.10026.com/?link=mailto:mid1153259948.748817.240020@.m73g2000cwd.googlegroups.com">"mid1153259948.748817.240020@.m73g2000cwd.googlegroups.com"</a>
type="cite">
<pre wrap="">I am not a DBA and it will be obvious to you soon. :) I have two
databases on the same server. I want to basically restore a db from an
existing db on the same server. The catch is that I don't want to
restore from a backup file and I have to enable this process to run by
the class instructor through an ASP page calling a stored proc. Due to
time limitations between training classes I would just like to copy the
.MDF and .LDF from the Source db to the destination db and attach it.
I was trying the code below:
RESTORE DATABASE train
FROM train_devo
WITH RECOVERY,
MOVE 'c:\train_devo_data.mdf' TO 'c:\train_data.mdf',
MOVE 'c:\train_devo_log.ldf' TO 'c:\train_log.ldf'
GO
I am getting the error:
Server: Msg 3206, Level 16, State 1, Line 1
No entry in sysdevices for backup device 'train_devo'. Update
sysdevices and rerun statement.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
I know that I will need to kill active processes and that my record
doesn't exist in the sysdevices table but I don't have enough time
right now to study this completely.
Any help is greatly appreciated.
Thanks
Ben
</pre>
</blockquote>
<font size="-1"><font face="Arial">Hi<br>
<br>
You can use BACKUP/RESTORE as suggested by Keith, or you can detach the
existing database, copy the files, and then reattach the db's again. <br>
<br>
Try to look up RESTORE and sp_detach_db/sp_attach_db in Books On Line
for details.<br>
<br>
<br>
-- <br>
Regards<br>
Steen Schl&uuml;ter Persson<br>
Databaseadministrator / Systemadministrator<br>
</font></font>
</body>
</html>
--030204050507050003020602--
</pre>
</blockquote>
<pre wrap=""><!-->
Thanks for all of your help. I need to do this using T-SQL and I can't
get the RESTORE command to work. Is it possible to copy the MDF and LDF
using T-SQL to a different location? Thanks
</pre>
</blockquote>
<font size="-1"><font face="Arial">You'll have to give us some more
than just "it doesn't work". If you want to copy the files using T-sql,
you can look up xp_cmdshell in Books On Line.<br>
<br>
<br>
-- <br>
Regards<br>
Steen Schlüter Persson<br>
Databaseadministrator / Systemadministrator<br>
</font></font>
</body>
</html>
--050402070308080300020405--

copy jobs from one server to another

I've done this before and just can't seem to remember how I did it. Basically we're creating a staging area and I've used restore to copy all the databases to the new server. Now i just need to copy the jobs over. Is there a way to do this using sql code?

Using SSMS (or EM), you can right-click on the job and script them out.

You can also use DTS (SQL 2000) or SSIS (SQL 2005) to transfer all of the jobs.

Sunday, March 25, 2012

copy DB from 2005 to 2000?

Hi;
I need to copy a database fomr Sql Server 2005 to Sql Server 2000. I tried
backup/restore but the restore did not work.
What is the easiest way to do this? I need to copy everything and the
database has the same name on both systems.
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm
Hi
I think only way is DTS, but ... try and you'll see
Mex
"David Thielen" <thielen@.nospam.nospam> wrote in message
news:81C3719B-CB27-4455-89DB-D907CF9F2668@.microsoft.com...
> Hi;
> I need to copy a database fomr Sql Server 2005 to Sql Server 2000. I tried
> backup/restore but the restore did not work.
> What is the easiest way to do this? I need to copy everything and the
> database has the same name on both systems.
> --
> thanks - dave
> david_at_windward_dot_net
> http://www.windwardreports.com
> Cubicle Wars - http://www.windwardreports.com/film.htm
>
|||Hi, David,
I understand that you would like to how to migrate your SQL Server 2005
database to SQL Server 2000.
If I have misunderstood, please let me know.
Due to the incompatibility issue, there is no very convenient way to do
this process. However you can try the following process:
1. Fully back up your SQL Server 2005 database;
2. Create a SQL Server Integration Services project via SQL Server Business
Intelligence Development Studio;
3. On the Control Flow tab, drag a Transfer SQL Server Objects, and set the
source connection, destination connection, SourceDatabase and
DestinationDatabase; if the DestinationDatabase does not exist, please
manually create an empty database in Enterprise Manager.
4. Execute the task with the following options:
DropObjectsFirst: True
IncludeExtendedProperties: True
CopyData: True
ExistingData: Replace
CopySchema: True
UseCollation: True
IncludeDependentObjects: True
CopyAllObjects: Flase
CopyAllTables: True
CopyAllViews: True
CopyAllStoredProcedures: True
CopyAllDefinedFunctions: True
CopyAllDefaults: True
CopyAllUserDefinedDataTypes: True
<other options>: False
CopyDatabaseUsers: False
CopyDatabaseRoles: False
CopySqlServerLogins: False
CopyObjectLevelPermissions: False
CopyIndexes: True
CopyTriggers: True
CopyFullTextIndexes: True
CopyPrimaryKeys: True
CopyForeignKeys: True
GenerateScriptsInUnicode: True
5. For the jobs, logins and passwords, please refer to the following KB
articles:
How to move databases between computers that are running SQL Server
http://support.microsoft.com/?id=314546
How to transfer logins and passwords between instances of SQL Server
http://support.microsoft.com/?id=246133
After transfer the logins and passwords, you may need to re-assign
server roles to the logins on the SQL Server 2000;
6. Manually create the related users and assign the permissions.
If you just want to transfer the data, the 5th and 6th steps can be
ignored. It is recommended that you install SQL Server 2005 SP2 and SQL
Server 2000 SP4 before the process.
Microsoft SQL Server 2005 Service Pack 2
http://www.microsoft.com/downloads/details.aspx?FamilyID=d07219b2-1e23-49c8-
8f0c-63fa18f26d3a&DisplayLang=en
Microsoft SQL Server 2000 Service Pack 4
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=8E2D
FC8D-C20E-4446-99A9-B7F0213F8BC5
Hope this helps. If you have any other questions or concerns, please feel
free to let me know.
Best regards,
Charles Wang
Microsoft Online Community Support
================================================== ===
Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications
If you are using Outlook Express, please make sure you clear the check box
"Tools/Options/Read: Get 300 headers at a time" to see your reply promptly.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
================================================== ====
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
================================================== ====
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== ====
|||They don't make this easy do they...
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm
"Charles Wang[MSFT]" wrote:

> Hi, David,
> I understand that you would like to how to migrate your SQL Server 2005
> database to SQL Server 2000.
> If I have misunderstood, please let me know.
> Due to the incompatibility issue, there is no very convenient way to do
> this process. However you can try the following process:
> 1. Fully back up your SQL Server 2005 database;
> 2. Create a SQL Server Integration Services project via SQL Server Business
> Intelligence Development Studio;
> 3. On the Control Flow tab, drag a Transfer SQL Server Objects, and set the
> source connection, destination connection, SourceDatabase and
> DestinationDatabase; if the DestinationDatabase does not exist, please
> manually create an empty database in Enterprise Manager.
> 4. Execute the task with the following options:
> DropObjectsFirst: True
> IncludeExtendedProperties: True
> CopyData: True
> ExistingData: Replace
> CopySchema: True
> UseCollation: True
> IncludeDependentObjects: True
> CopyAllObjects: Flase
> CopyAllTables: True
> CopyAllViews: True
> CopyAllStoredProcedures: True
> CopyAllDefinedFunctions: True
> CopyAllDefaults: True
> CopyAllUserDefinedDataTypes: True
> <other options>: False
> CopyDatabaseUsers: False
> CopyDatabaseRoles: False
> CopySqlServerLogins: False
> CopyObjectLevelPermissions: False
> CopyIndexes: True
> CopyTriggers: True
> CopyFullTextIndexes: True
> CopyPrimaryKeys: True
> CopyForeignKeys: True
> GenerateScriptsInUnicode: True
> 5. For the jobs, logins and passwords, please refer to the following KB
> articles:
> How to move databases between computers that are running SQL Server
> http://support.microsoft.com/?id=314546
> How to transfer logins and passwords between instances of SQL Server
> http://support.microsoft.com/?id=246133
> After transfer the logins and passwords, you may need to re-assign
> server roles to the logins on the SQL Server 2000;
> 6. Manually create the related users and assign the permissions.
> If you just want to transfer the data, the 5th and 6th steps can be
> ignored. It is recommended that you install SQL Server 2005 SP2 and SQL
> Server 2000 SP4 before the process.
> Microsoft SQL Server 2005 Service Pack 2
> http://www.microsoft.com/downloads/details.aspx?FamilyID=d07219b2-1e23-49c8-
> 8f0c-63fa18f26d3a&DisplayLang=en
> Microsoft SQL Server 2000 Service Pack 4
> http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=8E2D
> FC8D-C20E-4446-99A9-B7F0213F8BC5
> Hope this helps. If you have any other questions or concerns, please feel
> free to let me know.
> Best regards,
> Charles Wang
> Microsoft Online Community Support
> ================================================== ===
> Get notification to my posts through email? Please refer to:
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications
> If you are using Outlook Express, please make sure you clear the check box
> "Tools/Options/Read: Get 300 headers at a time" to see your reply promptly.
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscriptions/support/default.aspx.
> ================================================== ====
> When responding to posts, please "Reply to Group" via
> your newsreader so that others may learn and benefit
> from this issue.
> ================================================== ====
> This posting is provided "AS IS" with no warranties, and confers no rights.
> ================================================== ====
>
>
>
>
>
|||Hi, Dave,
No, the process is not as convenient as backup/restore database from SQL
2000 to SQL 2005. Actually, the process of moving all the database objects
from SQL 2000 to SQL 2005 is also not very simple. Please refer to the two
articles in the step 5 in my first reply for that process.
Please try the recommendations first. If you encounter any issues, please
feel free to post back.
Have a nice day!
Charles Wang
Microsoft Online Community Support
================================================== ===
Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications
If you are using Outlook Express, please make sure you clear the check box
"Tools/Options/Read: Get 300 headers at a time" to see your reply promptly.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
================================================== ====
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
================================================== ====
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== ====

copy DB from 2005 to 2000?

Hi;
I need to copy a database fomr Sql Server 2005 to Sql Server 2000. I tried
backup/restore but the restore did not work.
What is the easiest way to do this? I need to copy everything and the
database has the same name on both systems.
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htmHi
I think only way is DTS, but ... try and you'll see
Mex
"David Thielen" <thielen@.nospam.nospam> wrote in message
news:81C3719B-CB27-4455-89DB-D907CF9F2668@.microsoft.com...
> Hi;
> I need to copy a database fomr Sql Server 2005 to Sql Server 2000. I tried
> backup/restore but the restore did not work.
> What is the easiest way to do this? I need to copy everything and the
> database has the same name on both systems.
> --
> thanks - dave
> david_at_windward_dot_net
> http://www.windwardreports.com
> Cubicle Wars - http://www.windwardreports.com/film.htm
>|||Hi, David,
I understand that you would like to how to migrate your SQL Server 2005
database to SQL Server 2000.
If I have misunderstood, please let me know.
Due to the incompatibility issue, there is no very convenient way to do
this process. However you can try the following process:
1. Fully back up your SQL Server 2005 database;
2. Create a SQL Server Integration Services project via SQL Server Business
Intelligence Development Studio;
3. On the Control Flow tab, drag a Transfer SQL Server Objects, and set the
source connection, destination connection, SourceDatabase and
DestinationDatabase; if the DestinationDatabase does not exist, please
manually create an empty database in Enterprise Manager.
4. Execute the task with the following options:
DropObjectsFirst: True
IncludeExtendedProperties: True
CopyData: True
ExistingData: Replace
CopySchema: True
UseCollation: True
IncludeDependentObjects: True
CopyAllObjects: Flase
CopyAllTables: True
CopyAllViews: True
CopyAllStoredProcedures: True
CopyAllDefinedFunctions: True
CopyAllDefaults: True
CopyAllUserDefinedDataTypes: True
<other options>: False
CopyDatabaseUsers: False
CopyDatabaseRoles: False
CopySqlServerLogins: False
CopyObjectLevelPermissions: False
CopyIndexes: True
CopyTriggers: True
CopyFullTextIndexes: True
CopyPrimaryKeys: True
CopyForeignKeys: True
GenerateScriptsInUnicode: True
5. For the jobs, logins and passwords, please refer to the following KB
articles:
How to move databases between computers that are running SQL Server
http://support.microsoft.com/?id=314546
How to transfer logins and passwords between instances of SQL Server
http://support.microsoft.com/?id=246133
After transfer the logins and passwords, you may need to re-assign
server roles to the logins on the SQL Server 2000;
6. Manually create the related users and assign the permissions.
If you just want to transfer the data, the 5th and 6th steps can be
ignored. It is recommended that you install SQL Server 2005 SP2 and SQL
Server 2000 SP4 before the process.
Microsoft SQL Server 2005 Service Pack 2
http://www.microsoft.com/downloads/...19b2-1e23-49c8-
8f0c-63fa18f26d3a&DisplayLang=en
Microsoft SQL Server 2000 Service Pack 4
http://www.microsoft.com/downloads/...n&FamilyID=8E2D
FC8D-C20E-4446-99A9-B7F0213F8BC5
Hope this helps. If you have any other questions or concerns, please feel
free to let me know.
Best regards,
Charles Wang
Microsoft Online Community Support
========================================
=============
Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications
If you are using Outlook Express, please make sure you clear the check box
"Tools/Options/Read: Get 300 headers at a time" to see your reply promptly.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscript...t/default.aspx.
========================================
==============
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
========================================
==============
This posting is provided "AS IS" with no warranties, and confers no rights.
========================================
==============|||They don't make this easy do they...
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm
"Charles Wang[MSFT]" wrote:

> Hi, David,
> I understand that you would like to how to migrate your SQL Server 2005
> database to SQL Server 2000.
> If I have misunderstood, please let me know.
> Due to the incompatibility issue, there is no very convenient way to do
> this process. However you can try the following process:
> 1. Fully back up your SQL Server 2005 database;
> 2. Create a SQL Server Integration Services project via SQL Server Busines
s
> Intelligence Development Studio;
> 3. On the Control Flow tab, drag a Transfer SQL Server Objects, and set th
e
> source connection, destination connection, SourceDatabase and
> DestinationDatabase; if the DestinationDatabase does not exist, please
> manually create an empty database in Enterprise Manager.
> 4. Execute the task with the following options:
> DropObjectsFirst: True
> IncludeExtendedProperties: True
> CopyData: True
> ExistingData: Replace
> CopySchema: True
> UseCollation: True
> IncludeDependentObjects: True
> CopyAllObjects: Flase
> CopyAllTables: True
> CopyAllViews: True
> CopyAllStoredProcedures: True
> CopyAllDefinedFunctions: True
> CopyAllDefaults: True
> CopyAllUserDefinedDataTypes: True
> <other options>: False
> CopyDatabaseUsers: False
> CopyDatabaseRoles: False
> CopySqlServerLogins: False
> CopyObjectLevelPermissions: False
> CopyIndexes: True
> CopyTriggers: True
> CopyFullTextIndexes: True
> CopyPrimaryKeys: True
> CopyForeignKeys: True
> GenerateScriptsInUnicode: True
> 5. For the jobs, logins and passwords, please refer to the following KB
> articles:
> How to move databases between computers that are running SQL Server
> http://support.microsoft.com/?id=314546
> How to transfer logins and passwords between instances of SQL Server
> http://support.microsoft.com/?id=246133
> After transfer the logins and passwords, you may need to re-assign
> server roles to the logins on the SQL Server 2000;
> 6. Manually create the related users and assign the permissions.
> If you just want to transfer the data, the 5th and 6th steps can be
> ignored. It is recommended that you install SQL Server 2005 SP2 and SQL
> Server 2000 SP4 before the process.
> Microsoft SQL Server 2005 Service Pack 2
> [url]http://www.microsoft.com/downloads/details.aspx?FamilyID=d07219b2-1e23-49c8-[/ur
l]
> 8f0c-63fa18f26d3a&DisplayLang=en
> Microsoft SQL Server 2000 Service Pack 4
> [url]http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=8E2D[/ur
l]
> FC8D-C20E-4446-99A9-B7F0213F8BC5
> Hope this helps. If you have any other questions or concerns, please feel
> free to let me know.
> Best regards,
> Charles Wang
> Microsoft Online Community Support
> ========================================
=============
> Get notification to my posts through email? Please refer to:
> [url]http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif[/ur
l]
> ications
> If you are using Outlook Express, please make sure you clear the check box
> "Tools/Options/Read: Get 300 headers at a time" to see your reply promptly
.
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscript...t/default.aspx.
> ========================================
==============
> When responding to posts, please "Reply to Group" via
> your newsreader so that others may learn and benefit
> from this issue.
> ========================================
==============
> This posting is provided "AS IS" with no warranties, and confers no rights
.
> ========================================
==============
>
>
>
>
>|||Hi, Dave,
No, the process is not as convenient as backup/restore database from SQL
2000 to SQL 2005. Actually, the process of moving all the database objects
from SQL 2000 to SQL 2005 is also not very simple. Please refer to the two
articles in the step 5 in my first reply for that process.
Please try the recommendations first. If you encounter any issues, please
feel free to post back.
Have a nice day!
Charles Wang
Microsoft Online Community Support
========================================
=============
Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications
If you are using Outlook Express, please make sure you clear the check box
"Tools/Options/Read: Get 300 headers at a time" to see your reply promptly.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscript...t/default.aspx.
========================================
==============
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
========================================
==============
This posting is provided "AS IS" with no warranties, and confers no rights.
========================================
==============

copy DB from 2005 to 2000?

Hi;
I need to copy a database fomr Sql Server 2005 to Sql Server 2000. I tried
backup/restore but the restore did not work.
What is the easiest way to do this? I need to copy everything and the
database has the same name on both systems.
--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htmHi
I think only way is DTS, but ... try and you'll see :)
Mex
"David Thielen" <thielen@.nospam.nospam> wrote in message
news:81C3719B-CB27-4455-89DB-D907CF9F2668@.microsoft.com...
> Hi;
> I need to copy a database fomr Sql Server 2005 to Sql Server 2000. I tried
> backup/restore but the restore did not work.
> What is the easiest way to do this? I need to copy everything and the
> database has the same name on both systems.
> --
> thanks - dave
> david_at_windward_dot_net
> http://www.windwardreports.com
> Cubicle Wars - http://www.windwardreports.com/film.htm
>|||Hi, David,
I understand that you would like to how to migrate your SQL Server 2005
database to SQL Server 2000.
If I have misunderstood, please let me know.
Due to the incompatibility issue, there is no very convenient way to do
this process. However you can try the following process:
1. Fully back up your SQL Server 2005 database;
2. Create a SQL Server Integration Services project via SQL Server Business
Intelligence Development Studio;
3. On the Control Flow tab, drag a Transfer SQL Server Objects, and set the
source connection, destination connection, SourceDatabase and
DestinationDatabase; if the DestinationDatabase does not exist, please
manually create an empty database in Enterprise Manager.
4. Execute the task with the following options:
DropObjectsFirst: True
IncludeExtendedProperties: True
CopyData: True
ExistingData: Replace
CopySchema: True
UseCollation: True
IncludeDependentObjects: True
CopyAllObjects: Flase
CopyAllTables: True
CopyAllViews: True
CopyAllStoredProcedures: True
CopyAllDefinedFunctions: True
CopyAllDefaults: True
CopyAllUserDefinedDataTypes: True
<other options>: False
CopyDatabaseUsers: False
CopyDatabaseRoles: False
CopySqlServerLogins: False
CopyObjectLevelPermissions: False
CopyIndexes: True
CopyTriggers: True
CopyFullTextIndexes: True
CopyPrimaryKeys: True
CopyForeignKeys: True
GenerateScriptsInUnicode: True
5. For the jobs, logins and passwords, please refer to the following KB
articles:
How to move databases between computers that are running SQL Server
http://support.microsoft.com/?id=314546
How to transfer logins and passwords between instances of SQL Server
http://support.microsoft.com/?id=246133
After transfer the logins and passwords, you may need to re-assign
server roles to the logins on the SQL Server 2000;
6. Manually create the related users and assign the permissions.
If you just want to transfer the data, the 5th and 6th steps can be
ignored. It is recommended that you install SQL Server 2005 SP2 and SQL
Server 2000 SP4 before the process.
Microsoft SQL Server 2005 Service Pack 2
http://www.microsoft.com/downloads/details.aspx?FamilyID=d07219b2-1e23-49c8-
8f0c-63fa18f26d3a&DisplayLang=en
Microsoft SQL Server 2000 Service Pack 4
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=8E2D
FC8D-C20E-4446-99A9-B7F0213F8BC5
Hope this helps. If you have any other questions or concerns, please feel
free to let me know.
Best regards,
Charles Wang
Microsoft Online Community Support
=====================================================Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications
If you are using Outlook Express, please make sure you clear the check box
"Tools/Options/Read: Get 300 headers at a time" to see your reply promptly.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
======================================================When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
======================================================This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================|||They don't make this easy do they...
--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm
"Charles Wang[MSFT]" wrote:
> Hi, David,
> I understand that you would like to how to migrate your SQL Server 2005
> database to SQL Server 2000.
> If I have misunderstood, please let me know.
> Due to the incompatibility issue, there is no very convenient way to do
> this process. However you can try the following process:
> 1. Fully back up your SQL Server 2005 database;
> 2. Create a SQL Server Integration Services project via SQL Server Business
> Intelligence Development Studio;
> 3. On the Control Flow tab, drag a Transfer SQL Server Objects, and set the
> source connection, destination connection, SourceDatabase and
> DestinationDatabase; if the DestinationDatabase does not exist, please
> manually create an empty database in Enterprise Manager.
> 4. Execute the task with the following options:
> DropObjectsFirst: True
> IncludeExtendedProperties: True
> CopyData: True
> ExistingData: Replace
> CopySchema: True
> UseCollation: True
> IncludeDependentObjects: True
> CopyAllObjects: Flase
> CopyAllTables: True
> CopyAllViews: True
> CopyAllStoredProcedures: True
> CopyAllDefinedFunctions: True
> CopyAllDefaults: True
> CopyAllUserDefinedDataTypes: True
> <other options>: False
> CopyDatabaseUsers: False
> CopyDatabaseRoles: False
> CopySqlServerLogins: False
> CopyObjectLevelPermissions: False
> CopyIndexes: True
> CopyTriggers: True
> CopyFullTextIndexes: True
> CopyPrimaryKeys: True
> CopyForeignKeys: True
> GenerateScriptsInUnicode: True
> 5. For the jobs, logins and passwords, please refer to the following KB
> articles:
> How to move databases between computers that are running SQL Server
> http://support.microsoft.com/?id=314546
> How to transfer logins and passwords between instances of SQL Server
> http://support.microsoft.com/?id=246133
> After transfer the logins and passwords, you may need to re-assign
> server roles to the logins on the SQL Server 2000;
> 6. Manually create the related users and assign the permissions.
> If you just want to transfer the data, the 5th and 6th steps can be
> ignored. It is recommended that you install SQL Server 2005 SP2 and SQL
> Server 2000 SP4 before the process.
> Microsoft SQL Server 2005 Service Pack 2
> http://www.microsoft.com/downloads/details.aspx?FamilyID=d07219b2-1e23-49c8-
> 8f0c-63fa18f26d3a&DisplayLang=en
> Microsoft SQL Server 2000 Service Pack 4
> http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=8E2D
> FC8D-C20E-4446-99A9-B7F0213F8BC5
> Hope this helps. If you have any other questions or concerns, please feel
> free to let me know.
> Best regards,
> Charles Wang
> Microsoft Online Community Support
> =====================================================> Get notification to my posts through email? Please refer to:
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications
> If you are using Outlook Express, please make sure you clear the check box
> "Tools/Options/Read: Get 300 headers at a time" to see your reply promptly.
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscriptions/support/default.aspx.
> ======================================================> When responding to posts, please "Reply to Group" via
> your newsreader so that others may learn and benefit
> from this issue.
> ======================================================> This posting is provided "AS IS" with no warranties, and confers no rights.
> ======================================================>
>
>
>
>|||Hi, Dave,
No, the process is not as convenient as backup/restore database from SQL
2000 to SQL 2005. Actually, the process of moving all the database objects
from SQL 2000 to SQL 2005 is also not very simple. Please refer to the two
articles in the step 5 in my first reply for that process.
Please try the recommendations first. If you encounter any issues, please
feel free to post back.
Have a nice day!
Charles Wang
Microsoft Online Community Support
=====================================================Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications
If you are using Outlook Express, please make sure you clear the check box
"Tools/Options/Read: Get 300 headers at a time" to see your reply promptly.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
======================================================When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
======================================================This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================sqlsql

copy databse to another server

Hello,,

I backed up my database and it created a BAK file. Now I move this file to other server and trying to restore from it. It is giving me error: Device activation error. Do I have to create database before restoring. I do not have this database available in other server and I need to copy database with all constrains and tables.

Thanks,

no you do not have to create teh database first...
the .bak file sounds corrupted...
back up the db again only this time check the box to validate/verify the file.
HTH,
SQLPoet|||Create the backup and take the .bak file and paste it in the Backup subfolder in Microsoft SQL Server folder under programs before going into Enterprise manager and use the backup and restore wizard and choose the restore from device option. Hope this helps.sqlsql

Thursday, March 22, 2012

Copy Database?

I am trying to create a backup of our production database, but a restore of
the backup doesn't seem to be grabbing everything (and I'm not sure what
it's missing, I just know things aren't working properly in the backup
database). Anyway, I was wondering if there is a way of copying EVERYTHING
from the live database without taking it offline. I tried the Copy Database
Wizard, but it chokes and dies if anybody is connected to the database. Any
suggestions would be greatly appreciated.
Willie Bodger
A backup does copy everything in the database and is the preferred way to do
what you are attempting. When you give details like "things aren't working
properly" it is pretty hard for someone to give you a correct response to
your problem. I will guess and say you have issues with the users not
matching up to the Logins. Logins are server level and do not come over
with the db but the users do. These should help:
http://vyaskn.tripod.com/moving_sql_server.htm Moving DBs
http://www.support.microsoft.com/?id=314546 Moving DB's between Servers
http://www.support.microsoft.com/?id=224071 Moving SQL Server Databases
to a New Location with Detach/Attach
http://support.microsoft.com/?id=221465 Using WITH MOVE in a
Restore
http://www.support.microsoft.com/?id=246133 How To Transfer Logins and
Passwords Between SQL Servers
http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after a
Restore
http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to
users
http://www.support.microsoft.com/?id=168001 User Logon and/or Permission
Errors After Restoring Dump
http://www.support.microsoft.com/?id=240872 How to Resolve Permission
Issues When a Database Is Moved Between SQL Servers
http://www.sqlservercentral.com/scri...p?scriptid=599
Restoring a .mdf
http://www.support.microsoft.com/?id=307775 Disaster Recovery Articles
for SQL Server
Andrew J. Kelly SQL MVP
"Willie Bodger" <willie@.bodgerfam.com> wrote in message
news:Oe3aNZwNFHA.3716@.TK2MSFTNGP14.phx.gbl...
>I am trying to create a backup of our production database, but a restore of
>the backup doesn't seem to be grabbing everything (and I'm not sure what
>it's missing, I just know things aren't working properly in the backup
>database). Anyway, I was wondering if there is a way of copying EVERYTHING
>from the live database without taking it offline. I tried the Copy Database
>Wizard, but it chokes and dies if anybody is connected to the database. Any
>suggestions would be greatly appreciated.
> Willie Bodger
>
|||For instance, when I try to run a stored procedure, I get this error:
OLE Automation Error Information
HRESULT: 0x800401f3
Source: ODSOLE Extended Procedure
Description: Invalid class string
error! 1
Any thoughts, or is there still too little info?
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:e0LMjkwNFHA.3076@.TK2MSFTNGP14.phx.gbl...
>A backup does copy everything in the database and is the preferred way to
>do what you are attempting. When you give details like "things aren't
>working properly" it is pretty hard for someone to give you a correct
>response to your problem. I will guess and say you have issues with the
>users not matching up to the Logins. Logins are server level and do not
>come over with the db but the users do. These should help:
> http://vyaskn.tripod.com/moving_sql_server.htm Moving DBs
> http://www.support.microsoft.com/?id=314546 Moving DB's between
> Servers
> http://www.support.microsoft.com/?id=224071 Moving SQL Server
> Databases to a New Location with Detach/Attach
> http://support.microsoft.com/?id=221465 Using WITH MOVE in a
> Restore
> http://www.support.microsoft.com/?id=246133 How To Transfer Logins and
> Passwords Between SQL Servers
> http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after
> a Restore
> http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to
> users
> http://www.support.microsoft.com/?id=168001 User Logon and/or
> Permission Errors After Restoring Dump
> http://www.support.microsoft.com/?id=240872 How to Resolve Permission
> Issues When a Database Is Moved Between SQL Servers
> http://www.sqlservercentral.com/scri...p?scriptid=599
> Restoring a .mdf
> http://www.support.microsoft.com/?id=307775 Disaster Recovery Articles
> for SQL Server
>
> --
> Andrew J. Kelly SQL MVP
>
> "Willie Bodger" <willie@.bodgerfam.com> wrote in message
> news:Oe3aNZwNFHA.3716@.TK2MSFTNGP14.phx.gbl...
>
|||You are attempting to execute a non-native (ie: user created) sql server
extended stored procedure. They too are at the server level and not part of
the database. They are simply files on the hard drive and you are
responsible for copying them over as well. Since these are basically DLL's
it could be almost anything depending on how it was coded and what else it
is dependant on. I would find who created it and see what they have to say.
Andrew J. Kelly SQL MVP
"Willie Bodger" <willie@.bodgerfam.com> wrote in message
news:OYrqYexNFHA.3156@.TK2MSFTNGP15.phx.gbl...
> For instance, when I try to run a stored procedure, I get this error:
> OLE Automation Error Information
> HRESULT: 0x800401f3
> Source: ODSOLE Extended Procedure
> Description: Invalid class string
> error! 1
> Any thoughts, or is there still too little info?
> "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
> news:e0LMjkwNFHA.3076@.TK2MSFTNGP14.phx.gbl...
>

Copy Database?

I am trying to create a backup of our production database, but a restore of
the backup doesn't seem to be grabbing everything (and I'm not sure what
it's missing, I just know things aren't working properly in the backup
database). Anyway, I was wondering if there is a way of copying EVERYTHING
from the live database without taking it offline. I tried the Copy Database
Wizard, but it chokes and dies if anybody is connected to the database. Any
suggestions would be greatly appreciated.
Willie BodgerA backup does copy everything in the database and is the preferred way to do
what you are attempting. When you give details like "things aren't working
properly" it is pretty hard for someone to give you a correct response to
your problem. I will guess and say you have issues with the users not
matching up to the Logins. Logins are server level and do not come over
with the db but the users do. These should help:
http://vyaskn.tripod.com/moving_sql_server.htm Moving DBs
http://www.support.microsoft.com/?id=314546 Moving DB's between Servers
http://www.support.microsoft.com/?id=224071 Moving SQL Server Databases
to a New Location with Detach/Attach
http://support.microsoft.com/?id=221465 Using WITH MOVE in a
Restore
http://www.support.microsoft.com/?id=246133 How To Transfer Logins and
Passwords Between SQL Servers
http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after a
Restore
http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to
users
http://www.support.microsoft.com/?id=168001 User Logon and/or Permission
Errors After Restoring Dump
http://www.support.microsoft.com/?id=240872 How to Resolve Permission
Issues When a Database Is Moved Between SQL Servers
http://www.sqlservercentral.com/scripts/scriptdetails.asp?scriptid=599
Restoring a .mdf
http://www.support.microsoft.com/?id=307775 Disaster Recovery Articles
for SQL Server
Andrew J. Kelly SQL MVP
"Willie Bodger" <willie@.bodgerfam.com> wrote in message
news:Oe3aNZwNFHA.3716@.TK2MSFTNGP14.phx.gbl...
>I am trying to create a backup of our production database, but a restore of
>the backup doesn't seem to be grabbing everything (and I'm not sure what
>it's missing, I just know things aren't working properly in the backup
>database). Anyway, I was wondering if there is a way of copying EVERYTHING
>from the live database without taking it offline. I tried the Copy Database
>Wizard, but it chokes and dies if anybody is connected to the database. Any
>suggestions would be greatly appreciated.
> Willie Bodger
>|||For instance, when I try to run a stored procedure, I get this error:
OLE Automation Error Information
HRESULT: 0x800401f3
Source: ODSOLE Extended Procedure
Description: Invalid class string
error! 1
Any thoughts, or is there still too little info?
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:e0LMjkwNFHA.3076@.TK2MSFTNGP14.phx.gbl...
>A backup does copy everything in the database and is the preferred way to
>do what you are attempting. When you give details like "things aren't
>working properly" it is pretty hard for someone to give you a correct
>response to your problem. I will guess and say you have issues with the
>users not matching up to the Logins. Logins are server level and do not
>come over with the db but the users do. These should help:
> http://vyaskn.tripod.com/moving_sql_server.htm Moving DBs
> http://www.support.microsoft.com/?id=314546 Moving DB's between
> Servers
> http://www.support.microsoft.com/?id=224071 Moving SQL Server
> Databases to a New Location with Detach/Attach
> http://support.microsoft.com/?id=221465 Using WITH MOVE in a
> Restore
> http://www.support.microsoft.com/?id=246133 How To Transfer Logins and
> Passwords Between SQL Servers
> http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after
> a Restore
> http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to
> users
> http://www.support.microsoft.com/?id=168001 User Logon and/or
> Permission Errors After Restoring Dump
> http://www.support.microsoft.com/?id=240872 How to Resolve Permission
> Issues When a Database Is Moved Between SQL Servers
> http://www.sqlservercentral.com/scripts/scriptdetails.asp?scriptid=599
> Restoring a .mdf
> http://www.support.microsoft.com/?id=307775 Disaster Recovery Articles
> for SQL Server
>
> --
> Andrew J. Kelly SQL MVP
>
> "Willie Bodger" <willie@.bodgerfam.com> wrote in message
> news:Oe3aNZwNFHA.3716@.TK2MSFTNGP14.phx.gbl...
>>I am trying to create a backup of our production database, but a restore
>>of the backup doesn't seem to be grabbing everything (and I'm not sure
>>what it's missing, I just know things aren't working properly in the
>>backup database). Anyway, I was wondering if there is a way of copying
>>EVERYTHING from the live database without taking it offline. I tried the
>>Copy Database Wizard, but it chokes and dies if anybody is connected to
>>the database. Any suggestions would be greatly appreciated.
>> Willie Bodger
>|||You are attempting to execute a non-native (ie: user created) sql server
extended stored procedure. They too are at the server level and not part of
the database. They are simply files on the hard drive and you are
responsible for copying them over as well. Since these are basically DLL's
it could be almost anything depending on how it was coded and what else it
is dependant on. I would find who created it and see what they have to say.
--
Andrew J. Kelly SQL MVP
"Willie Bodger" <willie@.bodgerfam.com> wrote in message
news:OYrqYexNFHA.3156@.TK2MSFTNGP15.phx.gbl...
> For instance, when I try to run a stored procedure, I get this error:
> OLE Automation Error Information
> HRESULT: 0x800401f3
> Source: ODSOLE Extended Procedure
> Description: Invalid class string
> error! 1
> Any thoughts, or is there still too little info?
> "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
> news:e0LMjkwNFHA.3076@.TK2MSFTNGP14.phx.gbl...
>>A backup does copy everything in the database and is the preferred way to
>>do what you are attempting. When you give details like "things aren't
>>working properly" it is pretty hard for someone to give you a correct
>>response to your problem. I will guess and say you have issues with the
>>users not matching up to the Logins. Logins are server level and do not
>>come over with the db but the users do. These should help:
>> http://vyaskn.tripod.com/moving_sql_server.htm Moving DBs
>> http://www.support.microsoft.com/?id=314546 Moving DB's between
>> Servers
>> http://www.support.microsoft.com/?id=224071 Moving SQL Server
>> Databases to a New Location with Detach/Attach
>> http://support.microsoft.com/?id=221465 Using WITH MOVE in a
>> Restore
>> http://www.support.microsoft.com/?id=246133 How To Transfer Logins
>> and Passwords Between SQL Servers
>> http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs
>> after a Restore
>> http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to
>> users
>> http://www.support.microsoft.com/?id=168001 User Logon and/or
>> Permission Errors After Restoring Dump
>> http://www.support.microsoft.com/?id=240872 How to Resolve Permission
>> Issues When a Database Is Moved Between SQL Servers
>> http://www.sqlservercentral.com/scripts/scriptdetails.asp?scriptid=599
>> Restoring a .mdf
>> http://www.support.microsoft.com/?id=307775 Disaster Recovery Articles
>> for SQL Server
>>
>> --
>> Andrew J. Kelly SQL MVP
>>
>> "Willie Bodger" <willie@.bodgerfam.com> wrote in message
>> news:Oe3aNZwNFHA.3716@.TK2MSFTNGP14.phx.gbl...
>>I am trying to create a backup of our production database, but a restore
>>of the backup doesn't seem to be grabbing everything (and I'm not sure
>>what it's missing, I just know things aren't working properly in the
>>backup database). Anyway, I was wondering if there is a way of copying
>>EVERYTHING from the live database without taking it offline. I tried the
>>Copy Database Wizard, but it chokes and dies if anybody is connected to
>>the database. Any suggestions would be greatly appreciated.
>> Willie Bodger
>>
>

Copy Database?

I am trying to create a backup of our production database, but a restore of
the backup doesn't seem to be grabbing everything (and I'm not sure what
it's missing, I just know things aren't working properly in the backup
database). Anyway, I was wondering if there is a way of copying EVERYTHING
from the live database without taking it offline. I tried the Copy Database
Wizard, but it chokes and dies if anybody is connected to the database. Any
suggestions would be greatly appreciated.
Willie BodgerA backup does copy everything in the database and is the preferred way to do
what you are attempting. When you give details like "things aren't working
properly" it is pretty hard for someone to give you a correct response to
your problem. I will guess and say you have issues with the users not
matching up to the Logins. Logins are server level and do not come over
with the db but the users do. These should help:
http://vyaskn.tripod.com/moving_sql_server.htm Moving DBs
http://www.support.microsoft.com/?id=314546 Moving DB's between Servers
http://www.support.microsoft.com/?id=224071 Moving SQL Server Databases
to a New Location with Detach/Attach
http://support.microsoft.com/?id=221465 Using WITH MOVE in a
Restore
http://www.support.microsoft.com/?id=246133 How To Transfer Logins and
Passwords Between SQL Servers
http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after a
Restore
http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to
users
http://www.support.microsoft.com/?id=168001 User Logon and/or Permission
Errors After Restoring Dump
http://www.support.microsoft.com/?id=240872 How to Resolve Permission
Issues When a Database Is Moved Between SQL Servers
http://www.sqlservercentral.com/scr...sp?scriptid=599
Restoring a .mdf
http://www.support.microsoft.com/?id=307775 Disaster Recovery Articles
for SQL Server
Andrew J. Kelly SQL MVP
"Willie Bodger" <willie@.bodgerfam.com> wrote in message
news:Oe3aNZwNFHA.3716@.TK2MSFTNGP14.phx.gbl...
>I am trying to create a backup of our production database, but a restore of
>the backup doesn't seem to be grabbing everything (and I'm not sure what
>it's missing, I just know things aren't working properly in the backup
>database). Anyway, I was wondering if there is a way of copying EVERYTHING
>from the live database without taking it offline. I tried the Copy Database
>Wizard, but it chokes and dies if anybody is connected to the database. Any
>suggestions would be greatly appreciated.
> Willie Bodger
>|||For instance, when I try to run a stored procedure, I get this error:
OLE Automation Error Information
HRESULT: 0x800401f3
Source: ODSOLE Extended Procedure
Description: Invalid class string
error! 1
Any thoughts, or is there still too little info?
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:e0LMjkwNFHA.3076@.TK2MSFTNGP14.phx.gbl...
>A backup does copy everything in the database and is the preferred way to
>do what you are attempting. When you give details like "things aren't
>working properly" it is pretty hard for someone to give you a correct
>response to your problem. I will guess and say you have issues with the
>users not matching up to the Logins. Logins are server level and do not
>come over with the db but the users do. These should help:
> http://vyaskn.tripod.com/moving_sql_server.htm Moving DBs
> http://www.support.microsoft.com/?id=314546 Moving DB's between
> Servers
> http://www.support.microsoft.com/?id=224071 Moving SQL Server
> Databases to a New Location with Detach/Attach
> http://support.microsoft.com/?id=221465 Using WITH MOVE in a
> Restore
> http://www.support.microsoft.com/?id=246133 How To Transfer Logins and
> Passwords Between SQL Servers
> http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after
> a Restore
> http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to
> users
> http://www.support.microsoft.com/?id=168001 User Logon and/or
> Permission Errors After Restoring Dump
> http://www.support.microsoft.com/?id=240872 How to Resolve Permission
> Issues When a Database Is Moved Between SQL Servers
> http://www.sqlservercentral.com/scr...sp?scriptid=599
> Restoring a .mdf
> http://www.support.microsoft.com/?id=307775 Disaster Recovery Articles
> for SQL Server
>
> --
> Andrew J. Kelly SQL MVP
>
> "Willie Bodger" <willie@.bodgerfam.com> wrote in message
> news:Oe3aNZwNFHA.3716@.TK2MSFTNGP14.phx.gbl...
>|||You are attempting to execute a non-native (ie: user created) sql server
extended stored procedure. They too are at the server level and not part of
the database. They are simply files on the hard drive and you are
responsible for copying them over as well. Since these are basically DLL's
it could be almost anything depending on how it was coded and what else it
is dependant on. I would find who created it and see what they have to say.
Andrew J. Kelly SQL MVP
"Willie Bodger" <willie@.bodgerfam.com> wrote in message
news:OYrqYexNFHA.3156@.TK2MSFTNGP15.phx.gbl...
> For instance, when I try to run a stored procedure, I get this error:
> OLE Automation Error Information
> HRESULT: 0x800401f3
> Source: ODSOLE Extended Procedure
> Description: Invalid class string
> error! 1
> Any thoughts, or is there still too little info?
> "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
> news:e0LMjkwNFHA.3076@.TK2MSFTNGP14.phx.gbl...
>sqlsql

Tuesday, March 20, 2012

Copy database with encrypted column to new server and decrypt column there

To do this successfully do I need to backup the Service master, Database master, and database itself from the the Source server, then restore all three of them on the destination server?

(I'm concerned that restoring the source Service Master key to a new target server with an existing sql 2005 install will screw things up big time.)

TIA,

Barkingdog

It's actually a little easier than that. All you have to do is restore the database and then restore the encryption between the SMK and the DBMK. The database master key should already be in the database so after that you just need to associate the DBMK with the new server's service master key.

After restore, you will need to:

1) use <database_name>

2) open database master key

3) alter database master key add encryption by service master key

After that, everything should work as normal.

Sung

copy database via tapefile no SQL 2005

Hello,

if you got a tape file how can you restore the contained database onto a
newly installed server? I choose Restore Database From Device then I choose
DB and select same DB in combobox "To Database" but error occured:

TITLE: Microsoft SQL Server Management Studio
Restore failed for Server '...'. (Microsoft.SqlServer.Smo)
ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: Directory lookup for the file "C:\Program
Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\KidDatabase.mdf" failed with
the operating system error 3(error not found). (Microsoft.SqlServer.Smo)

what can I do to handle this problem?

regards
MarkMark (Scollop027@.gmx.net) writes:

Quote:

Originally Posted by

if you got a tape file how can you restore the contained database onto a
newly installed server? I choose Restore Database From Device then I
choose DB and select same DB in combobox "To Database" but error
occured:
>
TITLE: Microsoft SQL Server Management Studio
Restore failed for Server '...'. (Microsoft.SqlServer.Smo)
ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: Directory lookup for the file "C:\Program
Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\KidDatabase.mdf" failed with
the operating system error 3(error not found). (Microsoft.SqlServer.Smo)
>
what can I do to handle this problem?


First do

RESTORE FILELISTONLY FROM TAPE = 'tapedevice'

this will give you the logical names of the files of the database. Then
do:

RESTORE DATABASE db FROM TAPE = 'tapedevice' WITH
MOVE 'datafile' TO
C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\KidDatabase.mdf',
MOVE 'logfile' TO
C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\KidDatabase.ldf',
REPLACE

Here I've used the path from your error message. Howver, the error message
indicates that this is a non-existing path, so you may have to examine
where there is place on the server to put the databases.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Hello Erland,
good tip, thank you very much !
I havent seen it :-/
regards Mark

"Erland Sommarskog" <esquel@.sommarskog.seschrieb im Newsbeitrag
news:Xns98203142E059Yazorman@.127.0.0.1...

Quote:

Originally Posted by

Mark (Scollop027@.gmx.net) writes:

Quote:

Originally Posted by

if you got a tape file how can you restore the contained database onto a
newly installed server? I choose Restore Database From Device then I
choose DB and select same DB in combobox "To Database" but error
occured:

TITLE: Microsoft SQL Server Management Studio
Restore failed for Server '...'. (Microsoft.SqlServer.Smo)
ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: Directory lookup for the file


"C:\Program

Quote:

Originally Posted by

Quote:

Originally Posted by

Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\KidDatabase.mdf" failed


with

Quote:

Originally Posted by

Quote:

Originally Posted by

the operating system error 3(error not found). (Microsoft.SqlServer.Smo)

what can I do to handle this problem?


>
First do
>
RESTORE FILELISTONLY FROM TAPE = 'tapedevice'
>
this will give you the logical names of the files of the database. Then
do:
>
RESTORE DATABASE db FROM TAPE = 'tapedevice' WITH
MOVE 'datafile' TO
C:\Program Files\Microsoft SQL


Server\MSSQL.1\MSSQL\DATA\KidDatabase.mdf',

Quote:

Originally Posted by

MOVE 'logfile' TO
C:\Program Files\Microsoft SQL


Server\MSSQL.1\MSSQL\DATA\KidDatabase.ldf',

Quote:

Originally Posted by

REPLACE
>
Here I've used the path from your error message. Howver, the error message
indicates that this is a non-existing path, so you may have to examine
where there is place on the server to put the databases.
>
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
>
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx