Thursday, April 16, 2015

Mirroring Endpoint Owner Changing



Breaking mirror and recreating by logging into the desired account will be the easiest way. But we can follow the below steps to fix the account without breaking.

1. Query to find the current endpoint owner of the instance and take a note.

SELECT [PrincipalName] = sp.name, [PrincipalId] = sp.principal_id, me.* FROM sys.database_mirroring_endpoints me with(nolock)
inner join sys.server_principals sp with(nolock) on me.principal_id = sp.principal_id

2. New endpoint not exists then we need to create as login and need to be granted the following authorization.

GRANT CONNECT ON ENDPOINT::Mirroring TO [Domain\LOGINNAME];
ALTER AUTHORIZATION ON ENDPOINT::Mirroring TO [Domain\LOGINNAME];

3. Verify the current owner of endpoint using step 1.

Wednesday, April 15, 2015

SQL Server Agent - xp_readerlog[] returned error3 -System can not find the path specified

Here in the steps to follow:



USE MASTER
GO
EXEC msdb..sp_get_sqlagent_properties
GO

USE MASTER
GO
EXEC msdb.dbo.sp_set_sqlagent_properties
@errorlog_file=N'PATH'  -- N'k:\MSSQL10_50\MSSQL\Log\SQLAGENT.OUT'
GO


USE MASTER
GO
EXEC msdb..sp_get_sqlagent_properties
GO


Restart SQL server agent.