Link to home
Start Free TrialLog in
Avatar of deewani
deewani

asked on

Unable to restore a database. SQL Server says I do not have permission to restore the database even though I am the db owner

When I try to restore a database, I get the following message " "User does not have permission to to RESTORE database D_AppCenter_Mail" RESTORE DATABASE is terminating abnormally." Can someone tell me why am I getting this message even though I am the db owner for that database?
Avatar of Scott Pletcher
Scott Pletcher
Flag of United States of America image

You are restoring over an existing db, right?  I mean, the db wasn't deleted first and then you attempted to restore it.
Avatar of deewani
deewani

ASKER

Yes. It exists.
ASKER CERTIFIED SOLUTION
Avatar of ayufans
ayufans

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of deewani

ASKER

Ayufans,

I was able to before. I would not give me "User does not have permission to restore database" error if I was not allowed to. See what I did is I created a backup of the database on a certain drive as .bak file. Meanwhile, I played with the data in the tables a little bit. Now I want the old data back so I am just trying to restore it. Why wouldn't it allow me to do it? Does not make sense that because I have an existing database it would not allow me to. But, I will try renaming the database and see if it allows me to.
You CAN restore over existing databases--you just add the REPLACE option on your restore command.

deewani, are you sure you have security rights to restore the database--maybe your rights have changed since the last time you did the restore?

Brett
I agree with arbert that you can restore very well over existing database. Now, the error message that you provided indicates that you are not connected with good permissions:
<from SQL BOL>
If the database being restored does not exist, the user must have CREATE DATABASE permissions. If the database does exist, RESTORE permissions default to members of the sysadmin fixed server role and the db_owner fixed database role.

CHeers
What's up with this qustion?
What's up with this question?
deewani:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
No comment has been added to this question in more than 268 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
   Accept: ayufans http:#8184967

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

monosodiumg
EE Cleanup Volunteer