Added DisableJobsOnDestination flag to Copy-SqlJobServer - #5
Merged
Conversation
…eady exists, when in fact the job creation failed. Added a Write-Error for the InnerException message in these cases.
potatoqualitee
pushed a commit
that referenced
this pull request
Jan 28, 2016
Added DisableJobsOnDestination flag to Copy-SqlJobServer
Member
|
Awesome, thanks, Thomas! |
potatoqualitee
pushed a commit
that referenced
this pull request
Aug 9, 2016
Syncing Development 2016-08-08
dansqldba
pushed a commit
that referenced
this pull request
Oct 13, 2016
Refresh Dev branch - 2016-09-05
potatoqualitee
pushed a commit
that referenced
this pull request
Jul 21, 2026
Invoke-DbaDbMirroring creates a "Mirroring" database-mirroring endpoint on BOTH instances to establish the session. Both suites tore down the mirrors and the databases but never the endpoints, so every run left them behind on the Multi pair. specs/lab-requirements.md requires those instances to be endpoint-free and LAB-12 enforces it, so preflight failed chronically - and a check that is always red is a check everyone learns to ignore, which is how the LAB-02 constants drift survived 14 days (#5). Measured: both sqldev and sqlcluster carried a leaked "Mirroring" endpoint with 0 mirrored databases in use. Dropped them; they came back on the next mirror run, which is what made this issue #16 rather than one-off cruft. Adds endpoint teardown as the third cleanup step, following the pattern Copy-DbaEndpoint.Tests.ps1:60-61 already uses. In Get-DbaDbMirrorMonitor it goes in the existing finally so it survives a throwing mirror teardown. Swept all three suites that call Invoke-DbaDbMirroring; Invoke-DbaDbMirroring's own suite already removed its endpoints (on the Copy pair). NOT yet verified end to end: #16 asks that LAB-12 be green AFTER the suites run. Get-DbaDbMirrorMonitor currently hard-kills the PowerShell process mid-suite (#19), so its AfterAll never executes and the endpoints still leak from that suite. The teardown here is correct but unreachable until #19 is fixed. (do Get-DbaDbMirror, Get-DbaDbMirrorMonitor) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I ran into a scenario where I wanted to copy all of the jobs from server A to server B, but those copied jobs needed to be immediately disabled on server B. Dropped a flag into Copy-SqlJobServer to support this by disabling the job in the SMO object before scripting out for the copy. Figured other people working with Availability Groups may want the same functionality.
I also ran into a situation where job creation on the destination was failing due to the Job's starting database not existing on the server. Since the exception had 'exist' somewhere in there, the command misreported that the job had already been migrated. Tweaked that check and added a Write-Error to get some useful output from this case.