For each database, the Database Properties module collects a significant amount of information on databases, including:

  • the database name and database id
  • the database owner
  • date of the last full, log, or diff backup
  • which databases have auto-shrink enabled
  • database collations
  • case sensitivity
  • database size on disk
  • and, more


This allows you to track databases as they come and go, grow, shrink, and change names, for the entire enterprise.  To see the most recent collection of database properties, query Collector.DBPropertiesCurrent.

 

Tables

Collector.DBProperties

Stores the collections of database property data.


Definitions for the majority of the Collector.DBProperties columns can be found in the TechNet article on SqlServer.Management.Smo Database Properties: https://technet.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.database_properties(v=sql.110).aspx

 

ColumnTypeDescription
IDbigintPrimary key row identifier.
ExecutionDateTimedatetimeThe execution date and time, common to the run of a collection for a single instance.
InstanceIDbigintThe instance ID of the instance in question, as defined in the table dbo.Servers.
DBidbigintThe database ID (as defined in sys.databases).
DBNamevarcharDatabase name.
DBOwnerVarcharLogin of the database owner.
LastBackupdatetime2Date of the last full backup.
LastLogBackupdatetime2Date of the last log backup.
LastDiffBackupdatetime2Date of the last differential backup.
LastCheckDBdatetime2The date that CheckDB was last performed on this database.
SizeInKBdecimalSee the Database Properties TechNet article (Size property).
DataSpaceUsageInKBDecimalSee the Database Properties TechNet article (DataSpaceUsage property).
IndexSpaceUsageInKBDecimalSee the Database Properties TechNet article (IndexSpaceUsage property).
SpaceAvailableInKBdecimalSee the Database Properties TechNet article (SpaceAvailable property).
AutoClosebitSee the Database Properties TechNet article.
AutoShrinkbitSee the Database Properties TechNet article.
DBReadOnlybitSee the Database Properties TechNet article.
CollationvarcharSee the Database Properties TechNet article.
CompatLevelvarcharSee the Database Properties TechNet article.
DefaultSchemaVarcharSee the Database Properties TechNet article.
RecoveryModelVarcharSee the Database Properties TechNet article.
CreateDatedatetimeSee the Database Properties TechNet article.
CaseSensitivebitSee the Database Properties TechNet article.
StatusvarcharSee the Database Properties TechNet article.
ANSINullDefaultbitSee the Database Properties TechNet article.
ANSINullsEnabledbitSee the Database Properties TechNet article.
ANSIPaddingEnabledbitSee the Database Properties TechNet article.
ANSIWarningsEnabledbitSee the Database Properties TechNet article.
ArithAbortEnabledbitSee the Database Properties TechNet article.
AutoCreateIncrementalStatisticsEnabledbitSee the Database Properties TechNet article.
AutoCreateStatisticsEnabledbitSee the Database Properties TechNet article.
AutoUpdateStatisticsAsyncbitSee the Database Properties TechNet article.
AutoUpdateStatisticsEnabledbitSee the Database Properties TechNet article.
ReplicaIDuniqueidentifierThe ID of the local Always On Availability Group replica that the database is in.
GroupDatabaseIDuniqueidentifierDatabase ID within an Always On availability group.
ResourcePoolIDintThe resource pool ID that is mapped to this database.
AvailabilityDatabaseSynchronizationStatevarcharSee the Database Properties TechNet article.
AvailabilityGroupNamevarcharSee the Database Properties TechNet article.
BrokerEnabledbitSee the Database Properties TechNet article.
ChangeTrackingAutoCleanUpbitSee the Database Properties TechNet article.
ChangeTrackingEnabledbitSee the Database Properties TechNet article.
ChangeTrackingRetentionPeriodintSee the Database Properties TechNet article.
ChangeTrackingRetentionPeriodUnitsvarcharSee the Database Properties TechNet article.
CloseCursorsOnCommitEnabledbitSee the Database Properties TechNet article.
ConcatenateNullYieldsNullbitSee the Database Properties TechNet article.
ContainmenttinyintSee the Database Properties TechNet article. 0 indicates database containment is off.
ContainmentDescvarcharDescription of database containment. Example values: NONE, PARTIAL
DatabaseGuiduniqueidentifierSee the Database Properties TechNet article.
DatabaseOwnershipChainingbitSee the Database Properties TechNet article.
DatabaseSnapshotBaseNamevarcharSee the Database Properties TechNet article.
DateCorrelationOptimizationbitSee the Database Properties TechNet article.
DefaultFileGroupvarcharSee the Database Properties TechNet article.
DefaultFileStreamFileGroupvarcharSee the Database Properties TechNet article.
DefaultFullTextCatalogvarcharSee the Database Properties TechNet article.
DefaultFullTextLanguagevarcharSee the Database Properties TechNet article.
DefaultLanguagevarcharSee the Database Properties TechNet article.
DelayedDurabilityvarcharSee the Database Properties TechNet article.
EncryptionEnabledbitSee the Database Properties TechNet article.
FilestreamDirectoryNamevarcharSee the Database Properties TechNet article.
FilestreamNonTransactedAccessvarcharSee the Database Properties TechNet article.
HasFileInCloudbitSee the Database Properties TechNet article.
HasMemoryOptimizedObjectsbitSee the Database Properties TechNet article.
HonorBrokerPrioritybitSee the Database Properties TechNet article.
IsAccessiblebitSee the Database Properties TechNet article.
IsDatabaseSnapshotbitSee the Database Properties TechNet article.
IsDatabaseSnapshotBasebitSee the Database Properties TechNet article.
IsFederationMemberbitSee the Database Properties TechNet article.
IsFullTextEnabledbitSee the Database Properties TechNet article.
IsMailHostbitSee the Database Properties TechNet article.
IsManagementDataWarehousebitSee the Database Properties TechNet article.
IsParameterizationForcedbitSee the Database Properties TechNet article.
IsReadCommittedSnapshotOnbitSee the Database Properties TechNet article.
IsSystemObjectbitSee the Database Properties TechNet article.
IsUpdateablebitSee the Database Properties TechNet article.
IsVarDecimalStorageFormat
Enabled
bitSee the Database Properties TechNet article.
LocalCursorsDefaultbitSee the Database Properties TechNet article.
LogReuseWaitStatusvarcharSee the Database Properties TechNet article.
MemoryAllocatedToMemory
OptimizedObjectsInKB
bigintSee the Database Properties TechNet article.
MemoryUsedByMemory
OptimizedObjectsInKB
bigintSee the Database Properties TechNet article.
IsMirroringEnabledbitSee the Database Properties TechNet article.
MirroringFailoverLogSequence
Number
decimalSee the Database Properties TechNet article.
MirroringIDuniqueidentifierSee the Database Properties TechNet article.
MirroringRoletinyintThe database’s current role (if any) in the database mirroring session.
MirroringRoleDescvarcharDescription of the database mirroring role. Example values: Principal, Mirror, NULL.
MirroringPartnersysnameSee the Database Properties TechNet article.
MirroringPartnerInstancesysnameSee the Database Properties TechNet article.
MirroringRedoQueueMaxSizebigintSee the Database Properties TechNet article.
MirroringRoleSequenceintSee the Database Properties TechNet article.
MirroringSafetyLevelvarcharMirroring safety setting for updates on the mirror database.
MirroringSavetyLevelDescvarcharDescription of the mirroring safety level. Example values: UNKNOWN, OFF, FULL, NULL
MirroringSafetySequenceintSee the Database Properties TechNet article.
MirroringStatusvarcharState of the mirror database and mirroring session.
MirroringStatusDescvarcharDescription of the mirroring status. Example values: DISCONNECTED, SYNCHRONIZED, SYNCHRONIZING, PENDING_FAILOVER, SUSPENDED, UNSYNCHRONIZED, SYNCHRONIZED, NULL
MirroringTimeoutintSee the Database Properties TechNet article.
MirroringWitnesssysnameSee the Database Properties TechNet article.
MirroringWitnessStatusvarcharState of the witness in the database mirroring session.
MirroringWitnessStatusDescvarcharDescription of mirroring witness status. Example values: UNKNOWN, CONNECTED, DISCONNECTED, NULL
NestedTriggersEnabledbitSee the Database Properties TechNet article.
NumericRoundAbortEnabledbitSee the Database Properties TechNet article.
PageVerifyvarcharSetting of the page_verify option.
PageVerifyDescvarcharDescription of page verify. Example values: NONE, TORN_PAGE_DETECTION, CHECKSUM.
PrimaryFilePathvarcharSee the Database Properties TechNet article.
QuotedIdentifiersEnabledbitSee the Database Properties TechNet article.
RecoveryForkGuiduniqueidentifierSee the Database Properties TechNet article.
RecursiveTriggersEnabledbitSee the Database Properties TechNet article.
ServiceBrokerGuiduniqueidentifierSee the Database Properties TechNet article.
SnapshotIsolationStatevarcharSee the Database Properties TechNet article.
StatetinyintDatabase state.
StateDescnvarcharDescription of database state. Example values: ONLINE, RESTORING, RECOVERING, RECOVERY_PENDING, SUSPECT, EMERGENCY, OFFLINE, COPYING, OFFLINE_SECONDARY.
TargetRecoveryTimeintSee the Database Properties TechNet article.
TransformNoiseWordsbitSee the Database Properties TechNet article.
TrustworthybitSee the Database Properties TechNet article.
TwoDigitYearCutoffsmallintSee the Database Properties TechNet article.
ReplicationOptionsintReplication options. Defined as a summation of any of these three options:
1 = published
2 = subscribed
4 = merge published
IsQueryStoreOnbitDenotes whether query store is enabled for this database.
IsRemoteDataArchiveEnabledbitDenotes whether the database is a stretch database.
IsMixedPageAllocationOnbitDenotes whether tables and indexes in the database can allocate initial pages from mixed extents.

dbo.DatabaseList

Stores the “master list” of databases. This table is populated, updated, and used by the “New/Retired Database Alert”.

 

ColumnTypeDescription
IDbigintPrimary key row identifier.
InstanceIDbigintThe instance ID of the instance in question, as defined in the table dbo.Servers.
DBNamevarcharDatabase name.
IsSnapshotbitWhether the DB is a snapshot of another DB.
DatabaseSnapshotBaseName
nvarcharThe DB the snapshot is based on.

 

Views

Collector.DBPropertiesCurrent

Provides the most recent collection of database property data.


Each “Current” view associated with a Collector table contains all (or nearly all) of the columns from the base table, plus a “ViewDesc” description column, and columns from dbo.Servers data:

  • ServerName
  • ServiceLevel
  • Version
  • Edition
  • Descr

Collector.DBPropertiesPrevious

Provides the next-to-most recent collection of database property data.

Each “Previous” view associated with a Collector table contains all (or nearly all) of the columns from the base table, plus a “ViewDesc” description column, and columns from dbo.Servers data:

  • ServerName
  • ServiceLevel
  • Version
  • Edition
  • Descr

Stored procedures

Alert.DbsNewRetired

This procedure alerts and reports on databases that have appeared or disappeared (as compred to the previous collection). Alert.DbsNewRetired updates the dbo.DatabaseList table with new and

By default, this alert is scheduled for Gold and Silver servers.

 

ColumnTypeDescription
@EmailProfilevarcharThe name of the database mail profile, to be used for emailing the report.
@ServicelevelvarcharA simple label for the level of the server’s importance, which determines the level of service that Minion Enterprise provides.
 
Valid values: Gold, Silver, Bronze.

 

Report.DBNamesLatestGet

Returns a list of all database names from the current collection, for a given InstanceID.

This may be used as needed, and as a way to populate database drop-down menus in SSRS reports.

 

ColumnTypeDescription
@InstanceIDintThe instance ID of the instance in question, as defined in the table dbo.Servers.

 

Example execution:

DECLARE @ID INT;
 
SELECT  @ID = InstanceID
FROM    dbo.Servers
WHERE   ServerName = 'Server1';
 
EXEC Minion.Report.DBNamesLatestGet @InstanceID = @ID;

 

Jobs

CollectorDBPropertiesGet-GOLD

Calls the executable DBPropertiesGET.exe for all servers with ServiceLevel = ‘Gold’, to retrieve database property information.

 

CollectorDBPropertiesGet-SILVER

Calls the executable DBPropertiesGET.exe for all servers with ServiceLevel = ‘Silver’, to retrieve database property information.

 

CollectorDBPropertiesGet-BRONZE

Calls the executable DBPropertiesGET.exe for all servers with ServiceLevel = ‘Bronze’, to retrieve database property information.

 

AlertDBsNewRetired-GOLD

Calls the stored procedure Alert.DbsNewRetired to alert on new and retired databases (as compared to the previous collection), for all servers with ServiceLevel = ‘Gold’.

 

AlertDBsNewRetired-SILVER

 Calls the stored procedure Alert.DbsNewRetired to alert on new and retired databases (as compared to the previous collection), for all servers with ServiceLevel = ‘Silver’.

 

Executables

DBPropertiesGET.exe

Perform the database property data collection for the servers in the specified service level. Log the results to Collector.DBProperties via bulk insert.

Input parameters:

  • $Query – This parameter refers to the service level that the collector should operate on. Examples: Gold, Silver, Bronze. For more information on this topic, see the article “Executables and Service Levels”.

Example execution:

C:\MinionByMidnightDBA\Collector\DBPropertiesGET.exe Gold

 

New/Retired Databases Alert

The Database Properties module provides for a unique bit of functionality: an alert on new databases, and on retired (deleted) databases.

The stored procedure (Alert.DBsNewRetired) that comprises the alert maintains a master database list in dbo.DatabaseList.  This table does nothing but hold the InstanceID and DBName.  The alert can then compare the last run of the Databases collection (in Collector.DBProperties) with the dbo.DatabaseList table.  It then sends a report based on its findings.

IMPORTANT: The first run of this alert may be quite large, because there are no rows in the DatabaseList table.  So this alert should insert all of those rows for you.  From then on, it will maintain the list and any alerts you receive will be much more reasonable.

There is nothing for you to do when you get this alert.  It is merely informational so you’ll know when databases come and go from your systems.

 
https://minionware.desk.com/customer/portal/articles/2378828-database-properties-module
http://www.MinionWare.net