Invoke-DlmDatabaseSchemaValidation in DLM Automation removes

neiltroddenneiltrodden Posts: 5 New member
edited October 26, 2016 6:57AM in DLM Automation
Hi,

We’re currently evaluating the Toolbelt suite and am currently in discussion with RedGate regarding a possible purchase for our entire company. We’re having a problem with the DLM automation part and wondered if you could help.

As part of our TeamCity testing process, we run the ‘Invoke-DlmDatabaseSchemaValidation’ Powershell script to test against a database we have in our development environment called _TeamCityBuild.

The problem is, this ‘cleans’ the database first and this appears to be removing all users in that database. This causes an issue because we use Amazon’s RDS service which does not allow you to have server level administrator access – RDS creates users within the database you are creating and grants access to them. When Invoke-DlmDatabaseSchemaValidation runs, it removes these users and locks us out of the database…

We’ve examined the verbose output from Invoke-DlmDatabaseSchemaValidation and see that the clean database step calls SQLCompare.exe and does not use any filter so we cannot tell it to leave our ‘sqldba’ user alone.

Is there any way to get around this?

Thanks

Neil

Comments

  • Hi Neil,

    Following up on the support ticket, you should be able to do this by setting up a a SQL Compare filter that excludes users and then explicitly calling that filter using `-FilterPath` .

    Unlike with other cmdlets just having a filter on your SQL Source Control scripts folder will not work with Invoke_DlmDatabaseSchemaValidation.

    Thank you,
    Sergio
    Product Support Engineer
    Redgate Software Ltd
    Please see our Help Center for detailed guides on how to use our tools
  • neiltroddenneiltrodden Posts: 5 New member
    Thanks Sergio and thank-you for posting the answer on here for others who follow!

    What I found was that my database scripts folder already contains a filter.scpf file but I had to explicitly tell the validation script to use it. Note - the same filter file is used for the clear-down *and* the testing...!
Sign In or Register to comment.