2

When you use the GUI to create a server audit it creates a password worthy (no caps) value like

e5abe6c5-f451-41f3-936c-b1da1c0786ce

When you look to CREATE SERVER AUDIT with Transact-SQL it does not say much

AUDIT_GUID = uniqueidentifier

To support scenarios such as database mirroring, an audit needs a specific GUID that matches the GUID found in the mirrored database. The GUID cannot be modified after the audit has been created.

You can have multiple audits on the server. So it can't be null, and it looks like you can do some stuff cross server (i.e. auditing A from B) so it probably needs to be unique across your network. If you have mirroring it needs to the same on the mirrored instances. You give the audit a name when you create it.

CREATE SERVER AUDIT [AuditSelect]

There is a suggestion on StackExchange to Dynamically Generate a AUDIT_GUID value via T-SQL.

I am thinking that name of the 'primary server' + 'Audit Name' should be fine as a unique value; Server01_AuditSelect.

Assuming a 1000+- servers, is there anything significant am overlooking?

Assuming you can't have multiple active servers in the same network with the same name.

  • Per the documentation, there is no reason to use the AUDIT_GUID unless you are setting it up for mirrored databases. If you are not, then you don't even need that parameter. – Shawn Melton Mar 3 '16 at 16:38
  • 1
    Compare it to creating a login for mirrored instances, you have to make sure the SID for that login is identical on the secondary servers. So you pull that SID from the primary and pass it to the CREATE LOGIN on all your secondaries. The Audit is treated in the same manner. – Shawn Melton Mar 3 '16 at 16:39
  • @ShawnMelton where do you see "there is no reason to use the AUDIT_GUID unless you are setting it up for mirrored ", the quote in the question says it has be the same on mirrored databases, but it does not say it is only required for mirrored databases. – James Jenkins Mar 3 '16 at 16:42
  • 1
    Because I have created multiple audits on servers using T-SQL...I never include that parameter. – Shawn Melton Mar 3 '16 at 17:00
  • 1
    Just a note, when you look at MSDN link you provided the AUDIT_GUID in the sytnax section shows this parameter under <audit_options>::=. This means it is an optional parameter, not required, and it will either take a default value or auto generate a value upon executing the command. – Shawn Melton Mar 3 '16 at 17:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.