Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Why I need to assign Grant/Deny Permission after every database restore ? Expand / Collapse
Author
Message
Posted Wednesday, January 30, 2013 9:43 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, March 13, 2014 7:39 AM
Points: 46, Visits: 111
I need to restrict user which was achieved by grant and deny permissions using TSQL in sql server 2008 R2 successfully.

Now i need to update database,For know ,I am using backup/restore for updation of database.
But when ever i did it ,User grant/Deny were needed to assign .

Is their any thing that i used to grant/deny permission and no need to assign then on every restore/backup ???

Kindly let me know
Post #1413839
Posted Thursday, January 31, 2013 12:06 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, July 14, 2014 4:48 AM
Points: 2,834, Visits: 3,950
maida_rh (1/30/2013)
I need to restrict user which was achieved by grant and deny permissions using TSQL in sql server 2008 R2 successfully.

Now i need to update database,For know ,I am using backup/restore for updation of database.
But when ever i did it ,User grant/Deny were needed to assign .

Is their any thing that i used to grant/deny permission and no need to assign then on every restore/backup ???

Kindly let me know
i think you are refering here orphan login fix . right ?

IF you are using same copy of database again and again, then restore the backup , do the login fix and then take the backup and use it everytime.
if you are using different and latest backup copy then you have to do the login fix everytime.


-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done
Post #1413858
Posted Thursday, January 31, 2013 12:38 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, March 13, 2014 7:39 AM
Points: 46, Visits: 111
I am using sql server authentication and user i assigned permission also have login id and pass,I googled the term "orphan login and got this :

[url=http://www.fileformat.info/tip/microsoft/sql_orphan_user.htm][/url]

what do i need to do as i need the restore to commit the change to a single table structure + data .
I tryed the import but got error:

Violation of primary key constraints 'userid' .can not insert duplicate key in object 'usertb'


Kindly let me know and thanks
Post #1413866
Posted Thursday, January 31, 2013 1:05 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, July 14, 2014 4:48 AM
Points: 2,834, Visits: 3,950
maida_rh (1/31/2013)

what do i need to do as i need the restore to commit the change to a single table structure + data .
I tryed the import but got error:

Violation of primary key constraints 'userid' .can not insert duplicate key in object 'usertb'
How you are restoring ? through backup ?


-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done
Post #1413872
Posted Thursday, January 31, 2013 1:57 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, March 13, 2014 7:39 AM
Points: 46, Visits: 111
yes,through backup file
Post #1413906
Posted Thursday, January 31, 2013 2:31 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, July 14, 2014 4:48 AM
Points: 2,834, Visits: 3,950
maida_rh (1/31/2013)
yes,through backup file
then how come PK violation ? restore backup do data copy of exact the content in backup , there cant be PK violation


-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done
Post #1413925
Posted Thursday, January 31, 2013 3:14 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, March 13, 2014 7:39 AM
Points: 46, Visits: 111
Pk_violation when i tried to import data from current updated source database to destination database.


How can I resolve orphan login as ,already assiged a login password to that user ????
Post #1413954
Posted Thursday, January 31, 2013 3:32 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, July 14, 2014 4:48 AM
Points: 2,834, Visits: 3,950
maida_rh (1/31/2013)
Pk_violation when i tried to import data from current updated source database to
destination database.
still you are not clear here , are you populating tables on destination side which already contain data then there is possibilty of PK violation. if possible(Be very very careful) that you can afford then truncate the table at dest. side and then populate them.

maida_rh (1/31/2013)
How can I resolve orphan login as ,already assiged a login password to that user ????

ALTER AUTHORIZATION ON DATABASE::YourDatabaseName TO sa
GO

see this http://msdn.microsoft.com/en-us/library/ms187359.aspx


-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done
Post #1413961
Posted Thursday, January 31, 2013 3:43 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, March 13, 2014 7:39 AM
Points: 46, Visits: 111
I tryed TRUNCATE on table but still the same error of PK violation during import/Export.

What does AuTHORIZATION do ?If I assigned to sa ?

Post #1413966
Posted Thursday, January 31, 2013 3:52 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, July 14, 2014 4:48 AM
Points: 2,834, Visits: 3,950
maida_rh (1/31/2013)
I tryed TRUNCATE on table but still the same error of PK violation during import/Export.
So it means your source table contains duplicate data ? do you have same PK on source table too as you have on dest table ?


maida_rh (1/31/2013)
What does AuTHORIZATION do ?If I assigned to sa ?
See the link i posted above


-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done
Post #1413973
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse