hacking contest

hacking exploits security forum
hacking
compliance articles
upgrade backup exec
information security consultant

Full Version: Sql Server Backup?
Zekk
Hi I want to get some database files off of a MS SQL server.

When the files are in use you can not get them.
I was wondering if anyone knew any command line utilty's to backup a SQL server files to another folder/computer etc..
Or I could stop the service what would be the commands and would it gen errors?
Thanks
bdark
QUOTE (Zekk @ May 12 2004, 10:40 PM)
Or I could stop the service what would be the commands and would it gen errors?

You can in fact stop the sql service. Type net stop "MSSQLSERVER" and it should be done. If not type net start and locate another service name related to the sql server.
Killaloop
there are many ways to backup the database. one is simple the enterprise manager but since you need it cmdline based I got two options:

From a sql query analyzer of your choice type

BACKUP DATABASE dbname to disk='c:\dbname.bak'

or use this

USE MASTER
exec sp_helpdb dbname
BACKUP LOG dbname TO DISK = 'C:\dbname_log.bak' with init
DBCC SHRINKDATABASE ('dbname')
BACKUP LOG dbname TO DISK = 'C:\dbname_log.bak' with init
DBCC SHRINKDATABASE ('dbname')
exec sp_helpdb dbname
BACKUP DATABASE dbname TO DISK = 'C:\dbname.bak' with init

where dbname stands for the name of the database you want to backup
I recommend SQLEXECMS for this operation its 30 days shareware and a handy tool for remotely managing
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.

 
Invision Power Board © 2001-2005 Invision Power Services, Inc.