Monday, March 19, 2012

How to re-create DB users, roles and members, and their permissions on secondary

Since the secondary is in no-recovery mode after mirroring, and cannot
be connected to, how is one supposed to re-create DB users, roles and
members, and their permissions on secondary? I have a script to do
this, but cannot run it? Is this something I would have to run
manually on the secondary after a failover?
Thanks in advance for any advice.You could have run that script before configuring DBM, also you can
failover and do the same now. AFAIK, i dont think there is any other
way to do when the DB is in No-Recovery Mode
HTH,
Dinesh|||> how is one supposed to re-create DB users, roles and
> members, and their permissions on secondary?
No need to. All this is inside the database, copied over from the primary. What you do need to
handle, though are the logins. Easiest, IMO is to use sp_help_revlogin (Google for it).
And of course you might need other things not in the user database. Like linked servers,
sp_configure settings, jobs, operators, alerts etc.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"JRoughgarden" <jroughgarden@.gmail.com> wrote in message
news:1185322213.737415.190810@.z24g2000prh.googlegroups.com...
> Since the secondary is in no-recovery mode after mirroring, and cannot
> be connected to, how is one supposed to re-create DB users, roles and
> members, and their permissions on secondary? I have a script to do
> this, but cannot run it? Is this something I would have to run
> manually on the secondary after a failover?
> Thanks in advance for any advice.
>|||Tibor,
Thanks for the response. The logins have been re-created on the mirror. It
has generally been my experience that when restoring a DB from a backup file,
one has to drop and re-create the DB users, roles, and privileges. I had
expected the same would be true for DM. But if you say it is not, then great!
Thanks.
Jeff|||> It
> has generally been my experience that when restoring a DB from a backup file,
> one has to drop and re-create the DB users, roles, and privileges.
No, that is not required. All those things are actually inside the database, so they are restored
with your database. So no work on these has to be done, unless you want to change something, of
course. What usually happens is that you don't have the same logins on the target server, with the
same SID number, so your users are orphaned, and you might *believe* that you need to redo your
users etc...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Jeffrey Roughgarden" <JeffreyRoughgarden@.discussions.microsoft.com> wrote in message
news:50CB10DD-83BA-49AC-B510-C21D3CC63697@.microsoft.com...
> Tibor,
> Thanks for the response. The logins have been re-created on the mirror. It
> has generally been my experience that when restoring a DB from a backup file,
> one has to drop and re-create the DB users, roles, and privileges. I had
> expected the same would be true for DM. But if you say it is not, then great!
> Thanks.
> Jeff

No comments:

Post a Comment