Solved

The native MS SQL backup command

Posted on 2013-01-20
9
286 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
  • 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 42

Expert Comment

by:EugeneZ
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 42

Expert Comment

by:EugeneZ
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 42

Assisted Solution

by:EugeneZ
EugeneZ 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

831 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