November 14, 2012 at 9:34 am
Hi All,
moving databases from Prod to new server. And also want to carry forward permissions.
Need help on moving permissions.
thanks in advance.
November 14, 2012 at 9:43 am
you'll need to get a copy of sp_help_revlogin from microsoft; there are different versions, depending on 2000/2005, maybe even for 2008 and above, i don't quite remember.
assuming you are going to do a backup from Prod and Restore on the new server, you should be good with that...object permissions are stored int eh databases themselves, and the procedure above will carry the correct sids along with it, so that makes it fairly seamless.
don't forget all the other things on production, like certificates, linked servers,
and more; theres a current thread on side by side server migration you might want to peek at:
http://www.sqlservercentral.com/Forums/Topic1384265-391-1.aspx
Lowell
November 14, 2012 at 9:54 am
Thanks for your replay,
If I am doing refresh from PROD to DEV.
I need take a backup script out permissions for a database before restoring in DEV.
and restore the permissions back in DEV, when the refresh is done.
So, I need help in scripting out permissions for a database..
November 14, 2012 at 10:25 am
November 14, 2012 at 2:32 pm
It did'nt help....
I need help in scripting out permissions for a database.
Please don't say sp_help_revlogin: It gives list out all the logins on a server.
November 14, 2012 at 2:34 pm
User permissions are stored in the database. If i take a backup of MyDatabase and restore it onto a different server all the permissions are going to be the same. the problem comes in when you create users on the new database machine, you will end up with "Orphaned" users in the database. You have two options you can use sp_help_revlogin or you can use ALTER USER http://msdn.microsoft.com/en-us/library/ms189828.aspx to map the orphaned users to a SQL Server login. Once you have mapped the Logins to Database users (or using sp_help_revlogin you do not have to go through this step as the SID's of the users will remain the same) all the permissions will be there.
For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]
Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
Jeff Moden's Cross tab and Pivots Part 1[/url]
Jeff Moden's Cross tab and Pivots Part 2[/url]
November 14, 2012 at 4:15 pm
Danzz (11/14/2012)
It did'nt help....I need help in scripting out permissions for a database.
Please don't say sp_help_revlogin: It gives list out all the logins on a server.
You asked for a script to list database permissions and that is exactly what it does, how did it not help?
---------------------------------------------------------------------
November 15, 2012 at 8:24 am
sp_help_revlogin : List outs all the logins from the server,
I dont want all the logins.
I just need for a list all the logins in a database:
which include login, roles, grant permissions.
Any help is greatly appreciated..Thanks in advance.
November 15, 2012 at 8:37 am
have you looked at the link i posted?
---------------------------------------------------------------------
November 15, 2012 at 9:22 am
Georges link again for clarity:
http://www.sqlservercentral.com/scripts/Permissions/76450/
Lowell
November 16, 2012 at 6:36 am
See the following url for an Instance Security Audit script I wrote. It prints in columnar format, and you can change one variable to make it print the actual assignment statements for the permissions. The posting explains a little more.
Hope it helps.
http://www.sqlservercentral.com/Forums/Topic1251262-146-1.aspx?Update=1
November 16, 2012 at 7:27 am
vikingDBA (11/16/2012)
See the following url for an Instance Security Audit script I wrote. It prints in columnar format, and you can change one variable to make it print the actual assignment statements for the permissions. The posting explains a little more.Hope it helps.
http://www.sqlservercentral.com/Forums/Topic1251262-146-1.aspx?Update=1
If you want to share this you would be better posting it in the scripts section
---------------------------------------------------------------------
November 16, 2012 at 11:28 am
You could try:
Right-click on db name, select Tasks -> Generate Scripts
There you have a number of scripting options including scripting out Users, Roles, and Schemas. There is an advanced options tab that will give you even more choices of what to put in the script output.
November 29, 2012 at 12:38 pm
hey I try to execute (Reverse-Engineer Database Permissions (2005 up)) http://www.sqlservercentral.com/scripts/Permissions/76450/
I am getting error.
Msg 102, Level 15, State 1, Procedure usp_get_object_permissions, Line 44
Incorrect syntax near '?'.
Msg 102, Level 15, State 1, Procedure usp_get_object_permissions, Line 50
Incorrect syntax near '?'.
November 30, 2012 at 3:35 am
looks like some sort of problem with the copy\paste from the site.
click on the error message in the results pane and it will take you to the actual error in the code. Its purely syntax so some character has been misinterpreted.
Remember to go through the discussion on the script to get an improvement to part of it.
---------------------------------------------------------------------
Viewing 15 posts - 1 through 14 (of 14 total)
You must be logged in to reply to this topic. Login to reply