February 8, 2017 at 6:52 am
Whoops, I selected both file types so I was a surprised that I was - supposedly - wrong.
February 8, 2017 at 7:52 am
GilaMonster - Wednesday, February 8, 2017 5:10 AMThe TRUNCATEONLY option is ignored on log files, because there's no concept of shuffling data in a log file. Essentially all shrinks of a log file are TRUNCATEONLY.
The given answer is wrong.
But the question doesn't ask if TRUNCATE ONLY makes any difference. It asks if the file size is changed.
Are you saying the "Correct answer" is wrong which says "only data files" or the explanation which says "both types?"
February 8, 2017 at 8:09 am
Create Test Database
Recovery model = FULL
Insert 1,000,000 rows into a table
Physical size
test.mdf   214,208 KB
test_log.ldf   579,008 KB
Database Logical Name File Name                                                                                                                                                       Size MB        Space Used MB Free Space MB
test            test                 C:\Program Files (x86)\Microsoft SQL Server\MSSQL12.MSSQLSERVER2014\MSSQL\DATA\test.mdf        209.19              208.25            0.94
test            test_log          C:\Program Files (x86)\Microsoft SQL Server\MSSQL12.MSSQLSERVER2014\MSSQL\DATA\test_log.ldf    565.44             309.74          255.70
Truncate the log ...
DBCC SHRINKFILE (N'test_log' , 0, TRUNCATEONLY)
Physical size
test.mdf      214,208 KB
test_log.ldf     1,072 KB
Database Logical Name File Name                                                                                                                                                      Size MB Space Used MB Free Space MB
test          test                 C:\Program Files (x86)\Microsoft SQL Server\MSSQL12.MSSQLSERVER2014\MSSQL\DATA\test.mdf       209.19            208.25              0.94
test          test_log          C:\Program Files (x86)\Microsoft SQL Server\MSSQL12.MSSQLSERVER2014\MSSQL\DATA\test_log.ldf       1.05                0.37             0.68
So the log file has reduced in size
Roberts your Mothers Brother!
February 8, 2017 at 8:55 am
February 8, 2017 at 11:48 am
timwell - Wednesday, February 8, 2017 7:52 AMGilaMonster - Wednesday, February 8, 2017 5:10 AMThe TRUNCATEONLY option is ignored on log files, because there's no concept of shuffling data in a log file. Essentially all shrinks of a log file are TRUNCATEONLY.
The given answer is wrong.But the question doesn't ask if TRUNCATE ONLY makes any difference. It asks if the file size is changed.
Are you saying the "Correct answer" is wrong which says "only data files" or the explanation which says "both types?"
The given answer 'only data files' is wrong.
The truncateonly option is ignored when shrinking log files, it makes no difference to the behaviour of shrinkfile whether it's there or not.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 9, 2017 at 10:32 am
So are we going to get points awarded posthumously?
April 11, 2017 at 12:15 am
Wrong Answer. DBCC Shrinkfile applies to both data and log files. Also it changes physical log file size.
-----------------
Aditya Rathour
SQL DBA
Not Everything that is faced can be changed,
 but nothing can be changed until it is faced.
Viewing 7 posts - 16 through 22 (of 22 total)
You must be logged in to reply to this topic. Login to reply