17. SQL Server Metadata

Catalogue views are in SYS schema.

INFORMATION_SCHEMA based on ISO standards.

DMV - Dynamic Management Views and functions

Prefix Description
dm_ Dynamic management
dm_os_ Operating system
dm_db_ Database
dm_io_ I/O
dm_exec_ Execution

DB_ID(), OBJECT_ID(), DATALENGTH()

Server-Level and Instance-Level Metadata

sys.dm_server_registry
  registry_key
  value_name
  value_data

Can find find listener port from registry also startup parameters, SQLArg%.

sys.dm_server_sources
sys.dm_os_buffer_descriptors
sys.dm_db_file_space_usage
sys.dm_io_virtual_file_stats
sys.master_files
xp_fixeddrives

Use of xp_cmdshell is against security best practice.

Metadata for Troubleshooting and Performance Tuning

sys.dm_os_performance_counters

sys.dm_os_wait_stats

Database Metadata

Metadata-Driven Automation