automate the process of transferring SQL server 2005 login from SQL server 2005 mirror primary site to DR site

Dear all,

Right now just found out that some login in the SQL server 2005 with SP2 mirror DR site do not have the respective login from primary mirror partner.

I can do this to manually transfer sql server login to the DR parnter.

but:

1)  Anyway to automate the whole process?
2)  I recall that the database permission, will goes with the database backup and restore process during the mirror creatino process ? so in this case, we only need to find out only the SQL login transfer script (by http://support.microsoft.com/kb/918992) and apply to the  DR mirror parnter?
3) Can the SQL srever 2012 / 2014 DAG group automate this ? it mirror the MS SQL system database too ?
4) or must use SSIS for that? any step by step guide to implement this kind of SSIS task on SQL server 2005 with SP2?

I find out this: http://www.sqlsoldier.com/wp/sqlserver/transferring-logins-to-a-database-mirror, any one tried that before ? can it copy the database role and permisson of the missing SQL login to the DR server as well ? and it work with SQL server 2005 and all version after?

so usage is dba_CopyLogins <dr server name>;  on primary server?

and it will only copy the MISSING login for that instead of recreate all logins or create all but with error message that the same login already exists on DR server ?

please suggest what is your existing method .
LVL 1
marrowyungSenior Technical architecture (Data)Asked:
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.

marrowyungSenior Technical architecture (Data)Author Commented:
so I find a DDL trigger script:

Create Trigger trigger_ApplyLoginsToDestination
On All Server
After Create_Login, Alter_Login, Drop_Login
As
Exec msdb..sp_start_job 'Apply Login Changes from Source to Destination' --change to your own job name
Print 'You have synced your login changes from source to destination server.'

Open in new window


so I change to

Create Trigger trigger_ApplyLoginsToDestination
On All Server
After Create_Login, Alter_Login, Drop_Login
As
Exec dba_CopyLogins <dr server name>; 
Print 'You have synced your login changes from source to destination server.'

Open in new window


?
0
Jim P.Commented:
Have you heard about sp_help_revlogin.

My  last job I had it scheduled to dump to a file every 8 hours. Then that file was replicated to our offsite DR center. So I always had a current copy to use for DR testing or if something really happened..
0
marrowyungSenior Technical architecture (Data)Author Commented:
Jim P,

Have you heard about sp_help_revlogin. yes by the MS script, but that one need manual work !

"My  last job I had it scheduled to dump to a file every 8 hours. Then that file was replicated to our offsite DR center. So I always had a current copy to use for DR testing or if something really happened.. "

so you mean get the output from that and store as a file? how ?

so just before you failover to the DR site you apply that file ?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Jim P.Commented:
Yes, I automated the output using the SQLCMD tool. I don't remember the exact syntax anymore.

Then after the databases were back in place I would run the script.  There are lines that will have to be commented out that the tool puts in, but the is a is a simple search and replace.
0
marrowyungSenior Technical architecture (Data)Author Commented:
I can tell you that this:

http://www.sqlsoldier.com/wp/sqlserver/transferring-logins-to-a-database-mirror

can be one of the solution and other solution is to use SSIS package!

but that one is a SP and I don't konw any better solution !

anymore ?
0
Jim P.Commented:
The problem it that the DBs have to pre-exist  at the destiination. Where the script after the script can be run after the DBs have been restored.
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
marrowyungSenior Technical architecture (Data)Author Commented:
"The problem it that the DBs have to pre-exist  at the destiination. "

of course ! ok you mean your way is very automated and don't need to know the new server name? DAG right?
0
captainCommented:
marrowyung,

Jim P. sadly passed away on the 23rd of September. If you still require assistance with this, please kindly use the "Request Attention" feature.

capt.
0
marrowyungSenior Technical architecture (Data)Author Commented:
R.I.P, you are his/her friend ?

I appreciate everything from him, what happed?
0
captainCommented:
We only met on here. If you follow the link, there is a further link to the obituary. I do not have any more details than this.

I just thought I let you know in case you were waiting for a response.

:(
0
marrowyungSenior Technical architecture (Data)Author Commented:
ok, tks a lot. please follow me in this site if you can
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

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.