sql backup permissions

How do permissions within a sql backup when you restore them elsewhere? say for example a user found a bak file, decided to restore it, what then determines which tables/permissions a user has over that database, as when that database was live I assume accounts have particular access on some tables etc, but when its restored elsewhere, do those permissions stay in tact?
LVL 4
pma111Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Guy Hengel [angelIII / a3]Billing EngineerCommented:
inside the database you only have USERS, and no LOGINS
along with the USERS, also the permissions inside that database are stored.

so, to get the USERS working, you need to map them to LOGINS on the target instance (if it's the same sql server instance, there is no change).

the LOGINS also have (server wide) permissions, which may impact what the LOGIN can do.


so, to answer your question, yes, the permissions stay intact
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pma111Author Commented:
with that in mind, if a user finds a bak file, is it not a certainty that they can access all the data held within the database backup then?
0
Guy Hengel [angelIII / a3]Billing EngineerCommented:
yes, they can access all the data by restoring in on a sql server they have full control over.

hence, you need to protect the backup files by using encrypted files, for example.
0
geek_vjCommented:
with that in mind, if a user finds a bak file, is it not a certainty that they can access all the data held within the database backup then?
>>Yes. Unless the users are mapped to the respective logins, database wont be accessible to those logins. However, if server level permissions exist (for example sysadmin) then the restored databases can be accessed

As such, while performing the backup restore activity, you need to follow a process to get the access working on the destination server.
Please find the below KB article for more details:
http://support.microsoft.com/kb/168001
0
Scott PletcherSenior DBACommented:
>> if a user finds a bak file, ... can [they] access all the data held within the database backup then? <<

Yes.  To prevent that, you need to encrypt the backup.  Any "restrictions" within the users on the db are useless when someone has a .bak file.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.