• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Plany Konserwacji SQL Server dla żółtodziobów
 

Plany Konserwacji SQL Server dla żółtodziobów

on

  • 280 views

Opowiedzieć w trzydziesci minut o konserwacji SQL Server wydaje się prawie niemożliwe, ale… Gdybyśmy spróbowali pomyśleć przez chwilę o porządku, spokoju, wolnym czasie i automatyzacji? Z ...

Opowiedzieć w trzydziesci minut o konserwacji SQL Server wydaje się prawie niemożliwe, ale… Gdybyśmy spróbowali pomyśleć przez chwilę o porządku, spokoju, wolnym czasie i automatyzacji? Z jednej strony zaraportować cieżki dzień w biurze, z drugiej wciąż mieć czas na prasę – chociażby branżową. A jeśli tak naprawdę do naszego SQLa zaglądamy tylko raz dziennie, na kilka minut? Spróbujmy.

Statistics

Views

Total Views
280
Views on SlideShare
274
Embed Views
6

Actions

Likes
1
Downloads
0
Comments
0

1 Embed 6

http://www.slideee.com 6

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Plany Konserwacji SQL Server dla żółtodziobów Plany Konserwacji SQL Server dla żółtodziobów Presentation Transcript

    • Maintenance Plans for beginners @KoprowskiT
    • reklama 2 Doroczna konferencja Polskiej Grupy Użytkowników SQL Server – kilka faktów  28 kwietnia – całodzienne warsztaty  29-30 kwietnia – trzy ścieżki po pięć sesji każda  Stadion Miejski we Wrocławiu  Najlepsi prelegenci z Polski i Europy  Impreza integracyjna  Olbrzymia dawka wiedzy http://conference.plssug.org.pl/ Kariera IT Kraków | 22 Feb 2014 | KoprowskiT - Maintenance Plans for Beginners
    • Select {BIO} 3  polish sql server user group leader  microsoft certified trainer  pass sql azure virtual chapter co-founder  blogger, influencer, technical writer  over 8 years living in data center in wrocław  bout 14 years in it/banking area  trainer, auditor, consultant  speaker at many international conferences: sql server community launch, time for sharepoint, codecamps, sharepoint community launch, cissp day, sql in the city, infotrams, sql bits, sql saturday, careercon, sharepoint & sql connection, it camp,  deep dives co-author: high availability of sql server in the context of service level agreements Kariera IT Kraków | 22 Feb 2014 | KoprowskiT - Maintenance Plans for Beginners
    • ENGLISH 4 maksymalny stopień równoległości prostych opcji max degree of parallelism Zwalniane spację w plikach bazy danych Retain freed space in database files Baza danych jest zagęszczonym mleku do stron ciągłych, ale strony nie są cofniętych przydziałów, a pliki bazy danych nie zmniejszać. Użyj tej opcji, jeśli oczekujesz, że baza danych, aby rozwinąć ponownie i nie chcesz zmienić alokację przestrzeni. Po wybraniu tej opcji pliki bazy danych nie zmniejszać możliwie. Korzysta z opcji NOTRUNCATE. The database is condensed to contiguous pages but the pages are not deallocated, and the database files do not shrink. Use this option if you expect the database to expand again, and you do not want to reallocate space. With this option, the database files do not shrink as much as possible. This uses the NOTRUNCATE option. Kariera IT Kraków | 22 Feb 2014 | KoprowskiT - Maintenance Plans for Beginners
    • AGENDA 5 Maintenance Plans – what are you talking about? Maintenance Plans – how, where, when?  Methods, tools, right (?) ways What Maintenance Plans can do you You Short Demo Q&A Kariera IT Kraków | 22 Feb 2014 | KoprowskiT - Maintenance Plans for Beginners
    • 6 Maintenance Plans – what we are talking about? Kariera IT Kraków | 22 Feb 2014 | KoprowskiT - Maintenance Plans for Beginners
    • Maintenance Plans – what are you talking about? 7  Clean Environment  Silence  Knowledge about environment  Productivity / Performance DEFINITION: A database maintenance plan is a set of specific, proactive task that need to be performed regularly on databases to ensure their adequate performance and availability Kariera IT Kraków | 22 Feb 2014 | KoprowskiT - Maintenance Plans for Beginners
    • 8 Maintenance Plans – how, where, when? Kariera IT Kraków | 22 Feb 2014 | KoprowskiT - Maintenance Plans for Beginners
    • Maintenance Plans – how, where, when? 9 HOW:  Maintenance Plan Wizard  Maintenance Plan Designer  T-SQL Scripts  PowerShell Scripts WHERE  SQL Server Management Studio from Standard and above  See you in… Express WHEN:  BEFORE: problems / service windows  AFTER: maintaining / clients back to home Kariera IT Kraków | 22 Feb 2014 | KoprowskiT - Maintenance Plans for Beginners
    • HOW: Maintenance Plan Wizard 10  Very simple (although advanced) wizard  Providing possibility for creation simple task in dozens of seconds  Enough in many cases, environments  Limited but include many options  Limitations:  number of databases  granularity  single tasks / no multitasking  no scripting for another instances  some known problems in previous version of SQL Server  SQL Server 2005 Service Pack 2 / SQL Server 2008 Kariera IT Kraków | 22 Feb 2014 | KoprowskiT - Maintenance Plans for Beginners
    • HOW: Maintenance Plan Designer 11  More flexible and advanced tool (not on this session)  Graphical user interface with SSIS  Most often used for „really DBA”  Increased features  Workflow for specified tasks with execution plan  Multitasking  Two additional Maintenance plans  Execute T-SQL Statement  Notify Operator Kariera IT Kraków | 22 Feb 2014 | KoprowskiT - Maintenance Plans for Beginners
    • 12 LIMITATIONS: Maintenance Plan wizard & Designer Limitations for both tools / those ideas are not possible  Identification and removing fragmentation for physical files  Identification abandoned, duplicated, forgotten indexes  Providing backup on demand  Werification good quality of backup  Werification succesful restore  Monitoring of performance  Monitoring of SQL OS  Monitoring of Windows OS  Monitoring available space Kariera IT Kraków | 22 Feb 2014 | KoprowskiT - Maintenance Plans for Beginners
    • Maintenance Plan: t-sql & powershell scripts 13  Functionality for „Real *Tru* DBA”  Necessary for working with multiple databases, instances, server farms  Feauters for scripting:  Access to OS  Posibility of moving  Scripts sharing One of the best examples and tools for free: HTTP://OLA.HALLENGREN.COM/ Kariera IT Kraków | 22 Feb 2014 | KoprowskiT - Maintenance Plans for Beginners
    • 14 (Everything I do) I do it for you Kariera IT Kraków | 22 Feb 2014 | KoprowskiT - Maintenance Plans for Beginners
    • Maintenance plans: available tasks 15  Check Database Integrity | DBCC CHECKDB  Shrink Database | NEVER, NEVER, NEVER  Reorganize Index | ALTER INDEX , and next Update Statistics  Rebuild Index | ALTER INDEX, Update Statistics are not necessary  Update Statistics | Sp_updatestats  History Cleanup | Using msdb, don’t do that too much frequently  Execute SQL Server Agent Job | Providing scrip using wen You work with agent  Back Up Database (Full) | Executing BACKUP DATABASE with FULL option >>Transaction Log  Back Up Database (Differential) | Executing BACKUP DATABASE with DIFFERENTIAL option  Back Up Database (Transaction Log) | Executing BACKUP LOG, frequency...  Maintenance Cleanup Task | Most complicated feature ? BAK, TRN, TXT Kariera IT Kraków | 22 Feb 2014 | KoprowskiT - Maintenance Plans for Beginners
    • Functionality: Verify Integrity of Database 16  Daily  Weekly  Monthly  DBCC CHECKDB (’database_name’) WITH NO_INFOMSGS  Suppresses all informational messages.  DBCC CHECKDB (’database_name’) WITH NO_INFOMSGS, ALL_ERRORMSGS  Displays all reported errors per object. All error messages are displayed by default. Specifying or omitting this option has no effect. Error messages are sorted by object ID, except for those messages generated from tempdb database.  In SQL Server Management Studio, the maximum number of error messages returned is 1000.  DBCC CHECKDB (’database_name’) NOINDEX  Specifies that intensive checks of nonclustered indexes for user tables should not be performed. This decreases the overall execution time. NOINDEX does not affect system tables because integrity checks are always performed on system table indexes Kariera IT Kraków | 22 Feb 2014 | KoprowskiT - Maintenance Plans for Beginners YOU SHOULD REMEMBER  using DBCC CHECKDB
    • POSSIBILITIES: SHRINK DATABASE 17  MDF & LDF  100 GB reserved  15 GB in use  DBCC SHRINKDATABASE or  DBCC SHRINKFILE | MANUAL MODE Reduction of Reserved Space Kariera IT Kraków | 22 Feb 2014 | KoprowskiT - Maintenance Plans for Beginners YOU MUST REMEMBER NEVER USE THIS OPTION IN MAINTENANCE PLANS
    • POSSIBILITIES: Maintain Index & Column Statistics 18  AUTO_CREATE_STATISTICS  AUTO_UPDATE_STATISTICS  Executing automatically after: INSERT, UPDATE, DELETE  UPDATE STATISTICS table_name WITH FULLSCAN When:  Never…  Just after Index Reorganization  On the days when we’re not using Index Rebuild or Reorganize Index Important options (UPDATE STATISTICS):  All existing statistics  Column statistics only  Index statistics only Kariera IT Kraków | 22 Feb 2014 | KoprowskiT - Maintenance Plans for Beginners YOU SHOULD REMEMBER Automation:
    • 19 POSSIBILITIES: Reorganize vs rebuild Kariera IT Kraków | 22 Feb 2014 | KoprowskiT - Maintenance Plans for Beginners
    • POSSIBILITIES: history clean up (MSDB) 20  Backup and restore history  SQL Server Agent job history  Maintenance Plan history Kariera IT Kraków | 22 Feb 2014 | KoprowskiT - Maintenance Plans for Beginners YOU MUST REMEMBER Choosing the data (right data) for deleting:
    • Summary 21 Kariera IT Kraków | 22 Feb 2014 | KoprowskiT - Maintenance Plans for Beginners
    • SUMMARY 22  We should remember about:  Task sequences  Task execution  Task priority  Documentation  Using: daily / weekly / occasionally  Better expoloration of our environment  Monitoring (partially) of performance  Standard and above (sorry)  Maintenance Plan Wizard  for beginners and small installations  Maintenance Plan Designer  Adult  , more complicated, wide environment Kariera IT Kraków | 22 Feb 2014 | KoprowskiT - Maintenance Plans for Beginners
    • LINKS 23  Brad McGehee | Brad’ Sure Guide to SQL Server Maintenance Plans „My new eBook, Brad’ Sure Guide to SQL Server Maintenance Plans is now available as a free, 269 page PDF eBook. The book is designed for part-time or novice DBAs who want to learn how to properly create Maintenance Plans using the tools that come with SQL Server Management Studio (SSMS) in SQL Server 2005/2008. LINK: http://bit.ly/1ijdnah  Ola Hallengreen | Maintenance Plans Scripts PASS slidedeck „The SQL Server Maintenance Solution comprises scripts for running backups, integrity checks, and index and statistics maintenance on all editions of Microsoft SQL Server 2005, SQL Server 2008, SQL Server 2008 R2, SQL Server 2012. The solution is based on stored procedures, sqlcmd utility, and SQL Server Agent jobs” LINK: http://bit.ly/1b220Ns Kariera IT Kraków | 22 Feb 2014 | KoprowskiT - Maintenance Plans for Beginners
    • after hours… 24  MAIL: KoprowskiT@windowslive.com  MSG: KoprowskiT@windowslive.com  SKYPE: tjkoprowski  TWITTER/FACEBOOK/LINKEDIN: KoprowskiT BLOGS: ITPRO Anorak’s Vision: http://itblogs.pl/notbeautifulanymore/ [PL/EN] Volume Licensing Specialites: http://koprowskit.eu/licensing/ [PL] My MVP Blog: http://koprowskit.eu/geek/ [PL/EN/ES] Kariera IT Kraków | 22 Feb 2014 | KoprowskiT - Maintenance Plans for Beginners