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
 General SQL Server Forums
 New to SQL Server Administration
 sql server db backup from other computer

Author  Topic 

hameedf
Starting Member

27 Posts

Posted - 2012-12-10 : 12:22:32
Hello experts !

how to take cold backup of sqlserver database from other computer via command prompt batch file?

i appreciate your help please

Thanks

Hameed

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-12-10 : 14:50:07
Why do you want to do a cold backup? A hot backup works perfect in SQL Server and requires zero downtime.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

hameedf
Starting Member

27 Posts

Posted - 2012-12-10 : 14:57:31
Fine thanks please guide me how to take hot backup?

cheers

Hameed
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-12-10 : 15:16:01
You would issue the BACKUP DATABASE command.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

hameedf
Starting Member

27 Posts

Posted - 2012-12-10 : 16:02:42
Sorry i am very new to sql server shall you please tell me how to make a batch file?

Thanks

Hameed
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-12-10 : 16:34:54
Making a batch file isn't actually a SQL Server thing. Why do you need to use a batch file? If you just want to schedule a backup, you would create a job in the SQL Server Agent.

If you are dead set on using a batch file, you would issue the BACKUP DATABASE command via sqlcmd.exe.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

hameedf
Starting Member

27 Posts

Posted - 2012-12-11 : 13:57:08
Actually sir i other computer i dont have sql server i want to use native clien and command line sql tool to get the backup of the server to my computer?

Thanks

Hameed
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-12-11 : 14:10:09
What do you mean by native client?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

hameedf
Starting Member

27 Posts

Posted - 2012-12-11 : 14:20:12
Sql native client...

Hameed
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-12-11 : 14:22:18
Do you have sqlcmd.exe on your machine?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

hameedf
Starting Member

27 Posts

Posted - 2012-12-11 : 14:28:12
yes i have this utility in my machine...

Thanks

Hameed
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-12-11 : 14:52:37
Here is a sample: sqlcmd.exe -Sserver1\instance1 -E -ic:\temp\SomeScript.sql

SomeScript.sql:
BACKUP DATABASE Test TO DISK = '\\server2\f$\backup\Test.bak'

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -