Changing the LISTENER_IP address in a database mirroring configuration
This question came up today: how can I change the IP address between the principal and mirror in database mirroring?
Not a common operation but this procedure worked in an isolated lab environment where we had full control over the application and transaction activity. We wanted to introduce a WAN latency injector so needed to change the database mirroring IP addresses on the principal and mirror.
- Stop application activity
- Remove mirroring (SET PARTNER OFF)
- Stop Mirroring endpoints (on principal and mirror)
- Alter Mirroring endpoints to use new IP addresses e.g. ALTER ENDPOINT SET LISTENER_IP =
- Start endpoints on principal and mirror
- Enable mirroring (ALTER DATABASE <dbname> SET PARTNER = TCP://x.x.x.x)
I’ll try and find the exact scripts we used and upload them here.