SQL Server - Review Managing the System. Objectives  Understand the importance of maintenance plans.  Check for database consistency.  Understand how.

Slides:



Advertisements
Similar presentations
Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
Advertisements

Chapter 10: Designing Databases
BUSINESS DRIVEN TECHNOLOGY Plug-In T4 Designing Database Applications.
Database Management System MIS 520 – Database Theory Fall 2001 (Day) Lecture 13.
Monday, 08 June 2015Dr. Mohamed Osman1 What is Database Administration A high level function (technical Function) that is responsible for ► physical DB.
Getting Started (Excerpts) Chapter One DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.
Getting Started Chapter One DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 5 th Edition.
Getting Started Chapter One DATABASE CONCEPTS, 7th Edition
BUSINESS DRIVEN TECHNOLOGY
Mgt 20600: IT Management & Applications Databases Tuesday April 4, 2006.
Database Administration Chapter 16. Need for Databases  Data is used by different people, in different departments, for different reasons  Interpretation.
PHASE 3: SYSTEMS DESIGN Chapter 7 Data Design.
Getting Started Chapter One DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 6 th Edition.
Maintaining a Microsoft SQL Server 2008 Database SQLServer-Training.com.
1 DATABASE TECHNOLOGIES BUS Abdou Illia, Fall 2007 (Week 3, Tuesday 9/4/2007)
Database Lecture # 1 By Ubaid Ullah.
Systems analysis and design, 6th edition Dennis, wixom, and roth
ASP.NET Programming with C# and SQL Server First Edition
PHP Programming with MySQL Slide 8-1 CHAPTER 8 Working with Databases and MySQL.
IT The Relational DBMS Section 06. Relational Database Theory Physical Database Design.
DATABASE UTILITIES. D ATABASE S YSTEM U TILITIES In addition to possessing the software modules most DBMSs have database utilities that help the DBA in.
An Investigation of Oracle and SQL Server with respect to Integrity, and SQL Language standards Presented by: Paul Tarwireyi Supervisor: John Ebden Date:
Chapter 1 Overview of Database Concepts Oracle 10g: SQL
Database Technical Session By: Prof. Adarsh Patel.
1 INTRODUCTION TO DATABASE MANAGEMENT SYSTEM L E C T U R E
1 Introduction to Database Systems. 2 Database and Database System / A database is a shared collection of logically related data designed to meet the.
1 Chapter 1 Overview of Database Concepts. 2 Chapter Objectives Identify the purpose of a database management system (DBMS) Distinguish a field from a.
TM 7-1 Copyright © 1999 Addison Wesley Longman, Inc. Physical Database Design.
Database Management. ICT5 Database Administration (DBA) The DBA’s tasks will include the following: 1. The design of the database. After the initial design,
Lecture 2 An Overview of Relational Database IST 318 – DB Admin.
RDBMS Concepts/ Session 3 / 1 of 22 Objectives  In this lesson, you will learn to:  Describe data redundancy  Describe the first, second, and third.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 4th Edition Copyright © 2009 John Wiley & Sons, Inc. All rights.
Discovering Computers Fundamentals Fifth Edition Chapter 9 Database Management.
Storing Organizational Information - Databases
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
MIS 327 Database Management system 1 MIS 327: DBMS Dr. Monther Tarawneh Dr. Monther Tarawneh Week 2: Basic Concepts.
Dimu' Rumpak © 2009 by Prentice Hall 1 Getting Started Didimus Rumpak, M.Si. Database Concepts Chapter 1 1.
1 Database Concepts 2 Definition of a Database An organized Collection Of related records.
Database Management System (DBMS) an Introduction DeSiaMore 1.
Getting Started Chapter One DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Chapter 7 Storing Organizational Information - Databases.
Database Management COP4540, SCS, FIU Physical Database Design (ch. 16 & ch. 3)
Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
Database Administration
Database Management Supplement 1. 2 I. The Hierarchy of Data Database File (Entity, Table) Record (info for a specific entity, Row) Field (Attribute,
Lection №4 Development of the Relational Databases.
BSA206 Database Management Systems Lecture 2: Introduction to Oracle / Overview of Database Concepts.
Constraints Lesson 8. Skills Matrix Constraints Domain Integrity: A domain refers to a column in a table. Domain integrity includes data types, rules,
Session 1 Module 1: Introduction to Data Integrity
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 5th Edition Copyright © 2015 John Wiley & Sons, Inc. All rights.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 1 Database Systems.
Introduction to Core Database Concepts Getting started with Databases and Structure Query Language (SQL)
SQL Triggers, Functions & Stored Procedures Programming Operations.
uses of DB systems DB environment DB structure Codd’s rules current common RDBMs implementations.
1 Management Information Systems M Agung Ali Fikri, SE. MM.
SQL Basics Review Reviewing what we’ve learned so far…….
Building the Corporate Data Warehouse Pindaro Demertzoglou Lally School of Management Data Resource Management.
1 Section 1 - Introduction to SQL u SQL is an abbreviation for Structured Query Language. u It is generally pronounced “Sequel” u SQL is a unified language.
1 Copyright © 2005, Oracle. All rights reserved. Oracle Database Administration: Overview.
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
SQL Database Management
Client/Server Databases and the Oracle 10g Relational Database
Physical Changes That Don’t Change the Logical Design
Information Systems Today: Managing in the Digital World
Introduction of Week 6 Assignment Discussion
Normalization Referential Integrity
Teaching slides Chapter 8.
Physical Database Design
The ultimate in data organization
Presentation transcript:

SQL Server - Review Managing the System

Objectives  Understand the importance of maintenance plans.  Check for database consistency.  Understand how and when to use SQL Server Profiler.  Understand the components of SQL Server Agent.  View SQL Server Agent Configuration Manager options.  Configure SQL Server Agent properties.  Configure SQL Server Agent to automate the administration of SQL Server  Create and configure jobs, alerts and operators by using SQL Server Agent  Monitor hardware resource usage and SQL Server activity by using the Windows System Monitor  Understand the importance of maintenance plans.  Check for database consistency.  Understand how and when to use SQL Server Profiler.  Understand the components of SQL Server Agent.  View SQL Server Agent Configuration Manager options.  Configure SQL Server Agent properties.  Configure SQL Server Agent to automate the administration of SQL Server  Create and configure jobs, alerts and operators by using SQL Server Agent  Monitor hardware resource usage and SQL Server activity by using the Windows System Monitor

SQL Server Administrator’s Duties  Install and configure SQL Server  Plan and create databases  Back up the databases  Restore the databases when necessary  Set up and manage users for SQL Server  Manage security for new users and existing users  Import and export data  Set up and manage tasks, alerts, and operators  Manage the replication environment  Tune the SQL Server system for the optimal performance  Troubleshoot any SQL Server problems  Install and configure SQL Server  Plan and create databases  Back up the databases  Restore the databases when necessary  Set up and manage users for SQL Server  Manage security for new users and existing users  Import and export data  Set up and manage tasks, alerts, and operators  Manage the replication environment  Tune the SQL Server system for the optimal performance  Troubleshoot any SQL Server problems

SQL Server Administrative Duties User Mgmt Auditing DR - Backup DR - Recovery Archiving Security Data Mgmt Tuning

SQL Server Administrator’s Duties (Defined)  Installation, Administration and Maintenance of SQL Server Instances. (Installing SQL Server)  Setup Test, Dev, Staging and Production Environments. (Installing SQL Server)  Create Users and assign permissions based on the level of database access the user would need. (Security)  Create Linked Servers to SQL Servers and other databases such as Oracle, Access, Informix etc. (Security and General Administration)  Design database Backup and Restoration Strategy. (Database Backups and SQL Server Agent)  Once created the database Backups, monitor those backups are being performed regularly. (SQL Server Agent)  Installation, Administration and Maintenance of SQL Server Instances. (Installing SQL Server)  Setup Test, Dev, Staging and Production Environments. (Installing SQL Server)  Create Users and assign permissions based on the level of database access the user would need. (Security)  Create Linked Servers to SQL Servers and other databases such as Oracle, Access, Informix etc. (Security and General Administration)  Design database Backup and Restoration Strategy. (Database Backups and SQL Server Agent)  Once created the database Backups, monitor those backups are being performed regularly. (SQL Server Agent)

SQL Server Administrator’s Duties (Defined)  From time to time recover the databases to a specific point of time, as per the requests. (Database Backups and Recovery)  Setup High-Availability as part Disaster Recovery Strategy for the Databases. (Failover Clustering, Database Mirroring, Log Shipping and Replication)  Troubleshoot various problems that arise in a day-to-day work and fix the issues. (Monitoring SQL Server Error Logs and checking your alert (if there is one configured))  Monitoring and Performance Tuning; Physical Server Level, Database level (Database settings and options) and query tuning. (Creating and maintaining those Indexes, not performing database shrinking, memory settings, monitoring CPU usage and Disk I/O activity etc)  Documenting major changes to the SQL Servers. (General)  Apply Service Packs. (General)  From time to time recover the databases to a specific point of time, as per the requests. (Database Backups and Recovery)  Setup High-Availability as part Disaster Recovery Strategy for the Databases. (Failover Clustering, Database Mirroring, Log Shipping and Replication)  Troubleshoot various problems that arise in a day-to-day work and fix the issues. (Monitoring SQL Server Error Logs and checking your alert (if there is one configured))  Monitoring and Performance Tuning; Physical Server Level, Database level (Database settings and options) and query tuning. (Creating and maintaining those Indexes, not performing database shrinking, memory settings, monitoring CPU usage and Disk I/O activity etc)  Documenting major changes to the SQL Servers. (General)  Apply Service Packs. (General)

Relational Database Management System (RDBMS)  RDBMS stands for Relational Database Management System. RDBMS data is structured in database tables, fields and records. Each RDBMS table consists of database table rows. Each database table row consists of one or more database table fields.  RDBMS store the data into collection of tables, which might be related by common fields (database table columns). RDBMS also provide relational operators to manipulate the data stored into the database tables. Most RDBMS use SQL as database query language.SQL  Edgar Codd introduced the relational database model. Many modern DBMS do not conform to the Codd’s definition of a RDBMS, but nonetheless they are still considered to be RDBMS.  The most popular RDBMS are MS SQL Server, DB2, Oracle and MySQL.  RDBMS stands for Relational Database Management System. RDBMS data is structured in database tables, fields and records. Each RDBMS table consists of database table rows. Each database table row consists of one or more database table fields.  RDBMS store the data into collection of tables, which might be related by common fields (database table columns). RDBMS also provide relational operators to manipulate the data stored into the database tables. Most RDBMS use SQL as database query language.SQL  Edgar Codd introduced the relational database model. Many modern DBMS do not conform to the Codd’s definition of a RDBMS, but nonetheless they are still considered to be RDBMS.  The most popular RDBMS are MS SQL Server, DB2, Oracle and MySQL.

RDBMS Objects - Tables  You already know that the table is the central RDBMS object. In a perfect world you would never have to change anything in a table's structure after it was created. In real life though you need to modify table definitions quite often. Changing business rules are usually the main reason; incorrect initial design is also not uncommon, especially in test environments. The whole idea behind the ALTER TABLE statement is to make the table definition changes as fast and as painless as possible. The DROP TABLE statement is used to remove a table (both its data and definition) from the database.

Planning Your Database  Designing a database requires an understanding of both the business functions you want to model and the database concepts and features used to represent those business functions.  It is important to accurately design a database to model the business because it can be time consuming to change the design of a database significantly once implemented. A well-designed database also performs better. When designing a database, consider: The purpose of the database and how it affects the design. Create a database plan to fit your purpose.  Database normalization rules that prevent mistakes in the database design  Protection of your data integrity  Security requirements of the database and user permissions  Performance needs of the application  Designing a database requires an understanding of both the business functions you want to model and the database concepts and features used to represent those business functions.  It is important to accurately design a database to model the business because it can be time consuming to change the design of a database significantly once implemented. A well-designed database also performs better. When designing a database, consider: The purpose of the database and how it affects the design. Create a database plan to fit your purpose.  Database normalization rules that prevent mistakes in the database design  Protection of your data integrity  Security requirements of the database and user permissions  Performance needs of the application

Software Development Life Cycle (SDLC)  Software life cycle models describe phases of the software cycle and the order in which those phases are executed. Each phase produces deliverables required by the next phase in the life cycle. Requirements are translated into design. Code is produced according to the design which is called development phase. After coding and development the testing verifies the deliverable of the implementation phase against requirements.  There are following six phases in every Software Development Life Cycle model:  Requirement gathering and analysis  Design  Implementation or coding  Testing  Deployment - Evolution  Maintenance  Software life cycle models describe phases of the software cycle and the order in which those phases are executed. Each phase produces deliverables required by the next phase in the life cycle. Requirements are translated into design. Code is produced according to the design which is called development phase. After coding and development the testing verifies the deliverable of the implementation phase against requirements.  There are following six phases in every Software Development Life Cycle model:  Requirement gathering and analysis  Design  Implementation or coding  Testing  Deployment - Evolution  Maintenance

Software Development Life Cycle

Step 1 : Project Planning Step 2 : Present Project to BUG Step 3 : Project Specificati ons Step 4 : Development & Coding Step 5 : Testing Step 6 : Final Approval Process Step 7 : DBA Deploy to Production RequirementsDesignDevelopmentTestDeployment SCF Administrative Services – Software Development Lifecycle (SLDC) 1 – Project Initiation Banner Project Request Form Filled out and submitted Initial Requirements gathered Data Custodian Meetings established Resources Estimated 2 – Project Approval Present Project to BUG Further define requirements based on BUG feedback 3 – Project Documentation Helpdesk Ticket Open with Initial Requirements (Project Classification) Requirements completely defined Software Design Specifications Requirements Traceability Matrix 5 – Project Testing Deployment Instructions Deployed to BIWK for testing and user feedback 6 – Project Completion User approval for Production Request submitted to Change Management Meeting (Wednesdays) Coordination of push to Production

SDLC – Database Design

Normalization  The logical design of the database, including the tables and the relationships between them, is the core of an optimized relational database. A good logical database design can lay the foundation for optimal database and application performance. A poor logical database design can impair the performance of the entire system.  Normalizing a logical database design involves using formal methods to separate the data into multiple, related tables. A greater number of narrow tables (with fewer columns) is characteristic of a normalized database. A few wide tables (with more columns) are characteristics of an non-normalized database.  In relational-database design theory, normalization rules identify certain attributes that must be present or absent in a well-designed database. A complete discussion of normalization rules goes well beyond the scope of this topic. However, there are a few rules that can help you achieve a sound database design: A table should have a numeric or uniqueidentifier (GUID) primary key  A table should store only data for a single type of entity (all fields should relate directly to the key) For example: Avoid storing information about a student and his/her test scores in the same table  A table should avoid nullable columns  A table should use default values where appropriate  A table should not have repeating values or columns For example: TEST_SCORE_1, TEST_SCORE_2 and so on  As normalization increases, so do the number and complexity of joins required to retrieve data. Too many complex relational joins between too many tables can hinder performance. Reasonable normalization often includes few regularly executed queries that use joins involving more than four tables.  The logical design of the database, including the tables and the relationships between them, is the core of an optimized relational database. A good logical database design can lay the foundation for optimal database and application performance. A poor logical database design can impair the performance of the entire system.  Normalizing a logical database design involves using formal methods to separate the data into multiple, related tables. A greater number of narrow tables (with fewer columns) is characteristic of a normalized database. A few wide tables (with more columns) are characteristics of an non-normalized database.  In relational-database design theory, normalization rules identify certain attributes that must be present or absent in a well-designed database. A complete discussion of normalization rules goes well beyond the scope of this topic. However, there are a few rules that can help you achieve a sound database design: A table should have a numeric or uniqueidentifier (GUID) primary key  A table should store only data for a single type of entity (all fields should relate directly to the key) For example: Avoid storing information about a student and his/her test scores in the same table  A table should avoid nullable columns  A table should use default values where appropriate  A table should not have repeating values or columns For example: TEST_SCORE_1, TEST_SCORE_2 and so on  As normalization increases, so do the number and complexity of joins required to retrieve data. Too many complex relational joins between too many tables can hinder performance. Reasonable normalization often includes few regularly executed queries that use joins involving more than four tables.

Data Integrity  Enforcing data integrity ensures the quality of the data in the database. One of the more common forms of data integrity is referential integrity.  Referential integrity preserves the defined relationships between tables when records are entered or deleted. In Microsoft SQL Server, referential integrity is based on relationships between foreign keys and primary keys or between foreign keys and unique keys. Referential integrity ensures that key values are consistent across tables. Such consistency requires that there be no references to nonexistent values and that if a key value changes, all references to it change consistently throughout the database.  Enforcing data integrity ensures the quality of the data in the database. One of the more common forms of data integrity is referential integrity.  Referential integrity preserves the defined relationships between tables when records are entered or deleted. In Microsoft SQL Server, referential integrity is based on relationships between foreign keys and primary keys or between foreign keys and unique keys. Referential integrity ensures that key values are consistent across tables. Such consistency requires that there be no references to nonexistent values and that if a key value changes, all references to it change consistently throughout the database.

Data Security  One of the functions of a database is to protect the data by preventing certain users from seeing or changing highly sensitive data and preventing all users from making costly mistakes. For this reason, each application will use a separate user with specific permissions to only the data needed to provide a successful implementation.

Database Performance  When you design a database, you must ensure that the database performs all the important functions correctly and quickly. Some performance issues can be resolved after the database is in production, but other performance issues may be the result of a poor database design and can be addressed only by changing the structure and design of the database.  When you design and implement a database, you should identify the large tables in the database and the more complex processes that the database will perform, and give special consideration to performance when designing these tables. Also consider the effect on performance of increasing the number of users who can access the database.  In conjunction with correct database design, correct use of indexes is important for achieving good performance.  Indexes in databases are similar to indexes in books. In a book, an index allows you to find information quickly without reading the entire book. In a database, an index allows the database program to find data in a table without scanning the entire table. An index in a book is a list of words with the page numbers that contain each word. An index in a database is a list of values in a table with the storage locations of rows in the table that contain each value. Indexes can be created on either a single column or a combination of columns in a table. An index contains an entry with one or more columns (the search key) from each row in a table.  When you design a database, you must ensure that the database performs all the important functions correctly and quickly. Some performance issues can be resolved after the database is in production, but other performance issues may be the result of a poor database design and can be addressed only by changing the structure and design of the database.  When you design and implement a database, you should identify the large tables in the database and the more complex processes that the database will perform, and give special consideration to performance when designing these tables. Also consider the effect on performance of increasing the number of users who can access the database.  In conjunction with correct database design, correct use of indexes is important for achieving good performance.  Indexes in databases are similar to indexes in books. In a book, an index allows you to find information quickly without reading the entire book. In a database, an index allows the database program to find data in a table without scanning the entire table. An index in a book is a list of words with the page numbers that contain each word. An index in a database is a list of values in a table with the storage locations of rows in the table that contain each value. Indexes can be created on either a single column or a combination of columns in a table. An index contains an entry with one or more columns (the search key) from each row in a table.

SQL – Querying the Database

Example – Employee Table  What could be done better with this table design?