Database Optimization & Maintenance Tim Richard Agenda • • • • • • SQL Configuration OnBase DB Planning Backups Integrity Optimization Tips and Recommendations 2013 ECM Training Conference #dbwestECM SQL Server: Databases • Five system databases on a SQL Server instance – – – – – master model msdb TempDB Resource database 2013 ECM Training Conference #dbwestECM System Database Recommendations • Pre-size TempDB and the transaction log • Create multiple files for TempDB • Resist shrinking the database #dbwestECM SQL Server Configuration • Parallelism • Memory • TempDB – Create multiple files • ODBC drivers – Verify client version vs. server – Verify most recent version #dbwestECM Agenda • • • • • • SQL Configuration OnBase DB Planning Backups Integrity Optimization Tips and Recommendations 2013 ECM Training Conference #dbwestECM The OnBase DB • What information does it store? – Critical component in an OnBase solution • Data • Performance #dbwestECM Before you create the database… • Where should the files be located? – This is a business decision – If you’re not sure where to put them… • Refer to the Database Installation Guide on Community • Where should the files ideally be located? – On drives that can provide the necessary response time (1-5 ms log writes, > 10 ms data writes) – RAID 1+0, 15K #dbwestECM Sizing • Sizing guide from DRG • Check existing utilization – Pay attention to size on disk vs. % utilized #dbwestECM DBSpace Percentage of total DBSpace1 33 DBSpace2 7 DBSpace3 4 DBSpace4 0 DBSpace5 0 DBSpace6 6 DBSpace7 1 DBSpace8 1 DBSpace9 9 DBSpace10 6 DBSpace2i 6 DBSpace3i 9 DBSpace6i 7 DBSpace9i 11 Estimating Database Size Hyland Customer DB Size • Small < 20 GB < 10,000,000 documents • Medium/Large < 100 GB < 100,000,000 documents • Enterprise > 100 GB > 100,000,000 documents #dbwestECM Auto-File Growth Settings • What should File Growth be for each DBSpace? – 5 for 3*, 4, 5, 3i* – 100 for 7, 8 – 512 for 1, 2, 6, 9, 10, 2i, 6i, 9i #dbwestECM Agenda • • • • • • SQL Configuration OnBase DB Planning Backups Integrity Optimization Tips and Recommendations 2013 ECM Training Conference #dbwestECM Backups: what you need to know first • Evaluate your current backup process – How often are backups taken (full, diff, log)? – Where are copies stored on site? – Where are copies stored off site? – How often are tapes/disks/etc. rotated? #dbwestECM Backups: what you need to know next • Determine your recovery strategy – RPO = Recovery Point Objective – RTO = Recovery Time Objective – Do you need High Availability? • Establish a SLA • Test, test, test, and then test again #dbwestECM Backup Tasks • When was last backup? • When was last transaction log backup? • Creating a backup – Full vs. differential vs. log • Set up a maintenance plan • Restore the backup #dbwestECM Agenda • • • • • • SQL Configuration OnBase DB Planning Backups Integrity Optimization Tips and Recommendations 2013 ECM Training Conference #dbwestECM Integrity checks: what you need to do • Create a job to check integrity on a regular basis • Create alerts to monitor for errors: – 823: Page not read – 824: Torn page – 825: Impending trouble • Regularly check hardware for problems #dbwestECM Integrity Tasks • • • • Run CHECKDB Page verify option Set up a maintenance plan Set up alerts #dbwestECM Agenda • • • • • • SQL Configuration OnBase DB Planning Backups Integrity Optimization Tips and Recommendations 2013 ECM Training Conference #dbwestECM Optimizations: what you need to do • Rebuild indexes on a regular basis • Update statistics with 100% sample • Update index statistics AND column level statistics #dbwestECM Updating Statistics • As part of Index Rebuilds – Only updates index statistics – 100% sample • Automatically – When 20% of the rows + 500 change – Not 100% sample – Enables query optimization in 2005 & 2008* • Manually (UPDATE STATISTICS or sp_updatestats) #dbwestECM Optimization Tasks - Fragmentation • Rebuild – >40% fragmentation – Offline • Reorganize – >10% and <40% fragmentation – Online • Typically fragmented tables – Itemdata10 – Itemlc – Keyword tables #dbwestECM Optimization Best Practices • • • • Rebuild indexes regularly Use 100% sample for statistics Differences in SQL 2000 vs. 2005/2008 Revisit maintenance plans #dbwestECM Agenda • • • • • • SQL Configuration OnBase DB Planning Backups Integrity Optimization Tips and Recommendations 2013 ECM Training Conference #dbwestECM User’s Role in Performance • Database is a shared resource – Each activity consumes part of the resource • Best Practice for User Searches – – – – Retrieve < 100 documents Selective search criteria Use Keywords and Dates Avoid Leading Wildcards #dbwestECM Suggestions • Keyword creation – Smart keywords, use Keyword Type Groups if possible • • • • • Educate users on negative effects of actions Be cautions with API programs/VB Scripts (performance) Utilize Custom Queries Disable Document List Refresh Enable Document Type Query Restrictions #dbwestECM More Suggestions • Setup required keyword for retrieval • Enable option to select user range of batches in Committed queues • Security Keywords – EQUAL vs. NOT EQUAL – Perform Security Keyword Checking During Database Query • Other Database Settings (Utils) • Tuning Parameters (Client and ini file) #dbwestECM Hyland Communities Thank You!