managing and monitoring sql server 2005
TRANSCRIPT
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 1/34
Managing andMonitoring SQL Server
2005København d. 22. november 2005København d. 22. november 2005
Thomas Skytte Damø Thomas Skytte DamøSenior Technology SpecialistSenior Technology [email protected]@microsoft.com
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 2/34
You Can Be More You Can Be More
ProductiveProductive Managing and AdministeringManaging and Administering Maintaining Security/OperationalMaintaining Security/Operational
PoliciesPolicies
Monitoring and TroubleshootingMonitoring and Troubleshooting Performance TuningPerformance Tuning Automating The WorkAutomating The Work By Just UpgradingBy Just Upgrading
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 3/34
Take Advantage When? Take Advantage When?How much work to leverage theHow much work to leverage the
technology?technology? DDL TriggersDDL Triggers
Auditing and PreventionAuditing and Prevention SQL Server AgentSQL Server Agent
New Automation/AlertingNew Automation/Alerting MicrosoftMicrosoft
OperationsOperationsManager (MOM)Manager (MOM)SQL Server ManagementSQL Server ManagementPackPack
DatabaseDatabaseMaintenanceMaintenancePlansPlans
Database MailDatabase Mail
UpgradeImmediate
Minimal Work toLeverage
Design andArchitect
Improving Manageability from Design to Installation to New
Features/Extensions Centralized Monitoring to allow a cohesive picture of what’s going
SQL ServerSQL ServerManagementManagementStudioStudio
Unified Error Viewer/Unified Error Viewer/Reports/ Monitoring/Reports/ Monitoring/Server DashboardServer Dashboard
PerformancePerformanceMonitorMonitorIntegrationIntegration
SQL ServerSQL ServerProfilerProfiler
Database EngineDatabase EngineTuning AdvisorTuning Advisor
SQLCMDSQLCMD
SystemSystem
InformationInformationCatalo Views and DMVsCatalo Views and DMVs
VSTS 2005VSTS 2005Code Analysis andCode Analysis andModelingModeling
Event NotificationsEvent Notifications Auditing and ReactionAuditing and ReactionEventsEvents
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 4/34
Managing andManaging andAdministeringAdministering
SQL Server Management StudioSQL Server Management Studio
Dynamic Management ViewsDynamic Management Views
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 5/34
Integrated management anddevelopment environment
Based on Visual Studio .NETIntegrates Functionality of:
Enterprise Manager Query Analyzer Analysis Manager
Used to manage: Relational databases Analysis Services Reporting Services SQL Server Mobile
databasesIncludes scripting tools for:
Transact-SQL/SQLCMD XMLA/MDX/DMX
Provides graphical reports
Management StudioManagement Studio
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 6/34
A Tour of SQL Server
Management Studio
Thomas Skytte Damø Thomas Skytte DamøSenior Technology SpecialistSenior Technology SpecialistMicrosoft DanmarkMicrosoft Danmark
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 7/34
Dynamic ManagementDynamic Management
ViewsViews Views built on top of internalViews built on top of internal
structuresstructures Ideal for tracking performanceIdeal for tracking performance
dm_repl_*Replication
dm_broker_*SQL Service Broker
dm_fts_*
Full Text Searchdm_qn_*
Query Notifications
dm_clr_*Common Language
Runtime
dm_exec_*Execution of user code andassociated connections
dm_os_*Memory, locking &scheduling
dm_tran_* Transactions & isolation
dm_io_*I/O on network and disks
dm_db_*Databases and database
Component LevelServer Level
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 8/34
DM_ Object Interface
SQL Server RelationalSQL Server RelationalEngineEngine
OperationalOperationalMemoryMemory
StructuresStructures
AggregateAggregateStatisticalStatistical
DataData
DMVsDMVsandand
DMFsDMFs
Resource DBResource DB (visible as
“sys” schema)
SPs, Views,SPs, Views, Tables, etc. Tables, etc.User DBUser DB
MonitoringMonitoringoror
DiagnosticDiagnosticApplicationApplication
SomeSome
existed, yet existed, yet
not exposed not exposed
New and exposed New and exposed
in SQL Server in SQL Server
20052005
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 9/34
How DMVs ImproveHow DMVs Improve
AccessAccess SQL Server 2000:SQL Server 2000: DBCCDBCC
SHOWCONTIGSHOWCONTIG Not tabular by defaultNot tabular by default
Difficult to programmatically analyzeDifficult to programmatically analyze Pre-create temp table, complete definition with dataPre-create temp table, complete definition with datatypestypes
Must use dynamic string execution to execute resultsMust use dynamic string execution to execute resultsinto temp tableinto temp table
SQL Server 2005:SQL Server 2005:sys.dm_db_index_physical_stats(parasys.dm_db_index_physical_stats(params)ms)
Table-valued function returns tabular set Table-valued function returns tabular set
EASY to ro rammaticall anal zeEASY to ro rammaticall anal ze
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 10/34
How DMVs ImproveHow DMVs Improve
ManagementManagement Index-related DMVsIndex-related DMVs
sys.dm_db_index_physical_statssys.dm_db_index_physical_stats Size and fragmentation information for tablesSize and fragmentation information for tables
and indexesand indexes sys.dm_db_index_operational_statssys.dm_db_index_operational_stats Internals information for table and indexInternals information for table and index
activitiesactivities
sys.dm_db_index_usage_statssys.dm_db_index_usage_stats Index statistics and usage counts informationIndex statistics and usage counts information
for individual indexesfor individual indexes
sys.dm_db_index_partition_statssys.dm_db_index_partition_stats --
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 11/34
Maintaining SecurityMaintaining Securityand Operational Policiesand Operational Policies
SQL Server Surface AreaSQL Server Surface AreaConfigurationConfiguration
Auditing and Change Control Auditing and Change Control
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 12/34
Protect Your ServerProtect Your ServerSQL Server Surface Area ConfigurationSQL Server Surface Area Configuration
Configuration for Servicesand Connections Service Settings Remote Connections
SQL Server Agent Reporting Services Integration Services SQL Server Browser
Configuration for Features sp_configure settings
Catalog Table queries Database Mail xp_cmdshell
CLR Integration
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 13/34
SQL Server Surface Area
Configuration
Thomas Skytte Damø Thomas Skytte DamøSenior Technology SpecialistSenior Technology SpecialistMicrosoft DanmarkMicrosoft Danmark
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 14/34
Auditing and Change ControlAuditing and Change ControlControlling and Monitoring ChangeControlling and Monitoring Change
DDL Triggers – targetingDDL Triggers – targetingSpecific Commands:Specific Commands: DROP_TABLEDROP_TABLE
Groups:Groups: DDL_PROCEDURE_EVENTSDDL_PROCEDURE_EVENTS
CREATE PROCEDURECREATE PROCEDURE ALTER PROCEDUREALTER PROCEDURE DROP PROCEDUREDROP PROCEDURE
Event Notifications and WMI Events –Event Notifications and WMI Events –
target all of the above, plus:target all of the above, plus:Specific Trace Events:Specific Trace Events:
DATA_FILE_AUTO_GROWDATA_FILE_AUTO_GROW
Trace Groups: Trace Groups: TRC_STORED_PROCEDURES TRC_STORED_PROCEDURES
SP_RECOMPILESP_RECOMPILE SP_CACHEMISSSP_CACHEMISS
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 15/34
DDL Triggers
Thomas Skytte Damø Thomas Skytte DamøSenior Technology SpecialistSenior Technology SpecialistMicrosoft DanmarkMicrosoft Danmark
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 16/34
Monitoring andMonitoring and Troubleshooting Troubleshooting
SQL Server Profiler SQL Server Profiler
System Monitor IntegrationSystem Monitor Integration
Microsoft Operations Manager Microsoft Operations Manager
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 17/34
MonitoringMonitoringA Unified ApproachA Unified Approach
Supports multipleSupports multiplelogslogs SQL ServerSQL Server
Database EngineDatabase EngineInformationInformation
SQL Server AgentSQL Server AgentInformationInformation
Windows EventWindows Event
Viewer ApplicationViewer ApplicationLogLog
Database Mail LogsDatabase Mail Logs
Across all logs,Across all logs,allows:allows: SearchingSearching
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 18/34
Analyze the SQL Server
Database Engine andAnalysis Services
Significantly easier to setup(Events, Data Columns and
Filter dialogs combined)Special Events: Service
Broker, Notification Services,etc…
Special Event types:Showplan XML and DeadlockGraph – can be saved to files
Supports pause and modify
Can Profile SQL Server 2000
and 2005
SQL Server ProfilerSQL Server Profiler
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 19/34
System Monitor IntegrationSystem Monitor IntegrationPerformance Counter LogsPerformance Counter Logs Create a Profiler TraceCreate a Profiler Trace Create a PerformanceCreate a Performance
Monitor LogMonitor Log Open Trace (completeOpen Trace (complete
load), Use File – Importload), Use File – ImportPerformance Data, SelectPerformance Data, SelectObjects/Counters…Objects/Counters…
Works solely based onWorks solely based ontime – make sure the twotime – make sure the two
clients (if different) areclients (if different) aretime correlatedtime correlated Can select in either dataCan select in either data
set and indicatorsset and indicatorscorrelatecorrelate
Works with SQL ServerWorks with SQL Server2000 and SQL Server2000 and SQL Server
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 20/34
A Tour of SQL Server
Profiler
Thomas Skytte Damø Thomas Skytte DamøSenior Technology SpecialistSenior Technology SpecialistMicrosoft DanmarkMicrosoft Danmark
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 21/34
Use SQL Server Management Pack toUse SQL Server Management Pack toLower Operational Costs and IncreaseLower Operational Costs and IncreaseAvailabilityAvailability Operate from a central consoleOperate from a central console
Manage large SQL ServerManage large SQL Serverdeploymentsdeployments Detect problems proactivelyDetect problems proactively Understand problem detailsUnderstand problem details Fix the problems by launchingFix the problems by launching
taskstasks Trend history of performance Trend history of performance
counterscounters
Generate ReportsGenerate Reports Plan for capacityPlan for capacity
Microsoft Operations Manager to shipMicrosoft Operations Manager to ship
Microsoft Operations ManagerMicrosoft Operations ManagerMonitoring the EnterpriseMonitoring the Enterprise
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 22/34
Performance TuningPerformance Tuning
Database Engine Tuning Advisor Database Engine Tuning Advisor
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 23/34
PartitioningPartitioningrecommendationsrecommendations
Time-bound tuning Time-bound tuningIndexes with IncludedIndexes with Included
columnscolumnsXML Input/OutputXML Input/OutputDrop ONLY modeDrop ONLY modeParameterized commandParameterized command
line executionline executionImport previously savedImport previously savedSession Definition (XMLSession Definition (XMLformat)format)
Workload optionsWorkload options
Can be a *.trc, *.sql or *.xmlCan be a *.trc, *.sql or *.xmlformatformat
Database Engine TuningDatabase Engine TuningAdvisorAdvisor
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 24/34
Database Tuning Advisor
Thomas Skytte Damø Thomas Skytte DamøSenior Technology SpecialistSenior Technology SpecialistMicrosoft DanmarkMicrosoft Danmark
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 25/34
Automation and UpgradeAutomation and Upgrade
SQL Server Agent SQL Server Agent
Database Maintenance PlansDatabase Maintenance Plans
Database MailDatabase Mail SQLCMDSQLCMD
Upgrade Advisor Upgrade Advisor
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 26/34
SQL Server AgentSQL Server AgentFrom Proactive to ReactiveFrom Proactive to Reactive
Alerts can be triggered by:Alerts can be triggered by: SQL Server errorsSQL Server errors Performance monitorPerformance monitor
thresholdsthresholds
WMI eventsWMI eventsSQL Agent can use DatabaseSQL Agent can use Database
MailMailProxy AccountsProxy Accounts
Each proxy account isEach proxy account isassociated with a SQL Serverassociated with a SQL ServerCredentialCredential
Proxy account can be grantedProxy account can be grantedto database user, databaseto database user, databaserole, and fixed server rolerole, and fixed server role
Proxy account can beProxy account can be
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 27/34
Based on SQL ServerIntegration Services
Flexible Wizard basedInterface
Options to create crossdatabase plans
Backup all users
databases will pick upnewly added databases –even after the plan iscreated
Database MaintenanceDatabase MaintenancePlansPlans
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 28/34
Uses SMTP – No Microsoft
Outlook dependency!Mail calls made outside SQL
Server process
Cluster support
64-bit supportSMTP account failover
No SQLCLR dependency
Asynchronous and queuedarchitecture
Leverages SQL ServerService Broker for queuing
Multiple SMTP accounts
Logging
Database MailDatabase Mail
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 29/34
SQLCMDSQLCMDCommand-line automation andCommand-line automation and
scriptingscripting Replaces OSQLReplaces OSQL Supports ConnectionsSupports Connections
to multiple serversto multiple servers(master scripts)(master scripts)
Allows ParameterAllows Parametersubstitutionsubstitution Variables defined inVariables defined in
scriptscript
Variables passed inVariables passed in Environment variablesEnvironment variables
Better Control onBetter Control onErrorError
Initialization ScriptsInitialization Scripts
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 30/34
Checks schema forChecks schema forbest practices andbest practices andcompatibilitycompatibility
Upgrade AdvisorUpgrade Advisoron microsoft.comon microsoft.com
SQL Server 2005SQL Server 2005Upgrade Handbook Upgrade Handbook SQL Server 2005SQL Server 2005EditionsEditionshttp://www.microsoft.com/sql/2005/productinfo/sql2005featuhttp://www.microsoft.com/sql/2005/productinfo/sql2005featu
Upgrade AdvisorUpgrade AdvisorGet Ready!Get Ready!
Wh U d ?Wh U d ?
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 31/34
Why Upgrade?Why Upgrade?Database EngineDatabase Engine
Service BrokerService BrokerHTTP AccessHTTP AccessDatabase Tuning AdvisorDatabase Tuning AdvisorEnhanced Read ahead & scanEnhanced Read ahead & scan
IndexesIndexes with Includedwith IncludedColumnsColumnsMultiple Active Result SetsMultiple Active Result SetsPersisted Computed ColumnsPersisted Computed Columns Try/Catch in T-SQL statements Try/Catch in T-SQL statementsCommon Table ExpressionsCommon Table ExpressionsServer EventsServer EventsSnapshot Isolation LevelSnapshot Isolation LevelPartitioningPartitioningSynonymsSynonymsDynamic Management ViewsDynamic Management Views
.NET Framework .NET Framework Common Language Runtime IntegrationCommon Language Runtime IntegrationCLR-basedCLR-based Types, Functions, & TriggersFunctions, & TriggersSQL Server .NET Data ProviderSQL Server .NET Data Provider
Data TypesData TypesCLR-based Data TypesCLR-based Data TypesVARCHAR(MAX), VARBINARY(MAX)VARCHAR(MAX), VARBINARY(MAX)XML DatatypeXML Datatype
Database Failure and RedundancyDatabase Failure and RedundancyFail-over Clustering (up to 8 node)Fail-over Clustering (up to 8 node)Database MirroringDatabase MirroringDatabase SnapshotsDatabase SnapshotsEnhanced Multi-instance SupportEnhanced Multi-instance Support
XMLXMLNew XML data typeNew XML data typeXML IndexesXML IndexesXQUERY SupportXQUERY SupportXML Schema (XSD) supportXML Schema (XSD) supportFOR XML PATHFOR XML PATHXML Data Manipulation LanguageXML Data Manipulation Language
Database MaintenanceDatabase MaintenanceBackup and Restore EnhancementsBackup and Restore EnhancementsChecksum Integrity ChecksChecksum Integrity ChecksDedicated Administrator ConnectionDedicated Administrator ConnectionDynamic Configuration AWEDynamic Configuration AWE
Highly-available UpgradeHighly-available UpgradeOnline Index OperationsOnline Index OperationsOnline RestoreOnline Restore
Management ToolsManagement ToolsMDX & XML/A Query EditorMDX & XML/A Query EditorMaintenance Plan DesignerMaintenance Plan DesignerSource Control SupportSource Control SupportProfiler access to non-saProfiler access to non-saSQLCMD Command Line ToolSQLCMD Command Line ToolDatabase MailDatabase Mail
Performance TuningPerformance Tuning Profiling Analysis ServicesProfiling Analysis ServicesExportable Showplan & DeadlocksExportable Showplan & DeadlocksProfiler EnhancementsProfiler EnhancementsNew Trace EventsNew Trace Events
Full-text SearchFull-text SearchBackup/Restore includes FTBackup/Restore includes FT
catalogscatalogsMulti-instance serviceMulti-instance service
SQL Client .NET Data ProviderSQL Client .NET Data ProviderServer Cursor SupportServer Cursor SupportMultiple Active Result SetsMultiple Active Result Sets
SecuritySecurityCatalog and meta-data securityCatalog and meta-data securityPassword policy enforcementPassword policy enforcementFine Grain Administration RightsFine Grain Administration RightsSeparation of Users and SchemaSeparation of Users and SchemaSurface Area ConfigurationSurface Area Configuration
Notification ServicesNotification Services
Embed NS in existing applicationEmbed NS in existing applicationUser-defined match logicUser-defined match logic
ReplicationReplicationSeamless DDL replicationSeamless DDL replicationMerge Web SyncMerge Web SyncOracle PublicationOracle PublicationPeer to Peer TransactionalPeer to Peer Transactional
replicationreplicationMerge replication perf and scalabilityMerge replication perf and scalabilityNew monitor and improved UINew monitor and improved UI
Analysis Services and Data MiningAnalysis Services and Data MiningAnalysis Management ObjectsAnalysis Management ObjectsWindows Integrated Backup andWindows Integrated Backup and
RestoreRestoreWeb Service/XML for AnalysisWeb Service/XML for AnalysisIntegration Services and DMIntegration Services and DM
IntegrationIntegrationEight new Data Mining algorithmsEight new Data Mining algorithmsAuto Packaging and DeploymentAuto Packaging and DeploymentMigration WizardMigration Wizard
Integration ServicesIntegration ServicesNew high performance architectureNew high performance architectureVisual design and debuggingVisual design and debugging
environmentenvironmentExtensible with custom code andExtensible with custom code and
scriptsscriptsXML task and data sourceXML task and data source
SAP connectivitySAP connectivityIntegrated data cleansing & textIntegrated data cleansing & text
miningminingSlowly changing dimension wizardSlowly changing dimension wizardImproved flow controlImproved flow controlIntegration with other BI productsIntegration with other BI products
Reporting ServicesReporting ServicesReport BuilderReport BuilderAnalysis Services Query DesignerAnalysis Services Query DesignerEnhanced Expression EditorEnhanced Expression EditorMulti-valued ParametersMulti-valued ParametersDate PickerDate Picker
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 32/34
Hvad siger kunderne omHvad siger kunderne omde nye managementde nye management
tools?tools? Politiets DNA databasePolitiets DNA database
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 33/34
Politiets DNA database
udvikles og administreres af COM-IT Applications A/SImplementerede SQL Server
2005 på Beta2, kører ren 64bit platform (Windows 2003
& SQL 2005 64 bit edition)COM-ITs udviklere har haftflg. fordele ved anvendelsenaf de nye managementtools: Eet integreret produkt Direkte CLR integration Endnu bedre styring af
sikkerhed i SQL Server 2005
Politiets DNA databasePolitiets DNA database
8/14/2019 Managing and Monitoring SQL Server 2005
http://slidepdf.com/reader/full/managing-and-monitoring-sql-server-2005 34/34
© 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.