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

Posted on 2014-07-15
Last Modified: 2014-07-25
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.

Question by:dronethought
    LVL 52

    Accepted Solution

    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.
    LVL 2

    Author Closing Comment

    Thank you.
    LVL 2

    Author Comment

    Dear Carl,
    Forgot to ask, the syntax is used in which program...I am new to SQL.
    LVL 52

    Expert Comment

    by:Carl Tawn
    Normally it would be through SQL Server Management Studio, sqlcmd (command-line client), or as part of a scheduled SQL Server Agent job.
    LVL 2

    Author Comment

    Thank you!!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    PRTG Network Monitor: Intuitive Network Monitoring

    Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

    This article will review the basic installation and configuration for Windows Software Update Services (WSUS) in a Windows 2012 R2 environment.  WSUS is a Microsoft tool that allows administrators to manage and control updates to be approved and ins…
    In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
    In this Micro Tutorial viewers will learn how to use Boot Corrector from Paragon Rescue Kit Free to identify and fix the boot problems of Windows 7/8/2012R2 etc. As an example is used Windows 2012R2 which lost its active partition flag (often happen…
    In this Micro Tutorial viewers will learn how to restore single file or folder from Bare Metal backup image of their system. Tutorial shows how to restore files and folders from system backup. Often it is not needed to restore entire system when onl…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now