SQL Server 2017 sys.dm_db_log_info

There is a new DMF called sys.dm_db_log_info which takes a single int parameter called @DatabaseId.
 
Below shows the output compared to the older DBCC LOGINFO and it makes vlf info a lot easier to review.

--old way
DBCC LOGINFO;

--SQL Server 2017
SELECT * FROM sys.dm_db_log_info(DB_ID(DB_NAME()));

image1
Below is an example of viewing multiple database vlf counts.

SELECT a.[name] AS [database_name], COUNT(b.database_id) AS vlfs 
FROM sys.databases a
CROSS APPLY sys.dm_db_log_info(a.database_id) b
GROUP BY a.[name];

image
Futher info can be found here.

SQL Server 2017 modified_extent_page_count

Below shows an example of the new modified_extent_page_count column from the sys.dm_db_file_space_usage DMV in action. This will be really handy for large databases and deciding when to (or not) take differential backups.
 
As indicated, it only starts working after a Full backup, which makes sense :)
 
I’ve used SUM for the percentage example as sys.dm_db_file_space_usage reports on a file basis.

SET NOCOUNT ON;
--create database
CREATE DATABASE d1;
GO
--create table
USE d1;
CREATE TABLE t1 (c1 int, c2 varchar(10));
--insert some data
INSERT INTO t1 (c1,c2) VALUES (1,'one'),(2,'two'),(3,'three');
--look at modified_extent_page_count 
SELECT DB_NAME(database_id) AS db, modified_extent_page_count FROM sys.dm_db_file_space_usage;
--insert some more data
INSERT INTO t1 (c1,c2) VALUES (4,'four'),(5,'five'),(6,'six');
--look at modified_extent_page_count 
SELECT DB_NAME(database_id) AS db, modified_extent_page_count FROM sys.dm_db_file_space_usage;
-- backup database
BACKUP DATABASE d1 TO DISK = 'NUL';
--insert some more data
INSERT INTO t1 (c1,c2) VALUES (7,'seven'),(8,'eight');
--look at modified_extent_page_count 
SELECT DB_NAME(database_id) AS db, modified_extent_page_count FROM sys.dm_db_file_space_usage;
--to get percentage change 
SELECT
 DB_NAME(database_id) AS db
,SUM(modified_extent_page_count) AS modified_extent_page_count
,CAST((SUM(modified_extent_page_count) * 100.0/SUM(allocated_extent_page_count)) AS decimal(10,2)) AS '% change'
FROM sys.dm_db_file_space_usage GROUP BY database_id;

image1

SQL Server 2017 sys.dm_os_enumerate_fixed_drives

Now there is another way to identify free disk space in SQL Server 2017.

SELECT * FROM sys.dm_os_enumerate_fixed_drives;

image
What I don’t understand is why Microsoft doesn’t include the capacity of the drive. Not including the drive capacity requires the DBA to perform additional computations to extract the information.

CLR strict security

There is a new configuration option in SQL Server 2017 called CLR strict security and it is enabled by default.

Essentially when enabled, it treats SAFE and EXTERNAL_ACCESS assemblies as if they were marked UNSAFE and any assemblies that are not signed will fail to load.

Microsoft recommends that all assemblies be signed by a certificate or asymmetric key with a corresponding login that has been granted UNSAFE ASSEMBLY permission in the master database.

-- to disable
EXEC sys.sp_configure N'show advanced options', N'1';
RECONFIGURE WITH OVERRIDE;
EXEC sys.sp_configure N'clr strict security', N'0';
RECONFIGURE WITH OVERRIDE;
EXEC sys.sp_configure N'show advanced options', N'0';
RECONFIGURE WITH OVERRIDE;
GO

-- to re-enable
EXEC sys.sp_configure N'show advanced options', N'1';
RECONFIGURE WITH OVERRIDE;
EXEC sys.sp_configure N'clr strict security', N'1';
RECONFIGURE WITH OVERRIDE;
EXEC sys.sp_configure N'show advanced options', N'0';
RECONFIGURE WITH OVERRIDE;
GO

Further information can be found here.

Quick look at resumable indexing in SQL Server 2017 CTP2.0

Allow for index to be paused:
ALTER INDEX NCI_c1 on t1 REBUILD WITH (ONLINE=ON, MAXDOP=1, RESUMABLE=ON);
 
View current state using:
SELECT * FROM sys.index_resumable_operations;
image1
Pause the index operation:
ALTER INDEX NCI_c1 on t1 PAUSE;
 
The state_desc now shows PAUSED:
SELECT * FROM sys.index_resumable_operations;
image2
To resume the index operation:
ALTER INDEX NCI_c1 on t1 RESUME;
 
To abort the index operation:
ALTER INDEX NCI_c1 on t1 ABORT;
 
Full command syntax and restrictions can now be found here

SQL Server vNext = SQL Server 2017

Yes SQL Server vNext officially has the name SQL Server 2017.
 
CTP 2.0 is now available to download and further details on the announcement can be found here
 
Self tuning databases? Sounds interesting or possibly a cause for concern. Hopefully these features have an off switch in case SQL starts optimizing in the wrong direction :)
 
“New in SQL Server 2017, we’re adding the Adaptive Query Processing family of intelligent database features. These features automatically keep database queries running as efficiently as possible without requiring additional tuning from database administrators.”
 
What does surprise me is the rate of new version releases.
 
Progress is good, but SQL Server 2012 -> 2014 -> 2016 -> 2017, this really starts to raise a dilemma for businesses/developers/DBAs as to which version should they be using/developing/training for. Throw Linux and the cloud into the mix and well it just gets even more interesting.
 
Businesses like stability and these new versions can introduce risk which is exactly what businesses want to avoid.
 
To me, this release cycle has to slow down or it could end badly for all parties. Although in saying that; DBAs would become more in demand as resolving incompatibility and version issues are likely to significantly increase.