Skip to main content

SQL Server

NOTE: Before configuring your monitoring plan, read the SQL Server configuration topic and complete its instructions. It describes the required data collecting account and ports, what Auditor configures on SQL Server automatically, and which object types and attributes Auditor monitors.

To configure SQL Server data source settings, use the following property tabs:

  • General settings
  • Users
  • Data
  • Audit SELECT

When finished, review your data source settings and click Add to go back to your plan. The newly created data source will appear in the Data source list.

As a next step, click Add item to specify an object for monitoring. See the Add Item to the SQL Server topic for additional information.

General settings​

On the General tab, you can configure the following settings for SQL Server data source:

OptionDescription
Monitor this data source and collect activity dataEnable monitoring of the selected data source and configure Auditor to collect and store audit data.
Monitor SQL Server configuration changesAlways enabled, as Auditor always monitors SQL Server configuration changes.
Monitor SQL Server logon activitySpecify what types of logon events you want to monitor, performed through Windows and SQL authentication:
- Failed logons
- Successful logons
Collect data for state-in-time reportsStore the snapshots of your SQL Server instance configuration for state-in-time reports. See Collect data for state-in-time reports.

Collect data for state-in-time reports​

Configure Netwrix Auditor to store the snapshots of your SQL Server instance configuration — you will require them for state-in-time reports generation. See State–In–Time Reports for more information.

CAUTION: The State-in-Time functionality isn't available for SQL Server Availability Groups.

The product updates the latest snapshot on the regular basis to keep users up-to-date on actual system state. Only the latest snapshot is available for reporting in Netwrix Auditor. If you want to generate reports based on different snapshots, you must import snapshots to the Audit Database. To import snapshots, you need the Global administrator or the Global reviewer role in Netwrix Auditor.

  1. In the Manage historical snapshots section, click Manage and select the snapshots that you want to import.
  2. Move the selected snapshots to the Snapshots available for reporting list using the arrow button.
  3. When finished, click OK.

See also Using historical data.

Users​

On the Users tab, you can configure the following settings for SQL Server data source:

data_source_sql_users_thumb_0_0

In Specify users to track their activity, select the option you need to fine-tune your SQL Server monitoring scope:

  • Monitor all users
  • Include only users matching these criteria
  • Exclude users matching these criteria

For example, you may need to track only actions performed by administrative accounts, or exclude the activity initiated by ordinary applications. If so, use these filters so that Auditor filters the data before it appears in search results, reports, and Activity Summaries.

You can create either inclusion or exclusion lists. Auditor applies all filters using AND logic. To create a filter for user activity monitoring, select the related option and click the button on the right. Specify the following:

  • User — Enter the initiator's account as it appears in the "Who" column of reports and Activity Summaries, for example: mydomain\user1. For events containing "System" in the "Who" column, you can enter "System".
  • Workstation where activity was initiated — Enter the workstation name as it's shown in the "Workstation" column of reports and Activity Summaries, for example: StationWin2016.
  • Application that initiated the activity — Enter the application name as shown next to "Application name" in details of reports and Activity Summaries.

You can use a wildcard (*) to replace any number of characters in filters.

In addition to the restrictions for a monitoring plan, you can use the *.txt files to collect more granular audit data. The new monitoring scope restrictions apply together with previous exclusion settings configured in the *.txt files. See the Monitoring Plans topic for additional information.

Data​

On the Data tab, you can configure the following settings for SQL Server data source.

note

When auditing SQL Server availability groups, the only supported data collection mode is Don't use triggers.

Monitor changes to data in the database tables​

Enable monitoring of changes to data stored in the database tables hosted on the SQL Server.

If you plan to enable this option, ensure the account that runs the SQL Server service on the monitored instance has at least read permissions in the Active Directory domain (for example, it doesn't run under a local user account). Otherwise, enabling this option may lead to issues when altering databases on the monitored SQL Server instances.

Data collection mode​

  • Don't use triggers — Default mode for a new installation of Netwrix Auditor. Data will be collected using the SQL Server traces. This mode gives you a sufficient level of detail in the reports and search results without producing additional load on your SQL Server instance. Netwrix recommends this mode for highly-transactional servers.

  • Use triggers for detailed monitoring — Select this mode if you require very detailed reporting on the data changes. Auditor also selects this mode by default if you are upgrading your Netwrix Auditor deployment. In this mode, Auditor collects data using a set of triggers. For more information on this technology, see https://kb.netwrix.com/728.

    To get the before and after values for updated rows, the audited tables need a primary key or a unique constraint. See Before and after values for data changes.

    Use this setting carefully, since collecting a large amount of details from a highly-transactional server may affect its performance. Using this mode may lead to issues when altering databases on the monitored SQL Server instances. The issues occur only if the SQL Server service account doesn't have Read permissions in the Active Directory domain (for example, a local user account).

    Switching from the configured triggerless mode may lead to a data loss. The workaround is to force data collection right after enabling the triggers.

In both modes, consider that the "What" field of the Activity Record with "Object type" = "Data" may show incorrect data. The issues occur because the product applies data categories to an entire SQL Server table and not to rows.

Changes (per transaction) to collect and report​

Specify how many changes per a database transaction you want to be collected. For example, you can limit this number to 10 changes per transaction, or collect all changes. It's recommended to adjust this setting carefully, as collecting large number of changes from a highly-transactional server may affect its performance.

Monitoring rules​

To specify which data changes Auditor monitors, create at least one inclusion rule. Exclusion rules are optional. Click Add Rule and configure the following:

data_source_sql_data_rule_thumb_0_0

  • Type — Select rule type: include or exclude.

  • Server — Specify a name of the monitored SQL Server instance where the required database resides. Use the server_name\instance_name format, for example, SQLsrv11\SQLExpress2016.

    NOTE: If you are going to configure monitoring rules for SQL Server Availability Groups, provide the name of your Availability Group item in this field.

  • Database — Specify the database whose data changes you want to monitor.

  • Table — Specify database table to monitor.

  • Column — Specify table column name. For supported column types, see Monitored data types.

Auditor applies these filters using AND logic. You can use a wildcard (*) to replace any number of characters.

Audit SELECT​

Use the settings in this section to configure how the successful SELECT statements should be audited.

data_source_sql_audit_select_thumb_0_0

Audit successful SELECT statements​

Enable monitoring of successful SELECT statements for the database tables. Successful SELECT statement execution will be reported as Read operation on the database table. Auditing SELECT statements will increase the amount of data collected from the SQL Server instance and stored to long-term archive and audit database. Plan for your resources accordingly.

Monitoring rules​

To specify what SELECT statements will be monitored, you must create at least one inclusion rule. Exclusion rules are optional. Click Add Inclusion and specify the following:

data_source_sql_audit_select_rule_thumb_0_0

  • Server — Specify target SQL Server instance in the server\instance format.

    NOTE: If you are going to configure monitoring rules for SQL Server Availability Groups, provide the name of your Availability Group item in this field.

  • Database — Specify target database.

  • Schema — Specify database schema.

  • Table — Specify database table you will monitor.

Wildcard (*) is supported and replaces any number of characters. Filters will be applied using AND logic, that is, only SELECT statements matching all specified criteria will be monitored. For example, with the rule shown in the Add Inclusion screenshot, the program will track and report only the successful SELECT statements executed against the Applicants table of the HR2019 database with Custom schema, hosted on the SQLsrv02\TestInstance.

When finished, click Add. If needed, configure the exclusion rules in a similar way.