Some useful(for me at least) SQL scripts
- March 11th, 2010
- Write comment
I’m not an SQL developer, and since I don’t use these often, I tend to forget, so….
Check mirror port:
SELECT type_desc, port FROM sys.tcp_endpoints;
GO
Set mirror port:
ALTER ENDPOINT Mirroring
STATE = STARTED
AS TCP (LISTENER_PORT = PORT)
FOR database_mirroring (ROLE = Partner);
GO
Set mirror partner:
ALTER DATABASE [Database]
SET PARTNER = ‘TCP://server.domain:PORT’
Asynchronous
ALTER DATABASE [Database]
SET PARTNER SAFETY OFF;
GO
More to come