SlideShare ist ein Scribd-Unternehmen logo
1 von 28
DR 101 – The Overnight DBA
2013 MUSE International
Educational Session #1093
May 30 10:00am
Presenter: Ian Proffer
Today’s Agenda
• What is a DBA?
• SQL Server & Management Studio
• MEDITECH’s expectations for you
• Administration: database maintenance, managing
growth, user access and security
• Analysis: getting data efficiently, monitoring and
optimizing performance
What is a “DBA?”
A. A database administrator
B. A database analyst
C. A database architect
D. An FTE that hasn’t been filled yet
E. A and B (or maybe D)
Microsoft SQL Server
SQL Server & Data Repository
• DR is not a typical database (it’s a relational
database without relationships)
• The DR has 6,500+ tables as of 5.6x and over
35,000+ data fields
• Security is managed through SQL Server or Windows
Active Directory (no connection to MEDITECH
security mechanisms)
• DR databases include SQL tables with primary key
clustered indexes and stored procedures
MEDITECH Wants You!
To take care of your Data Repository
Server and Database Administration
• Server Monitoring & Maintenance
 Check the Windows Server and SQL Server logs
regularly or when you see symptoms of possible
problems
 Perform regular database maintenance, including
backups and data integrity checking
 Monitor overall disk space and usage
Backups and Data Integrity
• Database backups
 Ideally every database has a full backup done daily during
non-business hours
 Older hardware with very large databases may use differential
backups
 Do I need to back up the transaction log?
 The “Simple” recovery model
 In the event of a system failure, how quickly can the database
be brought back to a given point in time?
• Data integrity checking (DBCC)
 Check data integrity regularly (weekly, monthly)
 DBCC, SQL Maintenance Wizard
 Analyze and address index fragmentation
glass = database
water = your data
coaster = disk drive
Managing Disk and Database Space
How to Check Database & File Space
1. Management Studio Report
How to Check Database & File Space
2. Database Properties
How to Check Database & File Space
3. T-SQL sp_spaceused
Managing Disk and Database Space
• Disk space vs. database space
 Make sure primary data drive has plenty of capacity for
livedb growth
 MT recommends you keep 25% free space for the
livedb (typically the E: drive)
 Database auto-growth options
 Percentage vs. amount of space
 Unrestricted vs. restricted space
• What happens when the drive is full?
 Transfers stop (crash) until the db can grow
 Avoid this at all costs!
Using DR Manager to Plan for Growth
Managing Security & Access
• Create your own database for report
objects (stored procedures, functions, views, etc.)
 This avoids co-mingling your code and objects with Meditech’s
 This allows you to limit direct access to livedb
• Use Active Directory groups for easier administration
 e.g. ReportAdmins group, ReportViewer group
• For those that need access to livedb data consider:
 Using views in your database to selectively expose livedb data
 Using SQL database-level roles for direct table access
 ReportAdmins: db_owner, db_denydatawriter (read all data from
livedb, ability to create indexes but no INSERT, UPDATE or DELETE)
 ReportViewers: db_datareader (SELECT from tables)
 ReportViewers_NoPP: db_datareader with further DENY SELECT
permissions*
USE livedb
GO
SELECT 'DENY SELECT ON ' + name + ' TO
ReportViewers_NoPP'
FROM livedb.dbo.sysobjects
WHERE xtype = 'U'
AND name LIKE 'Pp%'
ORDER BY name
Database Analysis
• Optimizing queries
 Query execution plans
• Creating your own indexes
• Handling index fragmentation
• Other performance tools
Optimizing Queries
• Viewing the query execution plan
Creating Your Own Indexes
• Clustered vs. non-clustered
 All DR tables already have a primary key clustered index.
Don’t change them!
 Non-clustered indexes can be added wherever you like
• Document and save scripts for your indexes
• General guidelines for new non-clustered indexes
 SourceID, VisitID in any non-ADM (or EDM) top-level table
 AbstractData, BarVisits, LabSpecimens, PhaRx, OeOrders
 DateTime columns (AdmitDateTime, BatchDateTime,
CollectedDateTime)
• Multi-column (“covering”) vs. single column indexes
Index Fragmentation
• The SQL Maintenance Wizard can address this, but…
 Every table in the database is analyzed and acted upon
 Indexes may be dropped and recreated (REBUILD vs.
REORGANIZE)
• Doing your own, targeted index maintenance is better
 Assemble a list of tables you use regularly for reports
 If maintenance hasn’t been done, address tables selectively
on a series of first passes, then on a regular schedule
(weekly, monthly, after initial loads)
 After important tables are done, address the others
• Limit amount of work done based on a fragmentation
threshold or set number of tables (based on size) per
session
Analyzing Index Fragmentation (Old School)
Logical Scan
Fragmentation – lower is
better, anything above
25-30% would be a
candidate to defragment.
Avg. Page Density –
higher is better, ideally
90-95%. The fuller each
page is, the denser (less
fragmented) the data are.
-- Analyze fragmentation
DBCC SHOWCONTIG ('dbo.AdmVisits')
-- Defragment index if necessary
DBCC INDEXDEFRAG ( DBNAME, TABLENAME, INDEXNAME)
Analyzing Index Fragmentation (New School)
• Use SQL System Management Views
• ALTER INDEX with REORGANIZE
 Replaces DBCC INDEXDEFRAG
• ALTER INDEX with REBUILD
 Replaces DBCC DBREINDEX
• You can use Management Studio or use T-SQL
commands
Other Performance & Monitoring Tools
• Activity Monitor
Other Performance & Monitoring Tools
• SQL Profiler
Other Performance & Monitoring Tools
• Database Engine Tuning Advisor
Discussion, Questions & Answers
Come see our MUSE sessions and visit us at Booth
#603 in the Exhibit Hall!
• Today at 1:30
 1149 - Data Repository: The Journey to 6.0 and Beyond
• Fri 5/31 3:30
 1179- EHR Meaningful Use 2014 (Stage 2) DR Reporting Strategies
Thank you.

Weitere ähnliche Inhalte

Was ist angesagt?

ORACLE 12C-New-Features
ORACLE 12C-New-FeaturesORACLE 12C-New-Features
ORACLE 12C-New-Features
Navneet Upneja
 

Was ist angesagt? (20)

Introduction to oracle database (basic concepts)
Introduction to oracle database (basic concepts)Introduction to oracle database (basic concepts)
Introduction to oracle database (basic concepts)
 
NoSQL (Non-Relational Databases)
NoSQL (Non-Relational Databases)NoSQL (Non-Relational Databases)
NoSQL (Non-Relational Databases)
 
No SQL
No SQLNo SQL
No SQL
 
Oracle Query Optimizer - An Introduction
Oracle Query Optimizer - An IntroductionOracle Query Optimizer - An Introduction
Oracle Query Optimizer - An Introduction
 
Parallel processing in data warehousing and big data
Parallel processing in data warehousing and big dataParallel processing in data warehousing and big data
Parallel processing in data warehousing and big data
 
Sql server-dba
Sql server-dbaSql server-dba
Sql server-dba
 
Lecture12
Lecture12Lecture12
Lecture12
 
Cassandra Learning
Cassandra LearningCassandra Learning
Cassandra Learning
 
Strategies for SQL Server Index Analysis
Strategies for SQL Server Index AnalysisStrategies for SQL Server Index Analysis
Strategies for SQL Server Index Analysis
 
Online Datastage training
Online Datastage trainingOnline Datastage training
Online Datastage training
 
U-SQL Federated Distributed Queries (SQLBits 2016)
U-SQL Federated Distributed Queries (SQLBits 2016)U-SQL Federated Distributed Queries (SQLBits 2016)
U-SQL Federated Distributed Queries (SQLBits 2016)
 
Java Developers, make the database work for you (NLJUG JFall 2010)
Java Developers, make the database work for you (NLJUG JFall 2010)Java Developers, make the database work for you (NLJUG JFall 2010)
Java Developers, make the database work for you (NLJUG JFall 2010)
 
Introduction to NOSQL databases
Introduction to NOSQL databasesIntroduction to NOSQL databases
Introduction to NOSQL databases
 
3 olap storage
3 olap storage3 olap storage
3 olap storage
 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
 
ORACLE 12C-New-Features
ORACLE 12C-New-FeaturesORACLE 12C-New-Features
ORACLE 12C-New-Features
 
EDW and Hadoop
EDW and HadoopEDW and Hadoop
EDW and Hadoop
 
Database awareness
Database awarenessDatabase awareness
Database awareness
 
Mapping Data Flows Training deck Q1 CY22
Mapping Data Flows Training deck Q1 CY22Mapping Data Flows Training deck Q1 CY22
Mapping Data Flows Training deck Q1 CY22
 
Student projects with open source CSQL
Student projects with open source CSQLStudent projects with open source CSQL
Student projects with open source CSQL
 

Andere mochten auch

Informe general
Informe generalInforme general
Informe general
kode99
 
Target audience aa 1
Target audience aa 1Target audience aa 1
Target audience aa 1
nctcmedia12
 
Energitilsyn og energiklagenævn copenhagen june2013
Energitilsyn og energiklagenævn copenhagen june2013Energitilsyn og energiklagenævn copenhagen june2013
Energitilsyn og energiklagenævn copenhagen june2013
consumerenergy
 
Media Studies - Forms and Conventions
Media Studies - Forms and ConventionsMedia Studies - Forms and Conventions
Media Studies - Forms and Conventions
Thomas Hesselberg
 
Agoria delestree
Agoria delestreeAgoria delestree
Agoria delestree
CIRB_CIBG
 
Uml面向对象的分析与设计
Uml面向对象的分析与设计Uml面向对象的分析与设计
Uml面向对象的分析与设计
xunhao
 

Andere mochten auch (20)

CloudFoundryこと始め
CloudFoundryこと始めCloudFoundryこと始め
CloudFoundryこと始め
 
Marketing communication
Marketing communicationMarketing communication
Marketing communication
 
Sheet1 simplified
Sheet1 simplifiedSheet1 simplified
Sheet1 simplified
 
Informe general
Informe generalInforme general
Informe general
 
Hzz ve ra birlikleri defans el kitabı
Hzz ve ra birlikleri defans el kitabıHzz ve ra birlikleri defans el kitabı
Hzz ve ra birlikleri defans el kitabı
 
NdT inspection of wire ropes for elevators
NdT inspection of wire ropes for elevatorsNdT inspection of wire ropes for elevators
NdT inspection of wire ropes for elevators
 
Target audience aa 1
Target audience aa 1Target audience aa 1
Target audience aa 1
 
Proiectele e twinning cale spre cunoasterea culturii europene
Proiectele e twinning  cale spre cunoasterea culturii europeneProiectele e twinning  cale spre cunoasterea culturii europene
Proiectele e twinning cale spre cunoasterea culturii europene
 
Create a group and Add Members using MBC
Create a group and Add Members using MBCCreate a group and Add Members using MBC
Create a group and Add Members using MBC
 
Target audience aa 1
Target audience aa 1Target audience aa 1
Target audience aa 1
 
Газовый настенный котел Baxi Luna 3 310 Fi
Газовый настенный котел Baxi Luna 3 310 FiГазовый настенный котел Baxi Luna 3 310 Fi
Газовый настенный котел Baxi Luna 3 310 Fi
 
Energitilsyn og energiklagenævn copenhagen june2013
Energitilsyn og energiklagenævn copenhagen june2013Energitilsyn og energiklagenævn copenhagen june2013
Energitilsyn og energiklagenævn copenhagen june2013
 
Tutorial de ingreso a plataforma curso virtual
Tutorial de ingreso a plataforma curso virtualTutorial de ingreso a plataforma curso virtual
Tutorial de ingreso a plataforma curso virtual
 
Фундамент
ФундаментФундамент
Фундамент
 
Jeyakumar Narashimman
Jeyakumar NarashimmanJeyakumar Narashimman
Jeyakumar Narashimman
 
Media Studies - Forms and Conventions
Media Studies - Forms and ConventionsMedia Studies - Forms and Conventions
Media Studies - Forms and Conventions
 
R&p
R&pR&p
R&p
 
Selectivos valenciano sept. 2010 y junio 2011
Selectivos valenciano sept. 2010 y junio 2011 Selectivos valenciano sept. 2010 y junio 2011
Selectivos valenciano sept. 2010 y junio 2011
 
Agoria delestree
Agoria delestreeAgoria delestree
Agoria delestree
 
Uml面向对象的分析与设计
Uml面向对象的分析与设计Uml面向对象的分析与设计
Uml面向对象的分析与设计
 

Ähnlich wie The dr overnight dba

Database administrator
Database administratorDatabase administrator
Database administrator
Tech_MX
 
Implementing the Databese Server session 02
Implementing the Databese Server session 02Implementing the Databese Server session 02
Implementing the Databese Server session 02
Guillermo Julca
 
Database management system.pptx
Database management system.pptxDatabase management system.pptx
Database management system.pptx
AshmitKashyap1
 
Week 1 and 2 Getting started with DBMS.pptx
Week 1 and 2 Getting started with DBMS.pptxWeek 1 and 2 Getting started with DBMS.pptx
Week 1 and 2 Getting started with DBMS.pptx
Riannel Tecson
 

Ähnlich wie The dr overnight dba (20)

KoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersKoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
 
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginnersKoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
 
Database management system (part 1)
Database management system (part 1)Database management system (part 1)
Database management system (part 1)
 
Complete first chapter rdbm 17332
Complete first chapter rdbm 17332Complete first chapter rdbm 17332
Complete first chapter rdbm 17332
 
Azure data platform overview
Azure data platform overviewAzure data platform overview
Azure data platform overview
 
MS ACCESS.pptx
MS ACCESS.pptxMS ACCESS.pptx
MS ACCESS.pptx
 
DataBase Management systems (IM).pptx
DataBase Management systems (IM).pptxDataBase Management systems (IM).pptx
DataBase Management systems (IM).pptx
 
Database administrator
Database administratorDatabase administrator
Database administrator
 
Scalable relational database with SQL Azure
Scalable relational database with SQL AzureScalable relational database with SQL Azure
Scalable relational database with SQL Azure
 
Database Management System
Database Management SystemDatabase Management System
Database Management System
 
Tech-Spark: Azure SQL Databases
Tech-Spark: Azure SQL DatabasesTech-Spark: Azure SQL Databases
Tech-Spark: Azure SQL Databases
 
MS-ACCESS.pptx
MS-ACCESS.pptxMS-ACCESS.pptx
MS-ACCESS.pptx
 
7 Things To Know About Database Testing.pdf
7 Things To Know About Database Testing.pdf7 Things To Know About Database Testing.pdf
7 Things To Know About Database Testing.pdf
 
Implementing the Databese Server session 02
Implementing the Databese Server session 02Implementing the Databese Server session 02
Implementing the Databese Server session 02
 
Database Management Systems 2
Database Management Systems 2Database Management Systems 2
Database Management Systems 2
 
Chapter 1 Fundamentals of Database Management System
Chapter 1 Fundamentals of Database Management SystemChapter 1 Fundamentals of Database Management System
Chapter 1 Fundamentals of Database Management System
 
Azure Data Fundamentals DP 900 Full Course
Azure Data Fundamentals DP 900 Full CourseAzure Data Fundamentals DP 900 Full Course
Azure Data Fundamentals DP 900 Full Course
 
Database management system.pptx
Database management system.pptxDatabase management system.pptx
Database management system.pptx
 
Presentation cloud control enterprise manager 12c
Presentation   cloud control enterprise manager 12cPresentation   cloud control enterprise manager 12c
Presentation cloud control enterprise manager 12c
 
Week 1 and 2 Getting started with DBMS.pptx
Week 1 and 2 Getting started with DBMS.pptxWeek 1 and 2 Getting started with DBMS.pptx
Week 1 and 2 Getting started with DBMS.pptx
 

Kürzlich hochgeladen

Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
UK Journal
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
FIDO Alliance
 

Kürzlich hochgeladen (20)

AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4j
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideCollecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 

The dr overnight dba

  • 1. DR 101 – The Overnight DBA 2013 MUSE International Educational Session #1093 May 30 10:00am Presenter: Ian Proffer
  • 2. Today’s Agenda • What is a DBA? • SQL Server & Management Studio • MEDITECH’s expectations for you • Administration: database maintenance, managing growth, user access and security • Analysis: getting data efficiently, monitoring and optimizing performance
  • 3. What is a “DBA?” A. A database administrator B. A database analyst C. A database architect D. An FTE that hasn’t been filled yet E. A and B (or maybe D)
  • 5. SQL Server & Data Repository • DR is not a typical database (it’s a relational database without relationships) • The DR has 6,500+ tables as of 5.6x and over 35,000+ data fields • Security is managed through SQL Server or Windows Active Directory (no connection to MEDITECH security mechanisms) • DR databases include SQL tables with primary key clustered indexes and stored procedures
  • 6. MEDITECH Wants You! To take care of your Data Repository
  • 7.
  • 8. Server and Database Administration • Server Monitoring & Maintenance  Check the Windows Server and SQL Server logs regularly or when you see symptoms of possible problems  Perform regular database maintenance, including backups and data integrity checking  Monitor overall disk space and usage
  • 9. Backups and Data Integrity • Database backups  Ideally every database has a full backup done daily during non-business hours  Older hardware with very large databases may use differential backups  Do I need to back up the transaction log?  The “Simple” recovery model  In the event of a system failure, how quickly can the database be brought back to a given point in time? • Data integrity checking (DBCC)  Check data integrity regularly (weekly, monthly)  DBCC, SQL Maintenance Wizard  Analyze and address index fragmentation
  • 10. glass = database water = your data coaster = disk drive Managing Disk and Database Space
  • 11. How to Check Database & File Space 1. Management Studio Report
  • 12. How to Check Database & File Space 2. Database Properties
  • 13. How to Check Database & File Space 3. T-SQL sp_spaceused
  • 14. Managing Disk and Database Space • Disk space vs. database space  Make sure primary data drive has plenty of capacity for livedb growth  MT recommends you keep 25% free space for the livedb (typically the E: drive)  Database auto-growth options  Percentage vs. amount of space  Unrestricted vs. restricted space • What happens when the drive is full?  Transfers stop (crash) until the db can grow  Avoid this at all costs!
  • 15. Using DR Manager to Plan for Growth
  • 16. Managing Security & Access • Create your own database for report objects (stored procedures, functions, views, etc.)  This avoids co-mingling your code and objects with Meditech’s  This allows you to limit direct access to livedb • Use Active Directory groups for easier administration  e.g. ReportAdmins group, ReportViewer group • For those that need access to livedb data consider:  Using views in your database to selectively expose livedb data  Using SQL database-level roles for direct table access  ReportAdmins: db_owner, db_denydatawriter (read all data from livedb, ability to create indexes but no INSERT, UPDATE or DELETE)  ReportViewers: db_datareader (SELECT from tables)  ReportViewers_NoPP: db_datareader with further DENY SELECT permissions*
  • 17. USE livedb GO SELECT 'DENY SELECT ON ' + name + ' TO ReportViewers_NoPP' FROM livedb.dbo.sysobjects WHERE xtype = 'U' AND name LIKE 'Pp%' ORDER BY name
  • 18. Database Analysis • Optimizing queries  Query execution plans • Creating your own indexes • Handling index fragmentation • Other performance tools
  • 19. Optimizing Queries • Viewing the query execution plan
  • 20. Creating Your Own Indexes • Clustered vs. non-clustered  All DR tables already have a primary key clustered index. Don’t change them!  Non-clustered indexes can be added wherever you like • Document and save scripts for your indexes • General guidelines for new non-clustered indexes  SourceID, VisitID in any non-ADM (or EDM) top-level table  AbstractData, BarVisits, LabSpecimens, PhaRx, OeOrders  DateTime columns (AdmitDateTime, BatchDateTime, CollectedDateTime) • Multi-column (“covering”) vs. single column indexes
  • 21. Index Fragmentation • The SQL Maintenance Wizard can address this, but…  Every table in the database is analyzed and acted upon  Indexes may be dropped and recreated (REBUILD vs. REORGANIZE) • Doing your own, targeted index maintenance is better  Assemble a list of tables you use regularly for reports  If maintenance hasn’t been done, address tables selectively on a series of first passes, then on a regular schedule (weekly, monthly, after initial loads)  After important tables are done, address the others • Limit amount of work done based on a fragmentation threshold or set number of tables (based on size) per session
  • 22. Analyzing Index Fragmentation (Old School) Logical Scan Fragmentation – lower is better, anything above 25-30% would be a candidate to defragment. Avg. Page Density – higher is better, ideally 90-95%. The fuller each page is, the denser (less fragmented) the data are. -- Analyze fragmentation DBCC SHOWCONTIG ('dbo.AdmVisits') -- Defragment index if necessary DBCC INDEXDEFRAG ( DBNAME, TABLENAME, INDEXNAME)
  • 23. Analyzing Index Fragmentation (New School) • Use SQL System Management Views • ALTER INDEX with REORGANIZE  Replaces DBCC INDEXDEFRAG • ALTER INDEX with REBUILD  Replaces DBCC DBREINDEX • You can use Management Studio or use T-SQL commands
  • 24. Other Performance & Monitoring Tools • Activity Monitor
  • 25. Other Performance & Monitoring Tools • SQL Profiler
  • 26. Other Performance & Monitoring Tools • Database Engine Tuning Advisor
  • 28. Come see our MUSE sessions and visit us at Booth #603 in the Exhibit Hall! • Today at 1:30  1149 - Data Repository: The Journey to 6.0 and Beyond • Fri 5/31 3:30  1179- EHR Meaningful Use 2014 (Stage 2) DR Reporting Strategies Thank you.