SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Why I need to assign Grant/Deny Permission after every database restore ?


Why I need to assign Grant/Deny Permission after every database restore ?

Author
Message
maida_rh
maida_rh
SSC-Enthusiastic
SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)

Group: General Forum Members
Points: 170 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
Bhuvnesh
Bhuvnesh
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: General Forum Members
Points: 12886 Visits: 4077
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;-)
maida_rh
maida_rh
SSC-Enthusiastic
SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)

Group: General Forum Members
Points: 170 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
Bhuvnesh
Bhuvnesh
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: General Forum Members
Points: 12886 Visits: 4077
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;-)
maida_rh
maida_rh
SSC-Enthusiastic
SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)

Group: General Forum Members
Points: 170 Visits: 111
yes,through backup file
Bhuvnesh
Bhuvnesh
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: General Forum Members
Points: 12886 Visits: 4077
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;-)
maida_rh
maida_rh
SSC-Enthusiastic
SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)

Group: General Forum Members
Points: 170 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 ????
Bhuvnesh
Bhuvnesh
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: General Forum Members
Points: 12886 Visits: 4077
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;-)
maida_rh
maida_rh
SSC-Enthusiastic
SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)SSC-Enthusiastic (170 reputation)

Group: General Forum Members
Points: 170 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 ?
Bhuvnesh
Bhuvnesh
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: General Forum Members
Points: 12886 Visits: 4077
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;-)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search