Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 187
  • Last Modified:

SQL...what happens when a service is stopped and someone is logged on

Hello,
Question. I have a SQL database. It is new and currently how I back it up is I log everyone out, stop the sQL services and the database service, and drag and drop the instance (DATA) to an SSD drive.

What happens if I stop the SQL services when people are logged in? Does this lead to database corruption?

I know Symantec's backup product has an agent that backs up the database for me while people are logged in and I do not have to stop the services. The product is finally stable.

How do you backup your SQL databases, what is the best way? I watched several TECHNET videos on the subject.

Thanks,
0
dronethought
Asked:
dronethought
  • 3
  • 2
1 Solution
 
Carl TawnSystems and Integration DeveloperCommented:
You shouldn't need to stop the service at all. SQL Server has a proper backup engine of its own, that backups databases without any downtime.

Basic syntax for a SQL backup is:
BACKUP DATABASE [YourDatabaseName]
    TO DISK = N'<path_and_name_for_backup_file>.bak'

Open in new window

You only need to BAK file to have a backup of your database, not the entire installation directory.
0
 
dronethoughtAuthor Commented:
Thank you.
0
 
dronethoughtAuthor Commented:
Dear Carl,
Forgot to ask, the syntax is used in which program...I am new to SQL.
Thanks.
DT
0
 
Carl TawnSystems and Integration DeveloperCommented:
Normally it would be through SQL Server Management Studio, sqlcmd (command-line client), or as part of a scheduled SQL Server Agent job.
0
 
dronethoughtAuthor Commented:
Thank you!!
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now