Re: Backups.

Re: Backups.

 

  

I was thinking something like:

EXEC sp_attach_db @dbname = N'debug_db',
@filename1 = N'\\server1\Data\prod_db.mdf',
@filename2 = N'\\server1\Data\prod_db_log.ldf'

Should I drop the destination db first?

Can I specify alternate locations & names for the log & data files?

[Email Address Removed] wrote:

> There is no problem attach a database using a new name, the problem you are
> going to face with is that the data and log files will remane the same. If
> you want to do that you would have to place the data and log files in a
> directory of there own.
>
> -----Original Message-----
> From: Aaron [mailto:[Email Address Removed]
> Sent: January 27, 2004 9:12 AM
> To: LazyDBA.com Discussion
> Subject: Re: Backups.
>
> I got that working quite well, but would it be easier to use attach an
> existing database under a new name?
>
> Aaron wrote:
>
>
>>Right, but I do not think I fully understand the syntax of RESTORE ...
>>
>>RESTORE DATABASE MyNwind
>> FROM MyNwind_1 --<< this would be on a different server
>>
>>It will have to be from a network share as well... and the name will
>>change every night ...
>>
>>[Email Address Removed] wrote:
>>
>>
>>>In the DTS designer, create a connection for the server to restore to.
>>>Then create an Execute SQL Task using that connection with the SQL
>>>Statement "RESTORE DATABASE mydb...".
>>>-----Original Message-----
>>>From: Aaron [mailto:[Email Address Removed] Sent: Monday, January 26, 2004
>>>3:43 PM
>>>To: LazyDBA.com Discussion
>>>Subject: Backups.
>>>
>>>
>>>I'm looking for a way to replication two databases nightly. Is it
>>>possible to use DTS to restore a backup from one server to another?
>>>It makes sense, but I can't seem to figure out how to build the DTS
>>>package.
>>>
>>>Thanks
>>>a
>>>
>>>---------------------------------------------------------------------
>>>TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY Get
>>>today's cartoon: http://www.LazyDBA.com To unsubscribe, e-mail:
>>>mssqldba-[Email Address Removed] For additional commands, e-mail:
>>>mssqldba-[Email Address Removed] REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY Get
>>>today's cartoon: http://www.LazyDBA.com To unsubscribe, e-mail:
>>>mssqldba-[Email Address Removed] For additional commands, e-mail:
>>>mssqldba-[Email Address Removed] REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY Get
>>today's cartoon: http://www.LazyDBA.com To unsubscribe, e-mail:
>>mssqldba-[Email Address Removed] For additional commands, e-mail:
>>mssqldba-[Email Address Removed]
>
>
> ---------------------------------------------------------------------
> TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY Get today's
> cartoon: http://www.LazyDBA.com To unsubscribe, e-mail:
> mssqldba-[Email Address Removed] For additional commands, e-mail:
> mssqldba-[Email Address Removed]
MS Sql Server LazyDBA home page