Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Backup remote DB

Author  Topic 

tech
Starting Member

32 Posts

Posted - 2010-07-16 : 03:59:23
How do I perform this task and schedule it?

I want to backup a remote database giving it credentials to use.
I then want that backup to be transferred to the local computer - in other words, the computer that is initiating the backup request.

is this possible?

so - backup a remote DB and copy that DB locally.

how so?

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2010-07-16 : 19:40:23
You could set up a SQL Job on the remote server which would perfrom the backup "locally" and then invoke the job from your local server using the sp_start_job stored procedure. Copying the file from the remote server to your local disk can be done outside of SQL or use the xp_cmdshell stored procedure to invoke an application that performs the file transfer.


=======================================
A couple of months in the laboratory can save a couple of hours in the library. -Frank H. Westheimer, chemistry professor (1912-2007)
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2010-07-17 : 05:58:32
1)If you were to do from within SQL Server the command would be something like :
DECLARE @cmdstr VARCHAR(100)
SET @cmdstr = 'COPY \\mynetworkpath\mybackup.bak K:\mybackup.bak@
EXEC master..xp_cmdshell @cmdstr

Be careful about enabling xp_cmdshell , for security reasons . Certainly in most environments I work on - this is not allowed

Therefore , second option
Issue the COPY statement as a Task or part of a batch file , invoked by a user account with specific permissions on the OS

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2010-07-17 : 05:58:50
1)If you were to do from within SQL Server the command would be something like :
DECLARE @cmdstr VARCHAR(100)
SET @cmdstr = 'COPY \\mynetworkpath\mybackup.bak K:\mybackup.bak@
EXEC master..xp_cmdshell @cmdstr

Be careful about enabling xp_cmdshell , for security reasons . Certainly in most environments I work on - this is not allowed

Therefore , second option
Issue the COPY statement as a Task or part of a batch file , invoked by a user account with specific permissions on the OS

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page

sbglobal
Starting Member

4 Posts

Posted - 2010-07-18 : 08:42:42
THANKS

Raj singla
Go to Top of Page
   

- Advertisement -