Fermilab Jan 27, 2005LHC Database Workshop1 Database Applications Deployment Case Study Anil Kumar CD/CSS/DSG.

Slides:



Advertisements
Similar presentations
Tuning: overview Rewrite SQL (Leccotech)Leccotech Create Index Redefine Main memory structures (SGA in Oracle) Change the Block Size Materialized Views,
Advertisements

Copyright © SoftTree Technologies, Inc. DB Tuning Expert.
Chapter 9. Performance Management Enterprise wide endeavor Research and ascertain all performance problems – not just DBMS Five factors influence DB performance.
Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
IS 4420 Database Fundamentals Chapter 6: Physical Database Design and Performance Leon Chen.
Harvard University Oracle Database Administration Session 2 System Level.
Oracle 10g Database Administrator: Implementation and Administration Chapter 14 Proactive Maintenance.
Advanced Databases Basic Database Administration Guide to Oracle 10g 1.
A Guide to Oracle9i1 Introduction to Oracle9i Database Administration Chapter 11.
F Fermilab Database Experience in Run II Fermilab Run II Database Requirements Online databases are maintained at each experiment and are critical for.
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
Simplify your Job – Automatic Storage Management Angelo Session id:
Maintaining a Microsoft SQL Server 2008 Database SQLServer-Training.com.
Managing Multi-User Databases AIMS 3710 R. Nakatsu.
Database System Concepts and Architecture Lecture # 3 22 June 2012 National University of Computer and Emerging Sciences.
Fermilab Oct 17, 2005Database Services at LCG Tier sites - FNAL1 FNAL Site Update By Anil Kumar & Julie Trumbo CD/CSS/DSG FNAL LCG Database.
IT The Relational DBMS Section 06. Relational Database Theory Physical Database Design.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
Online Database Support Experiences Diana Bonham, Dennis Box, Anil Kumar, Julie Trumbo, Nelly Stanfield.
Sofia, Bulgaria | 9-10 October SQL Server 2005 High Availability for developers Vladimir Tchalkov Crossroad Ltd. Vladimir Tchalkov Crossroad Ltd.
1 Robert Wijnbelt Health Check your Database A Performance Tuning Methodology.
Physical Database Design & Performance. Optimizing for Query Performance For DBs with high retrieval traffic as compared to maintenance traffic, optimizing.
7202ICT Database Administration Lecture 7 Managing Database Storage Part 2 Orale Concept Manuel Chapter 3 & 4.
CDF Taking Stock ‘08 1 By Anil Kumar CD/LSCS/DBI/DBA July 16, 2008.
Informix IDS Administration with the New Server Studio 4.0 By Lester Knutsen My experience with the beta of Server Studio and the new Informix database.
Oracle9i Performance Tuning Chapter 1 Performance Tuning Overview.
The protection of the DB against intentional or unintentional threats using computer-based or non- computer-based controls. Database Security – Part 2.
1099 Why Use InterBase? Bill Todd The Database Group, Inc.
Experiment Support CERN IT Department CH-1211 Geneva 23 Switzerland t DBES PhEDEx Monitoring Nicolò Magini CERN IT-ES-VOS For the PhEDEx.
Oracle Tuning Ashok Kapur Hawkeye Technology, Inc.
BW Know-How Call : Performance Tuning dial-in phone numbers! U.S. Toll-free: (877) International: (612) Passcode: “BW”
11-1 Improve response time of interactive programs. Improve batch throughput. To ensure scalability of applications load vs. performance. Reduce system.
1 All Powder Board and Ski Oracle 9i Workbook Chapter 9: Database Administration Jerry Post Copyright © 2003.
Anton TopurovIT-DB 23 April 2013 Introduction to Oracle2.
Oracle9i Performance Tuning Chapter 12 Tuning Tools.
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
Database structure and space Management. Database Structure An ORACLE database has both a physical and logical structure. By separating physical and logical.
Introduction to Oracle. Oracle History 1979 Oracle Release client/server relational database 1989 Oracle Oracle 8 (object relational) 1999.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
ESRI User Conference 2004 ArcSDE. Some Nuggets Setup Performance Distribution Geodatabase History.
Methodology – Physical Database Design for Relational Databases.
SYS364 Database Design Continued. Database Design Definitions Initial ERD’s Normalization of data Final ERD’s Database Management Database Models File.
Oracle 10g Database Administrator: Implementation and Administration Chapter 5 Basic Storage Concepts and Settings.
1 D0 Taking Stock By Anil Kumar CD/LSCS/DBI/DBA June 11, 2007.
Physical Database Design Purpose- translate the logical description of data into the technical specifications for storing and retrieving data Goal - create.
Copyright 2007, Information Builders. Slide 1 Machine Sizing and Scalability Mark Nesson, Vashti Ragoonath June 2008.
Infrastructure for Data Warehouses. Basics Of Data Access Data Store Machine Memory Buffer Memory Cache Data Store Buffer Bus Structure.
Chapter 5 Index and Clustering
1 Intro stored procedures Declaring parameters Using in a sproc Intro to transactions Concurrency control & recovery States of transactions Desirable.
D0 Taking Stock1 By Anil Kumar CD/CSS/DSG June 06, 2005.
Oracle Architecture - Structure. Oracle Architecture - Structure The Oracle Server architecture 1. Structures are well-defined objects that store the.
Status of tests in the LCG 3D database testbed Eva Dafonte Pérez LCG Database Deployment and Persistency Workshop.
Level 1-2 Trigger Data Base development Current status and overview Myron Campbell, Alexei Varganov, Stephen Miller University of Michigan August 17, 2000.
Database Systems, 8 th Edition SQL Performance Tuning Evaluated from client perspective –Most current relational DBMSs perform automatic query optimization.
Next Generation of Apache Hadoop MapReduce Owen
Physical Layer of a Repository. March 6, 2009 Agenda – What is a Repository? –What is meant by Physical Layer? –Data Source, Connection Pool, Tables and.
Oracle Database Architectural Components
McGraw-Hill/Irwin Copyright © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 9: Database Administration All Powder Board and Ski.
Databases and DBMSs Todd S. Bacastow January 2005.
Data, Space and Transaction Processing
Table spaces.
By Anil Kumar CD/CSS/DSG June 06, 2005
Physical Database Design and Performance
CHAPTER 5: PHYSICAL DATABASE DESIGN AND PERFORMANCE
Data, Databases, and DBMSs
Data Lifecycle Review and Outlook
Performance And Scalability In Oracle9i And SQL Server 2000
Database administration
Best Practices in Higher Education Student Data Warehousing Forum
Presentation transcript:

Fermilab Jan 27, 2005LHC Database Workshop1 Database Applications Deployment Case Study Anil Kumar CD/CSS/DSG

Fermilab Jan 27, 2005LHC Database Workshop2 Outlines u Background u Challenge u Solution u Case Study Details

Fermilab Jan 27, 2005LHC Database Workshop3 Background u CSS-DSG develops, deploys and supports databases. Also system administration for hardware for Experiment and Lab Users. u Developments are structured as projects - invariably involving participants from more than one department in the Computing Division and usually in collaboration with the end users and often with Project Leaders outside of the Department. u We focus on Data Handling and Management;databases for information and event data management; distributed data management and access; system administration of multiplatform experiment hardware. u CSS-DSG is working on projects with CDF, D0, CMS, BTeV, MINOS and beyond.

Fermilab Jan 27, 2005LHC Database Workshop4 Challenge u To deploy tuned and integral database schemas to production ensuring consistency and integrity in data model design. u Proactive approach in understanding the requirement and fine tune the data design. u Performant databases. u 24*7 Support for Databases.

Fermilab Jan 27, 2005LHC Database Workshop5 Solution u Setting the hardware infrastructure including disk layouts for database storage. u Data Modeling u Server Tuning u Query Tuning u Load balance via replication u Tracking of access and resources used to help tuning of applications and databases. u Exiting the long inactive database sessions. u Capacity planning

Fermilab Jan 27, 2005LHC Database Workshop6 Case Study Details u Specific Experiments for Case Study u Hardware Infrastructure for Database(s) u Data Modeling u Deployment u Tuning u Load Balance Via Replication u Monitoring u Special Features u Summary

Fermilab Jan 27, 2005LHC Database Workshop7 Specific Experiments for Case Study u D0 u CDF u CMS u MINOS

Fermilab Jan 27, 2005LHC Database Workshop8 Hardware Infrastructure for Database(s) u Hardware is selected based upon the application’s size, growth and performance requirement. u Database is deployed keeping in mind the OFA ( Optimal Flexible Architecture of Oracle ) u See D0 Off-line Database Disk Array Diagram Fig 1.

Fermilab Jan 27, 2005LHC Database Workshop9 D0 Off-line Database Disk Array Diagram Redo (raid 0+1) Sys/App (raid 1) Undo (Rollback Segs) (raid 0+1) Temp (raid 0+1) Data (raid 5) Index (raid 5 ) Spare Fiber AFiber B

Fermilab Jan 27, 2005LHC Database Workshop10 Data Modeling u Data Modeling tool being used is Oracle Designer. u There is central repository for design of all applications across different experiments. u Each application owner goes through a tutorial for Oracle Designer. u Data Model evolves per reviews. u Once Final Design is done. Space report is generated for the application. u DDLs are generated through Design Editor tool of Oracle Designer. DDLs are reviewed with Data Base group as per standards defined. Application owner CVS the ddls.

Fermilab Jan 27, 2005LHC Database Workshop11 Standards for Data Modeling u Review DDL statements for: u Tables: Correct tablespace placement i.e. indexes in index tablespaces, data in data tablespaces u Tables: Ensure that no table has 0 start or end rows, otherwise it's not counted in space report. u Tables: Every table must have a corresponding Primary Key in the constraints file. u Tables: Every table(and view,and sequence) must have a synonym) u Tables: Check every object for storage definitions; match DDL with storage report, initial, next must be defined, it is easy to miss one.

Fermilab Jan 27, 2005LHC Database Workshop12 Standards for Data Modeling u Review DDL statements for: u Tables: Check for pct increase of 0% u Tables:Check that all NOT NULL fields are on top u Tables:Check date fields are defined as date vs varchar2 or other, unless required by the application u Constraints: FK's do not require storage or tablespace definitions, but PK's do. Make sure every ER table with crow-foot coming into it has a FK in the.con file. u Indexes: Every FK constraint must have a corresponding FK index. Also compare initial,next,min,max on space report to each FK in the.ind file.

Fermilab Jan 27, 2005LHC Database Workshop13 Standards for Data Modeling u Review DDL statements for: u Triggers: Ensure that there are not multiple "Before Insert" triggers on the same table. These need to be rolled into one trigger. u Sequences: Every sequence needs a synonym u Synonyms: Due to bug in Designer, make sure table owner is removed from synonym u Synonyms: must be given to public u Grants: Every table and sequence must have at least 'SELECT' granted to it

Fermilab Jan 27, 2005LHC Database Workshop14 Standards for Data Modeling u Review Space Report: u Check to make sure Database Block Size matches the db_block_size. Default value is 2K, but our databases generally are created with db_block_size of 8K.(8192) u Make sure the CLOBS and BLOBS go into their own tablespaces. Example Example u Make sure to update the Database Application section off the Support DB Project References page

Fermilab Jan 27, 2005LHC Database Workshop15 Deployment u A development environment exists for each application. This environment will house the application's schema. u The development environment contains logons for individual developers. These logons are used for development and testing at the lowest levels, before applications are user-ready. u An integration environment exists and used to test the cutting scripts and application code before declaring production. u Once schema is deployed on integration and APIs are tested, schema and APIs are deployed on production. u The integration and production databases will contain logons for the application logons and dbas only. Individual users without application-specific roles will not have access. u Application Deployment on dev/int/prd Philosophy Details :

Fermilab Jan 27, 2005LHC Database Workshop16 Tuning u Server Tuning u SQL Tuning u Partitioning

Fermilab Jan 27, 2005LHC Database Workshop17 Server Tuning - Server Statistics are monitored on a weekly basis. - Servers are tuned on the basis of recommendations from monitoring reports. - Example : After upgrade of D0 databases to performance degraded. Action taken to tune : - Tuned the server by setting the automatic memory management. - Analyzed the whole database using DBMS_STATS pack. Database was much performant. Average Response time per execute on d0 is 0.01 secs to 0.07 secs. Monitoring graphs are posted on web on a monthly basis :

Fermilab Jan 27, 2005LHC Database Workshop18 SQL Tuning - Bad Performant queries are tracked. And tuned as needed. - Find the explain plan of query. Also trace of query can be submitted to “tkprof” utility to find details of query as per CPU and parse counts goes.. Cartesian Joins are performance Killer. In fact this results into a bad query - Ad hoc queries are first run on integration db before submiiting to production. Example: The following query causes cartesian join since data_files table is not joined with other tables. select pt.param_type ParamType, pv.param_value ParamValue, pv.param_value_id, ParamValueID,pc.param_category ParamCategory from data_files df, param_values pv, param_types pt, param_categories pc where (pc.param_category like 'global%' and pv.param_type_id=pt.param_type_id and pt.param_category_id=pc.param_category_id) order by pt.param_type;

Fermilab Jan 27, 2005LHC Database Workshop19 SQL Tuning Contd u Query with inner joins is going be faster as compared to SUB SELECT queries. Since inner join doesn't have overhead of sort operation. Example : select df.file_id from project_files pf, data_files df where pf.proj_snap_id= and pf.file_id=df.file_id and df.file_content_status_id=1; is faster than select file_id from data_files where file_id in (select file_id from project_files where proj_snap_id=136780) and file_content_status_id=1;

Fermilab Jan 27, 2005LHC Database Workshop20 SQL Tuning Contd u Execution Plan for First Query : SELECT STATEMENT Optimizer=CHOOSE (Cost=305 Card=150 Bytes=3 000) 1 0 NESTED LOOPS (Cost=305 Card=150 Bytes=3000) 2 1 TABLE ACCESS (BY INDEX ROWID) OF 'PROJECT_FILES' (Cost=5 Card=150 Bytes=1650) 3 2 INDEX (RANGE SCAN) OF 'PF1_PK' (UNIQUE) (Cost=3 Card=1 50) 4 1 TABLE ACCESS (BY INDEX ROWID) OF 'DATA_FILES' (Cost=2 Ca rd=1 Bytes=9) 5 4 INDEX (UNIQUE SCAN) OF 'FI_PK' (UNIQUE) (Cost=1 Card=2 ) u Execution Plan for Second Query u 0 SELECT STATEMENT Optimizer=CHOOSE (Cost=307 Card=150 Bytes=3 000) 1 0 NESTED LOOPS (Cost=307 Card=150 Bytes=3000) 2 1 SORT (UNIQUE) 3 2 TABLE ACCESS (BY INDEX ROWID) OF 'PROJECT_FILES' (Cost =5 Card=150 Bytes=1650) 4 3 INDEX (RANGE SCAN) OF 'PF1_PK' (UNIQUE) (Cost=3 Card =150) 5 1 TABLE ACCESS (BY INDEX ROWID) OF 'DATA_FILES' (Cost=2 Ca rd=1 Bytes=9) 6 5 INDEX (UNIQUE SCAN) OF 'FI_PK' (UNIQUE) (Cost=1 Card=2 )

Fermilab Jan 27, 2005LHC Database Workshop21 Partitioning u Partitioning has been implemented for very large table(s) in the database. e.g. The D0 Event table, which records trigger information u The Event table is count partitioned with each partition containing 50M events. Each partition’s data and index are stored in its own tablespaces. u Benefits of partitioning are twofold, u It improves query optimization. The optimizer, knowing that the table has been partitioned, directs the server to only access data from that partition. u Increases backup performance. Backup performance is achieved because once a partition is “rolled over”, its data and index tablespaces are converted to READ ONLY. READ ONLY tablespaces are only backed up twice a month, and are excluded from READ WRITE tablespaces backup, thus reducing the time for daily database and tape backups. Currently, over 1 billion events are distributed over 25 partitions in the database, and a new partition is added roughly once every three weeks. The growth of partitions in the D0 Event table is shown in Figure 1.

Fermilab Jan 27, 2005LHC Database Workshop22 Partitioning – Contd u Figure 1

Fermilab Jan 27, 2005LHC Database Workshop23 Load Balance Via Replication u CDF deployed oracle replication to copy the online instances of the database to the offline, is shown in Figure 2. u CDF is also pursuing a web caching technique through the Frontier project that will greatly improve the performance of their read-only database access, especially to clients located geographically distant to Fermi Lab.

Fermilab Jan 27, 2005LHC Database Workshop24 CDF Db Current Scenario On-line DB (cdfonprd) CDF Basic Replication Off-line DB (cdfofprd) Off-line DB (cdfrep01) SAM+DFC Farm Users On-line Users CAF and Others Failover for Read Service 4 Applications 4apps Fig 2

Fermilab Jan 27, 2005LHC Database Workshop25 Monitoring u Oracle Enterprise Manager (OEM) u OEM is tool by Oracle Corp. to monitor the oracle databases. OEM Monitors: u Node up and down. u Database Listener down u Intelligent Agent u Number of storage extents. u Space u Database Alerts – Db down, file corruption u Number of concurrent sessions u The space usage u CPU usage u Memory Usage u Hit ratios for Library, Buffer Cache etc. u Plots the monitoring graphs. Graphs can be posted on the web.

Fermilab Jan 27, 2005LHC Database Workshop26 Monitoring TOOLMAN/DBATOOLS/TOOLMAN DB u The toolman utility is designed to provide an alternative method for monitoring Oracle databases that does not share a common point of failure with the Oracle. u Unlike OEM, it has no GUI and is implemented as shell and SQL scripts. This provides a higher level of database,monitoring, perhaps at the expense of redundant alerting. u Toolman also provides ongoing routine maintenance for a database by executing a series of cron jobs that automatically perform basic Oracle maintenance activities. u Further, toolman provides a source of historical data and ongoing monitoring should a machine be isolated from the network and otherwise unavailable to OEM. u Customization of Toolman. Toolman can be customized in several ways for the machine and databases it monitors

Fermilab Jan 27, 2005LHC Database Workshop27 Special Features u Sniping u Login Traces u Capacity Planning

Fermilab Jan 27, 2005LHC Database Workshop28 Sniping - Specific inactive sessions since a specific time are terminated and notification with complete session info is sent to user that session is terminated. - This feature helped in lowering the number of sessions to db. Some times db used to become unusable due to limited number of processes. - There are rules for each database which user’s session and which program need to be sniped. - Also this helped in tune the code so that API will connect to db if data from database is needed, otherwise disconnects.

Fermilab Jan 27, 2005LHC Database Workshop29 Login Trace - On the database level each logon and logout is tracked with session info including CPU used by the session. - This information is used to track top CPU users of the database and number of connections over a given period of time.

Fermilab Jan 27, 2005LHC Database Workshop30 Capacity Planning - On weekly basis, a cron job tracks the space usage by each object in the database. - This data is plotted to find the growth of each application over a period of time. - This data is analyzed to project the future growth of the databases.

Fermilab Jan 27, 2005LHC Database Workshop31 CDF Db Capacity Planning

Fermilab Jan 27, 2005LHC Database Workshop32 D0 Db Capacity Planning

Fermilab Jan 27, 2005LHC Database Workshop33 Summary u System Admin should work together with DBAs to define the disk layout as per OFA. u Application Developers should work together with DBAs to define integral Data Model for the application. u Tuned Code is important Key for tuned Servers. u DBAs and Application owner should play a proactive role in capacity planning. u DBAs should be proactive in monitoring and tuning the Server.