I read Amit’s blog on Replication regarding the server name change (https://www.sqlservergeeks.com/sql-server-replication-requires-the-actual-server-name-to-make-a-connection-to-the-server/). It also reminds me that after changing the name of the server, some jobs were failing because the original login name that owned the job was invalidated. Suppose the server name was changed from WIN2K8R2 to REPLDBMIRRNODE1 and the jobs were owned by the local administrator (Windows Authentication), WIN2K8R2\Administrator, then these job failed since the login was invalidated. What was required to be done was to change the login from [WIN2K8R2\Administrator] to [REPLDBMIRRNODE1\Administrator].
And the following script can do this:
ALTER LOGIN [WIN2K8R2\Administrator] WITH name = [REPLDBMIRRNODE1\Administrator]
After this, the jobs ran successfully.
Like us on FaceBook | Follow us on Twitter | Join the fastest growing SQL Server group on FaceBook
Follow me on Twitter | Follow me on FaceBook
One Comment on “SQL Server Change Job Owner – using ALTER LOGIN”
Yes, this is cheeky, i faced this one…