Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove-SqlDatabaseSafely fails to perform final drop w/ no addtl info #238

Closed
potatoqualitee opened this issue Oct 3, 2016 · 5 comments
Closed
Assignees

Comments

@potatoqualitee
Copy link
Member

Sleeping for a few seconds to ensure the next step (DBCC) succeeds

WARNING: FAILED : Restore Job Rationalised Database Restore Script for db1 failed on sql01 - aborting routine for db1
WARNING: Check the Agent Job History on sql01 - if you have SSMS2016 July release or later
WARNING: Get-SqlAgentJobHistory -JobName Rationalised Database Restore Script for db1 -ServerInstance sql01 -OutcomesType Failed

The job shows as succeeded in Agent, but the database hasn't been dropped for a final time. Can we get a Write-Exception or is that not possible because it's something in Agent?

@SQLDBAWithABeard SQLDBAWithABeard self-assigned this Oct 9, 2016
@SQLDBAWithABeard
Copy link
Contributor

There is a write-exception in that Catch already. Can we reproduce so that I can have a look?

@potatoqualitee
Copy link
Member Author

mmmm so far, it's only failed at work so I can't paste screenshots, but it didn't report that it was writing to the exception log. I'll dig deeper tomorrow.

@potatoqualitee
Copy link
Member Author

Have an additional report:

I have noticed an issue with Remove-SQLDatabaseSafely.... for large dbs, I always get error: Sleeping for a few seconds to ensure the next step (DBCC) succeeds
WARNING: FAILED : Restore Job Rationalised Database Restore Script for DB failed on DB - aborting routine for DB
reproduced in several different SQL 2012 environments at different patch levels
however if I run the rationalized job manually it works
I think it is probably related to the sleep not going long enough

@SQLDBAWithABeard
Copy link
Contributor

Thank you I will take a look at that tomorrow and see if there is another way. Cant remember why I had the sleep in there in the first place.

@potatoqualitee
Copy link
Member Author

Did you see, Chris mentioned this potential fix https://files.slack.com/files-pri/T1LTZ0BQV-F2NJ2416G/pasted_image_at_2016_10_12_03_39_pm.png

SQLDBAWithABeard added a commit that referenced this issue Oct 13, 2016
There is a bug Issue 238
#238 (comment)
where Agent Jobs fail for lasrge databases so have altered the loop and
the timeouts which wait for the agent job to complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants