Auto close database


Job details

Name: Auto close database
Platform: Sqlserver
Category: Security
Premium package: Security and compliance package
Description: Checks if the contained databases are closed or not after a connection terminates.
Long description: Checks if the contained databases are closed or not after a connection terminates.
Version: 1.2
Default schedule: 2 1 1 *
Requires engine install: Yes
Compatibility tag: .[type=‘instance’ & databasetype=‘sqlserver’]/instance[maj_version > ‘2005′ & hasengine=‘YES’ & eng_inst_priv = 0 & (engine_edition = ‘Microsoft SQL Server’ engine_edition = ‘Azure SQL Managed Instance’)]

Parameters

Name Default value Description
return status 1 Return status value (ALARM – 2, WARNING – 1, or OK – 0) when “AUTO_CLOSE“ is disabled.
disable AUTO_CLOSE NO If set to “YES“ the alert will disable “AUTO_CLOSE“ for every contained databases by running ALTER DATABASE [db_name] SET AUTO_CLOSE OFF.
history threshold 365 The maximum number of days to keep statistics for in the historic tables.

Job Summary

SELECT name, containment, containment_desc, is_auto_close_on FROM sys.databases WHERE containment <> 0

Implementation Details

Reporting and Analysis

Configuration Options:

System Requirements and Compatibility

This job not only aids in ensuring security but also helps in aligning the database configurations with best practices and compliance requirements, essential for maintaining the integrity and security of the database environment.