Query executed by user

  • On my DB Instance some user truncated all my data table.

    So is there a way to find the user who executed this query.

    Help :unsure:

  • Do you have any database auditing? If not, then its not possible to find out.

    Depending on your edition/version and your database environment, there are many tools to capture/audit user activities.

    1. extended events

    2. sql trace

    3. database audit

    Try to use any one of the above, if you are sure they are not impacting performance.

  • thanks for the same i too thought that

    it not possible to find without any tracing or auditing feature turned own.

  • 1. Please tell me you have a good backup you can use for restoration.

    2. If the application is on the internet, don't forget to include the web servers in your research. If the loss was due to being hacked, find the hole and plug it.

    3. We use SQL Sentry for finding trouble and areas for improvement. A neat little feature of it is that it keeps track of SQL statements executed, when and by whom. It also keeps performance stats on each statement. I've found it to be invaluable for finding out what happened when we find that there's a problem.

    I know this doesn't help you with your current crisis, but perhaps an ounce of prevention will help next time.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply