Go Premium for a chance to win a PS4. Enter to Win

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

the right need to backup/restore /detach/attach database

Deer all,

please correct me if I am wrong, in MS SQL, only the login with the sysadmin role in SQL server can do the backup/restore/attach/detach of database?
0
marrowyung
Asked:
marrowyung
  • 4
  • 2
  • 2
  • +1
3 Solutions
 
QPRCommented:
db_backupoperator allows a user to backup a DB
db_owner of a particular db will allow for restore or dettach
db_creator will allow for attach

https://www.simple-talk.com/sql/database-administration/sql-server-security-cribsheet/
0
 
Om PrakashCommented:
I think users who are member of sysadmin or dbcreator can perform these activities
0
 
Steve WalesSenior Database AdministratorCommented:
There are 9 fixed server roles in SQL Server: http://msdn.microsoft.com/en-us/library/ms188659%28v=sql.110%29.aspx

According to the documentation, dbcreator can also restore a database.

Would suggest testing if it can also backup / detach / attach :)

But for the most part, it would appear you are correct.

As an aside, these are really only actions that a DBA should be doing anyway ... they aren't things I'd farm out to someone else....
0
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
QPRCommented:
I wouldn't say the poster was correct.
Giving SA permissions unnecessarily is a dangerous game. The server/DB roles are there for this very reason.
0
 
Steve WalesSenior Database AdministratorCommented:
The OP asked if it was correct - apart from dbcreator which states it can restore but doesn't state the others, he is correct in his question.

As I mentioned (and you did too), it's not necessarily a WISE decision to hand out elevated permissions, but that isn't what he asked.
0
 
QPRCommented:
The question was can only the SA perform these tasks. The answer is no. Therefore incorrect :)
0
 
marrowyungAuthor Commented:
what I mean is if it is only anyone with sysadmin role can do the DB backup and restore, is it?

all these has sysdamin role:
1)NT SERVICE\MSSQLSERVER
2) NT SERVICE\SQLSERVERAGENT

so I belive that if the sysadmin role removed from these account, SQL server is not going to operate, right?
0
 
marrowyungAuthor Commented:
but the one who can assign/add/remove role must be sysadmin, right?
0
 
QPRCommented:
No. Please read the link that explains each role and what it does
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

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