Introduction to SQL Server Management for the Non-DBA

Slides:



Advertisements
Similar presentations
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Advertisements

© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Reprint Outstanding Transactions Report © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
MIX 09 4/15/ :14 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Feature: Payroll and HR Enhancements © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
Denny Cherry
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Windows 7 Training Microsoft Confidential. Windows ® 7 Compatibility Version Checking.
Session 1.
Built by Developers for Developers…. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Denny Cherry
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
demo Instance AInstance B Read “7” Write “8”

customer.
demo © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
demo Demo.
Feature: Void Historical/Open Transaction Updates © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
demo QueryForeign KeyInstance /sm:body()/x:Order/x:Delivery/y:TrackingId1Z
projekt202 © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks.
Denny Cherry
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.

Database Administration for the Non-DBA Denny Cherry twitter.com/mrdenny.
MIX 09 4/17/2018 4:41 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
6/16/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
6/19/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
8/8/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
Возможности Excel 2010, о которых следует знать
Database Administration for the Non-DBA
Title of Presentation 11/22/2018 3:34 PM
11/22/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
TechEd /24/2018 8:21 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
Jason Zander Unplugged
Title of Presentation 12/2/2018 3:48 PM
1/3/2019 1:21 PM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
TechEd /18/2019 2:43 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Optimizing SQL Server Performance in a Virtual Environment
TechEd /23/2019 7:16 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Building SaaS Solutions on Windows Azure
TechEd /28/2019 7:27 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Pushing Data to and from the Cloud with SQL Azure Data Sync
2/28/2019 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
8/04/2019 9:13 PM © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
4/27/17, Bell #8 What amount of net pay has been earned this period?
TechEd /11/ :25 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
Виктор Хаджийски Катедра “Металургия на желязото и металолеене”
TechEd /28/2019 7:58 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
PENSACOLA ENERGY WORK PLAN OCTOBER 10, 2016
Title of Presentation 5/12/ :53 PM
Шитманов Дархан Қаражанұлы Тарих пәнінің
Lap Around the Windows Azure Platform
Title of Presentation 5/24/2019 1:26 PM
5/24/2019 6:44 PM 1/8/18 Bell #10 In a world governed by the gods, is there any room for human will? Do human choices make a difference? EXPLAIN © 2007.
6/5/2019 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
7/5/2019 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
日本初公開!? Vista の新機能を実演 とっちゃん わんくま同盟 7/23/2019 9:09 AM
Title of Presentation 7/24/2019 8:53 PM
TechEd /5/2019 2:08 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
What’s New in Visual Studio 2012 for Web Developers
Presentation transcript:

Introduction to SQL Server Management for the Non-DBA 9/14/2018 DBI-B214 Introduction to SQL Server Management for the Non-DBA Denny Cherry mrdenny@dcac.co twitter.com/mrdenny © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

mrdenny@dcac.co www.dcac.co Denny Cherry @mrdenny

Agenda Files, File Groups, Disks Backups Recovery Model Database Maintenance Compression Corruption Compatibility Level Indexes

Files, File Groups, Disks Each database is made up of at least two files One file is data One file is transaction log http://www.flickr.com/photos/photomequickbooth/4011249096/

Files, File Groups, Disks File Groups are made up of files Files hold the data Disks Hold Files http://www.flickr.com/photos/photomequickbooth/4011249096/

Files, File Groups, Disks Tables created within file groups Allows tables to be spread across disks File groups typically only need one 1 file https://www.flickr.com/photos/andrewnebbett/5356889496/

TempDB Database Single file group 4-8 files for most instances More if using lots of temporary tables, pivoting https://www.flickr.com/photos/rachaelvoorhees/4988206451/

Recovery Models Three Recovery Models Available Simple Bulk-Logged Full Used to control amount of logging Controls recoverability http://www.flickr.com/photos/decade_null/142235888/

Simple Recovery Model Minimal Logging No Point In Time Recovery Does Not Disable Logging http://www.flickr.com/photos/noii/1337970464/

Bulk Logged Recovery Model Some commands are bulk logged Most commands are fully logged Point In Time Recovery Supported http://www.flickr.com/photos/4nitsirk/3778043845/

Full Recovery Almost nothing is bulk logged Point in time recovery is supported Full Data Protection http://www.flickr.com/photos/dok1/5623000758/

Backups 3 Different Kinds of Backups Advanced Backup Options Full Backups Differential Backups Transaction Log Backups Advanced Backup Options File Group Backups Backups Saved On Another Machine http://www.flickr.com/photos/gemstone/406866312/

Full Backups Makes a point in time copy of the database Database is in the state the database was at the end of the backup Should be done daily or weekly

Differential Backups Backs up changes since last full backup Usually used for reporting databases Optional database backup type

Transaction Log Backups Backs up transactions since last log backup Frequency should be dictated by business need (RPO) Required for full or bulk logged recovery model

Restoring Data Full Restore Differential Restore Transaction Log Restore Page Level Restore File Group Restore http://www.flickr.com/photos/fun_flying/2959307155/

Database Maintenance Databases need TLC Index Rebuilding Index Defragmenting Update Statistics http://www.flickr.com/photos/wjlonien/6309343565/

Database Maintenance Index Defrag Index Rebuild Can be online or offline depending on version, edition and column data types Creates new indexes then drops old index Updates Statistics on index Always Online Moves data around pages row by row Only moves rows that need to be moved http://www.flickr.com/photos/usnavy/5488581781/

Statistics? How SQL Server figures out how to access data Statistics are used to create an execution plan Statistics are a sampling of the values within a table or index Statistics contain up to 200 samples of the values within the table Statistics track the number of values between sampled values http://www.flickr.com/photos/franganillo/3676227162/

Statistics?

Compression Saves space within: Costs CPU speed, but usually worth it The database Memory Backups Costs CPU speed, but usually worth it Data Compression is Page or Row Backup Compression is an on or off http://www.flickr.com/photos/aussiegall/316350537/

Corruption All databases can become corrupt Corruption is usually a hardware problem Corruption should be checked for regularly Depending on what is corrupt it may be repaired without data loss Corruption is checked for and repaired using DBCC CHECKDB Corruption will happen, how you prepare for it will determine how easily you can survive it Some corruption can’t be repaired and must be restored from a backup

Compatibility Level Compatibility levels tell SQL Server which language syntax to support Does not effect the version of the SQL Server the database can be restored to SQL Supports several down level compatibility levels. SQL 2012 supports SQL 2005 and up SQL 2008 R2 and below support SQL 6.5 and up

Indexes Used to speed up queries Sorted based on the columns within the index Causes duplicate data to be stored Trades space for speed Indexes are ½ art and ½ science http://www.flickr.com/photos/annarbor/4350627292/

Indexes Clustered Nonclustered Full Text Spatial ColumnStore XML Semantic Search http://www.flickr.com/photos/tryingyouth/2456237/

Indexes

Indexes

Indexes Indexes aren’t free Every index added slows down INSERT/UPDATE/DELETE operations Only create indexes where the cost of having the index is worth it Unused indexes can be removed from the database

Additional Reading… http://dcac.co/res/teched2014

Track resources Try out Power BI for Office 365! 9/14/2018 9:26 PM Track resources Download Microsoft SQL Server 2014 http://www.trySQLSever.com Try out Power BI for Office 365! http://www.powerbi.com Sign up for Microsoft HDInsight today! http://microsoft.com/bigdata © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Resources Learning TechNet msdn http://channel9.msdn.com/Events/TechEd 9/14/2018 Resources Sessions on Demand http://channel9.msdn.com/Events/TechEd Learning Microsoft Certification & Training Resources www.microsoft.com/learning TechNet Resources for IT Professionals http://microsoft.com/technet msdn Resources for Developers http://microsoft.com/msdn © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Complete an evaluation and enter to win! 9/14/2018 Complete an evaluation and enter to win! © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Evaluate this session Scan this QR code to evaluate this session. 9/14/2018 Evaluate this session Scan this QR code to evaluate this session. © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Denny Cherry mrdenny@dcac.co http://www.dcac.co 9/14/2018 DBI-B214 Denny Cherry mrdenny@dcac.co http://www.dcac.co http://www.twitter.com/mrdenny © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

9/14/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.