Working with SQL and PL/SQL/ Session 1 / 1 of 27 SQL Server Architecture.

Slides:



Advertisements
Similar presentations
Yukon – What is New Rajesh Gala. Yukon – What is new.NET Framework Programming Data Types Exception Handling Batches Databases Database Engine Administration.
Advertisements

CIT 613: Relational Database Development using SQL Introduction to SQL.
Advantage Data Dictionary. agenda Creating and Managing Data Dictionaries –Tables, Indexes, Fields, and Triggers –Defining Referential Integrity –Defining.
Introduction to Structured Query Language (SQL)
Client/Server Databases and the Oracle 10g Relational Database
Introduction to Structured Query Language (SQL)
Fundamentals, Design, and Implementation, 9/e Chapter 11 Managing Databases with SQL Server 2000.
Fundamentals, Design, and Implementation, 9/e Chapter 1 Introduction to Database Processing.
Introduction to Structured Query Language (SQL)
BUSINESS DRIVEN TECHNOLOGY
Chapter 1 Introduction to Databases
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Session 7 Creating and Managing Databases. RDBMS and Data Management/ Session 7/2 of 27 Session Objectives Describe the system and user-defined databases.
Introduction to Databases and Database Languages
Chapter 4 SQL. SQL server Microsoft SQL Server is a client/server database management system. Microsoft SQL Server is a client/server database management.
Database Lecture # 1 By Ubaid Ullah.
Chapter 9 SQL and RDBMS Part C. SQL Copyright 2005 Radian Publishing Co.
6-1 DATABASE FUNDAMENTALS Information is everywhere in an organization Information is stored in databases –Database – maintains information about various.
ASP.NET Programming with C# and SQL Server First Edition
Chapter 2: Designing Physical Storage MCITP Administrator: Microsoft SQL Server 2005 Database Server Infrastructure Design Study Guide (70-443)
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 7 INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) Instructor Ms. Arwa.
 SQL stands for Structured Query Language.  SQL lets you access and manipulate databases.  SQL is an ANSI (American National Standards Institute) standard.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
I Copyright © 2004, Oracle. All rights reserved. Introduction.
An Investigation of Oracle and SQL Server with respect to Integrity, and SQL Language standards Presented by: Paul Tarwireyi Supervisor: John Ebden Date:
Database Technical Session By: Prof. Adarsh Patel.
Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations.
I Copyright © Oracle Corporation, All rights reserved. Introduction.
Agenda for Today Chapter 5 –Skip Lesson 2 Review questions Midterm Chapter 6 Review questions.
Chapter 7 Working with Databases and MySQL PHP Programming with MySQL 2 nd Edition.
Databases Lesson 5.
Architecture Rajesh. Components of Database Engine.
1 SQL Server 2000 Administration Kashef Mughal MSB.
Discovering Computers Fundamentals Fifth Edition Chapter 9 Database Management.
Storing Organizational Information - Databases
7 1 Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
Lecture # 3 & 4 Chapter # 2 Database System Concepts and Architecture Muhammad Emran Database Systems 1.
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
Database structure and space Management. Database Structure An ORACLE database has both a physical and logical structure. By separating physical and logical.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
SQL Fundamentals  SQL: Structured Query Language is a simple and powerful language used to create, access, and manipulate data and structure in the database.
Indexes / Session 2/ 1 of 36 Session 2 Module 3: Types of Indexes Module 4: Maintaining Indexes.
Chapter 4 Constraints Oracle 10g: SQL. Oracle 10g: SQL 2 Objectives Explain the purpose of constraints in a table Distinguish among PRIMARY KEY, FOREIGN.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
Visual Programing SQL Overview Section 1.
SQL Jan 20,2014. DBMS Stores data as records, tables etc. Accepts data and stores that data for later use Uses query languages for searching, sorting,
Session 1 Module 1: Introduction to Data Integrity
CIT 613: Relational Database Development using SQL Introduction to SQL DeSiaMorePowered by DeSiaMore 1.
Copyright (c) 2014 Pearson Education, Inc. Introduction to DBMS.
Hands-On Microsoft Windows Server 2008 Chapter 7 Configuring and Managing Data Storage.
LM 5 Introduction to SQL MISM 4135 Instructor: Dr. Lei Li.
Introduction to Core Database Concepts Getting started with Databases and Structure Query Language (SQL)
Advanced Database & Client Server Introduction to MS SQL Server 2000 and Transact SQL -
Enterprise Database Systems Introduction to SQL Server Dr. Georgia Garani Dr. Theodoros Mitakos Technological.
SQL Basics Review Reviewing what we’ve learned so far…….
In this session, you will learn to: Manage databases Manage tables Objectives.
Agenda for Today  DATABASE Definition What is DBMS? Types Of Database Most Popular Primary Database  SQL Definition What is SQL Server? Versions Of SQL.
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
Understanding Core Database Concepts Lesson 1. Objectives.
Fundamentals of DBMS Notes-1.
Client/Server Databases and the Oracle 10g Relational Database
The Basics of Data Manipulation
SQL Server 2000 and Access 2000 limits
Introduction To Database Systems
DATABASE MANAGEMENT SYSTEM
The Basics of Data Manipulation
Chapter 11 Managing Databases with SQL Server 2000
Understanding Core Database Concepts
INTRODUCTION A Database system is basically a computer based record keeping system. The collection of data, usually referred to as the database, contains.
Presentation transcript:

Working with SQL and PL/SQL/ Session 1 / 1 of 27 SQL Server Architecture

Working with SQL and PL/SQL/ Session 1 / 2 of 27 Objective  Relational Database Components  Database Architecture  Logical Database Components  System Databases and Data  Physical Database Architecture  Physical Database Files and Filegroups  Transaction Log Architecture

Working with SQL and PL/SQL/ Session 1 / 3 of 27 Introduction  In 1980’s Microsoft & Sybase teamed up to create SQL Server.  After release of version 6.5, they both separated.  It is SQL – compliant RDBMS. ( Uses ANSI version of SQL)  It supports the Client Server Model.

Working with SQL and PL/SQL/ Session 1 / 4 of 27 Relational features of SQL Server  Information representation.  Unique definition of rows.  Systematic treatment of NULL values.  Guaranteed access  High level Update, Insert and Delete.  Security  Login authentication  Permissions validation on user database.

Working with SQL and PL/SQL/ Session 1 / 5 of 27 Relational Database Components  The database component of Microsoft SQL Server 2000 is a Structured Query Language (SQL)–based, scalable, relational database with integrated Extensible Markup Language (XML) support for Internet applications.  Each of the following terms describes a fundamental part of the architecture of the SQL Server 2000 database component:

Working with SQL and PL/SQL/ Session 1 / 6 of 27 Database  A database is a storage place for data. The database does not present information directly to a user; the user runs an application that accesses data from the database and presents it to the user in an understandable format.  A database typically has two main parts: first, the files holding the physical database and second, the database management system (DBMS) software that applications use to access data.

Working with SQL and PL/SQL/ Session 1 / 7 of 27  The DBMS is responsible for enforcing the database structure, including:  Maintaining relationships between data in the database.  Ensuring that data is stored correctly, and that the rules defining data relationships are not violated.  Recovering all data to a point of known consistency in case of system failures.

Working with SQL and PL/SQL/ Session 1 / 8 of 27 Scalable  SQL Server 2000 supports having a wide range of users access it at the same time. An instance of SQL Server 2000 includes the files that make up a set of databases and a copy of the DBMS software.  Applications running on separate computers use a SQL Server 2000 communications component to transmit commands over a network to the SQL Server 2000 instance.

Working with SQL and PL/SQL/ Session 1 / 9 of 27 Structured Query Language  To work with data in a database, you have to use a set of commands and statements (language) defined by the DBMS software ; the most common is SQL.  The American National Standards Institute (ANSI) and the International Standards Organization (ISO) define software standards, including standards for the SQL language.

Working with SQL and PL/SQL/ Session 1 / 10 of 27  The dialect of SQL supported by Microsoft SQL Server is called Transact- SQL (T-SQL). T-SQL is the primary language used by Microsoft SQL Server applications.  Elements of Transact SQL:  DDL  DML  DCL  TCL

Working with SQL and PL/SQL/ Session 1 / 11 of 27 Extensible Markup Language  Although most SQL statements return their results in a relational, or tabular, result set, the SQL Server 2000 database component supports a FOR XML clause that returns results as an XML document. XML documents can be added to SQL Server databases, and the OPENXML clause can be used to expose data from an XML document as a relational result set.

Working with SQL and PL/SQL/ Session 1 / 12 of 27 Database Architecture  Microsoft® SQL Server™ 2000 data is stored in databases. The data in a database is organized into the logical components visible to users. A database is also physically implemented as two or more files on disk.  When using a database, you work primarily with the logical components such as tables, views, procedures, and users. The physical implementation of files is largely transparent.

Working with SQL and PL/SQL/ Session 1 / 13 of 27  Each instance of SQL Server has four system databases (master, model, tempdb, and msdb) and one or more user databases.  It is not necessary to run multiple copies of the SQL Server database engine to allow multiple users to access the databases on a server.  An instance of the SQL Server Standard or Enterprise Edition is capable of handling thousands of users working in multiple databases at the same time.

Working with SQL and PL/SQL/ Session 1 / 14 of 27 Logical Database Components  The data in a Microsoft SQL Server 2000 database is organized into several different objects.  Tables  Constraints  Indexes  Defaults  Triggers, Stored procedures, Views  Keys  User-defined functions  User-defined data types

Working with SQL and PL/SQL/ Session 1 / 15 of 27 Physical Database Architecture  The fundamental unit of data storage in Microsoft SQL Server is the page. In SQL Server 2000, the page size is 8 KB.  The start of each page is a 96-byte header used to store system information, such as the type of page, the amount of free space on the page, and the object ID of the object owning the page

Working with SQL and PL/SQL/ Session 1 / 16 of 27 Continued..  Data pages contain all the data in data rows except text, ntext, and image data, which is stored in separate pages.  Data rows are placed serially on the page starting immediately after the header.  A row offset table starts at the end of the page. The row offset table contains one entry for each row on the page and each entry records how far the first byte of the row is from the start of the page.

Working with SQL and PL/SQL/ Session 1 / 17 of 27  Rows cannot span pages in SQL Server. In SQL Server 2000, the maximum amount of data contained in a single row is 8060 bytes, not including text, ntext, and image data  Extents are the basic unit in which space is allocated to tables and indexes. An extent is 8 contiguous pages, or 64 KB.

Working with SQL and PL/SQL/ Session 1 / 18 of 27 Physical Database Files and Filegroups  SQL Server 2000 databases have three types of files: 1.Primary data files  This file contains all of the system tables and other system objects. Also contains links to all secondary data files & log files.  Microsoft recommends that most databases will work very well with only a single primary data file & log file.  The recommended file name extension for primary data files is.mdf.

Working with SQL and PL/SQL/ Session 1 / 19 of 27 2.Secondary data files  Secondary data files comprise all of the data files other than the primary data file. Some databases may not have any secondary data files, while others have multiple secondary data files.  Used to spread data over multiple disks.  The recommended file name extension for secondary data files is.ndf.

Working with SQL and PL/SQL/ Session 1 / 20 of 27 3.Log files  Log files hold all of the log information used to recover the database. There must be at least one log file for each database, although there can be more than one.  If the server fails because of a power outage or other problem, SQL Server automatically recovers the database by applying committed transactions.  The recommended file name extension for log files is.ldf.

Working with SQL and PL/SQL/ Session 1 / 21 of 27  SQL Server 2000 files have two names: 1.logical_file_name is a name used to refer to the file in all Transact-SQL statements.  The logical file name must conform to the rules for SQL Server identifiers and must be unique to the database. 2.os_file_name is the name of the physical file.  It must follow the rules for Microsoft Windows NT or Microsoft Windows 98, and Microsoft Windows 95 file names.

Working with SQL and PL/SQL/ Session 1 / 22 of 27 Database Filegroups  Database files can be grouped together in filegroups for allocation and administration purposes.  Some systems can improve their performance by controlling the placement of data and indexes onto specific disk drives.  The administrator can create filegroups for each disk drive, then assign specific tables, indexes, or the text, ntext, or image data from a table, to specific filegroups.

Working with SQL and PL/SQL/ Session 1 / 23 of 27  There are two types of filegroups: 1.Primary  The primary filegroup contains the primary data file and any other files not specifically assigned to another filegroup. All pages for the system tables are allocated in the primary filegroup. 2.User-defined  User-defined filegroups are any filegroups specified using the FILEGROUP keyword in a CREATE DATABASE or ALTER DATABASE statement.

Working with SQL and PL/SQL/ Session 1 / 24 of 27  One filegroup in each database operates as the default filegroup. When SQL Server allocates a page to a table or index for which no filegroup was specified when they were created, the pages are allocated from the default filegroup.  Only one filegroup at a time can be the default filegroup. If no default filegroup is specified, the primary filegroup is the default filegroup.

Working with SQL and PL/SQL/ Session 1 / 25 of 27 The Syntax:  CREATE DATABASE database_name [ ON [ PRIMARY] ( [ ……] ) [ LOG ON ] ( [ <filespec …..] ) ]

Working with SQL and PL/SQL/ Session 1 / 26 of 27 Creating Database CREATE DATABASE MyDB ON PRIMARY ( NAME='MyDB_Primary', FILE NAME= 'c:\data\MyDB_Prm.mdf', SIZE=4, MAXSIZE=10, FILEGROWTH=1)

Working with SQL and PL/SQL/ Session 1 / 27 of 27 LOG ON ( NAME='MyDB_log', FILE NAME = 'c:\data\MyDB.ldf', SIZE=1, MAXSIZE=10, FILEGROWTH=1)