May 19, 2014 at 3:21 am
I have a server where a database is restored nightly.
I would assume when a DB is restored, until its queried, its virtual file stats will be showing low numbers, but this is showing very high numbers.
Do Virtual File Stats follow a database to wherever its restored?
May 19, 2014 at 3:40 am
Ignore me and my laziness. I tested this and the Virtual File Stats do not follow a database after its restored.
May 19, 2014 at 3:57 am
If you have doubt and server is not production you can enable trace for the specific database and check the activities going on?
---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
May 19, 2014 at 4:16 am
The Virtual File Stats DMV, like many of the stats you get from DMVs are stored in memory, are specific to an instance and are cleared when SQL restarts.
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
May 19, 2014 at 7:39 am
free_mascot (5/19/2014)
If you have doubt and server is not production you can enable trace for the specific database and check the activities going on?
You can trace production too, surely. Just with appropriate filters in place, not using the Profiler GUI, etc.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
May 20, 2014 at 7:46 am
A database restore performs mass write operations to data and log files, so should we really expect dm_io_virtual_file_stats to be near zero after a restore?
"Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho
May 20, 2014 at 7:55 am
Yes, because the restore doesn't use the same methods as normal queries do when they're reading/writing. Restore doesn't write much at all to the tran log.
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
May 20, 2014 at 8:08 am
Grant Fritchey (5/19/2014)
free_mascot (5/19/2014)
If you have doubt and server is not production you can enable trace for the specific database and check the activities going on?You can trace production too, surely. Just with appropriate filters in place, not using the Profiler GUI, etc.
Thank you, Grant. I was just extra cautious. 🙂
---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply