Solved

The native MS SQL backup command

Posted on 2013-01-20
9
290 Views
Last Modified: 2013-02-03
Dear all,

if we try to backup a MS SQL DB from console and we will find out that the SQL server will execute:

BACKUP DATABASE command,

do anyone knows what command exactly backup database will call?
0
Comment
Question by:marrowyung
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 3
9 Comments
 
LVL 24

Expert Comment

by:DBAduck - Ben Miller
ID: 38799792
In SQL Server there is only one command to back up a database. It is

BACKUP DATABASE.

Any tool that helps you is just generating commands to send to SQL Server.  There are many options in the BACKUP DATABASE command, but they all back up a database.
0
 
LVL 43

Expert Comment

by:Eugene Z
ID: 38799848
here you are :


BACKUP (Transact-SQL)
http://technet.microsoft.com/en-us/library/ms186865(v=sql.100).aspx


and it depends on your sql server\version and what you selected in GUI and kind of backup (full; trn;diff)
and where too....

for example (from above link)

A. Backing up a complete database


The following example backs up the AdventureWorks database to a disk file.


BACKUP DATABASE AdventureWorks
 TO DISK = 'Z:\SQLServerBackups\AdvWorksData.bak'
   WITH FORMAT;
GO
0
 
LVL 1

Author Comment

by:marrowyung
ID: 38800012
no, what I mean is, I am not sure if when running BACKUP DATABASE, there are some kind of .exe applicatoin that do the backup job for SQL server.

as we don't anyone unauthorized person to back that up any DB instead of using the corporate standard tools.

Anyway to make that stop that operatino?
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 43

Expert Comment

by:Eugene Z
ID: 38801096
ask DBA to run sp_who/sp_who2  during this operation and identify host \program and disable it there (on the host where from it runs) or check sql agent jobs - it could be scheduled sql server job..
--

you can use KILL spid# command if you this backup running

All these needs DBAs level sql server permissions and rights on remote host (if such detected)

usual suspect is tape backup software -- check with your sys admins
it can be some unauthorized activities as well ..
0
 
LVL 24

Accepted Solution

by:
DBAduck - Ben Miller earned 350 total points
ID: 38801574
The only .exe that does the backup when you issue the BACKUP DATABASE command is sqlservr.exe which is the SQL Server Service. No external EXE performs the backup.

Furthermore, the backup is always performed under the permissions (on the file system level) of the SQL Server Service account.  So if you have SYSTEM user as the service login account, the service account needs to have access to the folder you put the backup file in.
0
 
LVL 1

Author Comment

by:marrowyung
ID: 38804028
"The only .exe that does the backup when you issue the BACKUP DATABASE command is sqlservr.exe which is the SQL Server Service. No external EXE performs the backup."

this is good answer.

so only remove the right from the rest of users should be enought ?
0
 
LVL 1

Author Comment

by:marrowyung
ID: 38804031
so from the SQL server admin point of view, they should belongs to "diskadmin" or "sysadmin" ?
0
 
LVL 24

Expert Comment

by:DBAduck - Ben Miller
ID: 38804073
Sysadmin has rights to do all the system administration for the database server.  This is the most privileges.

Diskadmin allows someone to add files or remove files from a database.

Which privileges you grant people is up to you.  You need some pretty high permissions to back up a database (dbo on the database, or db_creator)

If the users do not have privileges to back up a database, then they will not be allowed to execute the BACKUP DATABASE statement.

I hope I understood what you meant.  If not, let me know.
0
 
LVL 43

Assisted Solution

by:Eugene Z
Eugene Z earned 150 total points
ID: 38807831
so only remove the right from the rest of users should be enought ?

unless - this process is using sa login (for example)

so start tracing activities and check again above posts
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

623 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