Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

Someone ran delete records utility

Posted on by 5

we have lost years of transactional data from our GP 2018 company.  my 3rd party (who have been actively working on launching WMS and Manufacturing modules in the backgroud) says one of my staff must have run the Utility - delete records,,,, which none of my staff even remotely know how to do.

questions

- can you recover the data?

- can you identify when that utility was run, and by which user?

- is it possible something my 3rd party IT group was doing in the background - they could have accidentally removed the records / tables

help :)

Categories:
  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: Someone ran delete records utility

    I usually do not employ Full Recovery unless the user is ready to maintain point-in-time restores. Then they would be performing transaction log backups.

    In an ideal world Full Recovery is the way to go. But with small databases just running full backups every few hours is sufficient.

    I do like your idea however. That is good to know.

  • Gavin Profile Picture
    Gavin 2,339 on at
    RE: Someone ran delete records utility

    Hi Richard,

    The method I describe in my blog doesn't need the USER2ENT or USWHPSTD fields to be present in the tables to find out who deleted the records from the database. The SQL transaction log stores the SQL User ID who issued the DELETE operations on the SQL database. Therefore you can query the SQL Transaction Log to find out which SQL User ID deleted the data. (assuming the SQL database is in the FULL recovery model)

    Technically you can use this method to find out which SQL User ID deleted data from any SQL database, it doesn't have to be a Dynamics GP SQL database.

    Thanks

    Gavin

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: Someone ran delete records utility

    Not all tables have a column USER2ENT or USWHPSTD so there would be no way to tell who deleted these records regardless of the recovery method used. You would need something like FastPath to be running. The simplest way is to restore a backup to another database and then start comparing database. The horses have already left the barn in this case but going forward it would help to start restricting user access by assigning roles to users.

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: Someone ran delete records utility

    Do you  have a backup that you can restore to a test company? You could then run scripts looking for missing DEX_ROW_ID values in the tables in question. I just went through this with another client. First, find out what is missing and then start asking who did the deleting.

  • Gavin Profile Picture
    Gavin 2,339 on at
    RE: Someone ran delete records utility

    Hi,

    Unfortunately if the database is in the "Simple" recovery model the transaction log is reused when a SQL transaction commits. (an SQL transaction like a DELETE operation). Therefore you can't use the method I describe to find out I'm afraid.

    Thanks

    Gavin

  • Mala1982 Profile Picture
    Mala1982 5 on at
    RE: Someone ran delete records utility

    thanks Gavin, very helpful, so our current system has been running in Simple Mode - do you mean we just need to switch this over to recovery mode and then run the diagnostics, or does your system have to already be in Recovery Mode for this to have worked ..... so are we too late to find this 'who done it' information at this point in time?

  • Suggested answer
    RE: Someone ran delete records utility

    Backups would be the only thing we would have as far as getting data back.

    As far as who ran the delete, it looks like the Community has some options for that.

    Let us know if you have any questions.

    Thanks

  • Gavin Profile Picture
    Gavin 2,339 on at
    RE: Someone ran delete records utility

    Hi,

    In addition to this a few years ago I had to find out who had deleted a batch in Dynamics GP and wrote this blog on how this can be achieved in SQL.

    thedynamicsexplorer.com/.../

    You just need to know one of the tables that data was deleted from and plug it into one of the scripts.

    Hope this helps.

    Thanks

    Gavin

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: Someone ran delete records utility

    Do you  have a backup that you can restore to a test company? You could then run scripts looking for missing DEX_ROW_ID values in the tables in question. I just went through this with another client. First, find out what is missing and then start asking who did the deleting.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans