Agenda for Today Chapter 5 –Skip Lesson 2 Review questions Midterm Chapter 6 Review questions.

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

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 9-1 COS 346 Day 20.
Module 4 Working with Databases. Module Overview Overview of SQL Server Databases Working with Files and Filegroups Moving Database Files.
Tables Lesson 6. Skills Matrix Tables Tables store data. Tables are relational –They store data organized as row and columns. –Data can be retrieved.
Module 3: Creating and Managing Databases. Overview Creating Databases Creating Filegroups Managing Databases Introduction to Data Structures.
Fundamentals, Design, and Implementation, 9/e Chapter 11 Managing Databases with SQL Server 2000.
Physical Database Monitoring and Tuning the Operational System.
A Guide to Oracle9i1 Advanced SQL And PL/SQL Topics Chapter 9.
Concepts of Database Management Sixth Edition
Working with SQL and PL/SQL/ Session 1 / 1 of 27 SQL Server Architecture.
AGENDA Tools used in SQL Server 2000 Graphical BOL Enterprise Manager Service Manager CLI Query Analyzer OSQL BCP.
Database Configuration and Maintenance Database Configuration and Maintenance Exam / 30.
Session 7 Creating and Managing Databases. RDBMS and Data Management/ Session 7/2 of 27 Session Objectives Describe the system and user-defined databases.
Chapter 2 Administrating DB Engine. Database Engine  The Database Engine is the core service for storing, processing, and securing data.  It provides.
Today’s Agenda Chapter 12 Admin Tasks Chapter 13 Automating Admin Tasks.
Module 9: Managing Schema Objects. Overview Naming guidelines for identifiers in schema object definitions Storage and structure of schema objects Implementing.
SQL Server 2008 Implementation and Maintenance Chapter 7: Performing Backups and Restores.
Chapter 10 : Designing a SQL Server 2005 Solution for High Availability MCITP Administrator: Microsoft SQL Server 2005 Database Server Infrastructure Design.
Storage and NT File System INFO333 – Lecture Mariusz Nowostawski Noria Foukia.
1 Chapter Overview Creating a User Database Setting Database Options Managing User Database Size Placing Database Files on Multiple Disks.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 13 Managing Databases with SQL Server 2000.
Chapter 4 SQL. SQL server Microsoft SQL Server is a client/server database management system. Microsoft SQL Server is a client/server database management.
With Microsoft Office 2007 Intermediate© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Intermediate.
Introduction to Databases Chapter 8: Improving Data Access.
With Microsoft Access 2007 Volume 1© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter.
Chapter 2: Designing Physical Storage MCITP Administrator: Microsoft SQL Server 2005 Database Server Infrastructure Design Study Guide (70-443)
Module 3: Managing Database Files. Overview Introduction to Data Structures Creating Databases Managing Databases Placing Database Files and Logs Optimizing.
Chapter 4 The Relational Model 3: Advanced Topics Concepts of Database Management Seventh Edition.
Databases Lesson 5.
4.1 © 2004 Pearson Education, Inc. Exam Managing and Maintaining a Microsoft® Windows® Server 2003 Environment Lesson 4: Organizing a Disk for Data.
MCTS Guide to Microsoft Windows Vista Chapter 4 Managing Disks.
Agenda for Today Do Chapter 14 Final Project Review for Final.
Module 16: Performing Ongoing Database Maintenance
Module 5: Upgrading to SQL Server 7.0. Overview Planning an Upgrade Preparing to Upgrade Verifying the Upgrade Setting a Compatibility Level.
1 Chapter Overview Preparing to Upgrade Performing a Version Upgrade from Microsoft SQL Server 7.0 Performing an Online Database Upgrade from SQL Server.
CN2180 MS SQL Server Kemtis Kunanuraksapong MSIS with Distinction, A+ MCTS, MCDST, MCP.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Indexes / Session 2/ 1 of 36 Session 2 Module 3: Types of Indexes Module 4: Maintaining Indexes.
1 Chapter Overview Defining Operators Creating Jobs Configuring Alerts Creating a Database Maintenance Plan Creating Multiserver Jobs.
SQL/Lesson 7/Slide 1 of 32 Implementing Indexes Objectives In this lesson, you will learn to: * Create a clustered index * Create a nonclustered index.
Chapter 5 : Integrity And Security  Domain Constraints  Referential Integrity  Security  Triggers  Authorization  Authorization in SQL  Views 
Session 1 Module 1: Introduction to Data Integrity
Learningcomputer.com SQL Server 2008 –Views, Functions and Stored Procedures.
CPSC 203 Introduction to Computers T97 By Jie (Jeff) Gao.
Module 11: Managing Transactions and Locks
Maintenance Practices. Goal  Automate the necessary DBA chores to put organizations on the path of having healthier, consistent and more trustworthy.
Danny Tambs – Senior Consultant Microsoft.
Hands-On Microsoft Windows Server 2008 Chapter 7 Configuring and Managing Data Storage.
SQL Server 2012 Session: 1 Session: 6 Creating and Managing Databases Data Management Using Microsoft SQL Server.
Introduction to Core Database Concepts Getting started with Databases and Structure Query Language (SQL)
SQL Basics Review Reviewing what we’ve learned so far…….
Microsoft SQL is known as RDMS (Relational Database Management System) which is developed by Microsoft and is highly used at corporate and enterprise.
Views / Session 3/ 1 of 40 Session 3 Module 5: Implementing Views Module 6: Managing Views.
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.
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.
Indexing strategies and good physical designs for performance tuning Kenneth Ureña /SpanishPASSVC.
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
Table spaces.
A Technical Overview of Microsoft® SQL Server™ 2005 High Availability Beta 2 Matthew Stephen IT Pro Evangelist (SQL Server)
Chapter Overview Understanding the Database Architecture
Database Performance Tuning and Query Optimization
The Vocabulary of Performance Tuning
The Vocabulary of Performance Tuning
Microsoft SQL Server 2014 for Oracle DBAs Module 7
The Vocabulary of Performance Tuning
Chapter 11 Database Performance Tuning and Query Optimization
Chapter 11 Managing Databases with SQL Server 2000
Understanding Core Database Concepts
The Vocabulary of Performance Tuning
Presentation transcript:

Agenda for Today Chapter 5 –Skip Lesson 2 Review questions Midterm Chapter 6 Review questions

Database files Each SQL Server database has at least one primary data file and one transaction log file Primary data file (.mdf) Transaction log file (.ldf) Secondary data files (.ndf)

Files and filegroups Possible layout Mydb.mdf Mylog.ldf Morespac.ndf D:\C:\E:\ Default Filegroup Myxtra Filegroup

Units of Storage The fundamental unit of data storage is Page. A page is 8 KB in size Extents are the basic unit in which space is allocated to tables and indexes An extent is made of 8 pages (64 KB) Two types of Extents –Mixed - can stored upto 8 objects –Uniform - data from one object

Indexes Indexes are used to lookup information In a database, an index allows the database program to find data in a table without scanning the entire table Automatically created on a PK field Two Types –Clustered - data is sorted in order –Nonclustered - data is not sorted –Pages 140 and 141

Stored Procedures (sp’s) A stored procedure is a group of Transact-SQL statements compiled into a single execution plan Stored procedures can use input and output parameters Executes faster than writing T-SQL as it is compiled and part of the database Typically used to enforce Business Rules Also another security mechanism

Views A view can be thought of as either a virtual table or a stored query A view can represent data from more than one table Views can be used as security mechanisms by granting permission on a view and not on the table Can be created using –CREATE VIEW name AS

System and Database Catalogs System Catalog - system tables with info on the server Database Catalog - system tables with info on each database System sp’s are used to report information on a database object System Functions Some of these objects are listed in Tables 5-1 through 5-5

Class Assignments Try the following exercises Page 137 Page 147 Page 151 Page 152 Page 155 Page 157 Take a break when done

Midterm On 2/12, no exceptions Ch lecture material 100 questions, 200 points Multiple choice 2 hours - 5:30 - 7:30 Open Book (straight curve) Closed Book (distribution curve) Your Vote - Majority Wins Sample midterm on the website

Object identifiers for DB First character: –Alphabetic or letter character or # Remaining characters: –Any Unicode standard 2.0 letters –Decimal numbers $, _, and # Not allowed for standard identifiers –Embedded spaces –Reserved words

Naming conventions Keep identifiers as short as possible. Keep object names and user names unique. When possible, use names that describe the object in a meaningful fashion. Use names that identify the object types.

Database parameters What do you need? Database name Database size and location Transaction log name Transaction log size and location Growth parameters

CREATING DATABASES Creating new databases Three options Using Create Database Wizard in Enterprise Manager using Tools - Wizards menu option Using Enterprise Manager CREATE DATABASE T-SQL Command

1. Create Database Wizard Database name and file locations continued

Database File continued

Transaction Log File

2. Enterprise Manager continued

Database File continued

Transaction Log File

General properties

CREATE DATABASE Using Query Analyzer CREATE DATABASE syntax: CREATE DATABASE database_name ON filespec [LOG ON filespec] FOR ATTACH CREATE DATABASE example: CREATE DATABASE Field ON PRIMARY FILENAME='c:\SQL Admin\C03E0301\Field.mdf') FOR ATTACH

Class Assignments Do the Exercises on Pages 168, 171 and 173 Review the results with me Take a break when done

DATABASE options User database follows the options set for model database You have different ways of reviewing and changing database options Enterprise Manager DATABASEPROPERTYEX system function ALTER DATABASE command sp_dboption system stored procedure

Enterprise Manager

ALTER DATABASE ALTER DATABASE syntax: ALTER DATABASE database_name ADD FILE filespec [TO FILEGROUP filegroup_name] | ADD LOG FILE filespec | REMOVE FILE logical_filename | ADD FILEGROUP filegroup_name | REMOVE FILEGROUP filegroup_name | MODIFY FILE filespec | MODIFY FILEGROUP filegroup_name filegroup_property |SET optionspec [WITH termination] |COLLATE collation_name

Sp_dboption syntax Supported for backward compatibility Displays or changes database options. sp_dboption should not be used on either the master or tempdb databases. Syntax is as follows sp_dboption

Sp_dboption choices ANSI null default ANSI warnings arithabort auto update statistics autoclose autoshrink concat null yields null cursor close on commit dbo use only local cursor merge publish numeric roundabort offline published read only recursive triggers select into/bulkcopy single user torn page detection trun. Log on chkpt.

Managing Database Size Automatic Growth (data and log) Auto Shrink (under options) Manually - preferred Enterprise Manager ALTER DATABASE T-SQL command

Reducing file sizes In order to shrink the data and log files, you have two options Enterprise Manager DBCC SHRINKFILE T-SQL provides DBCC statements that act as the “database consistency checker” for SQL Server Shrinks the size of the specified data file or log file for the related database.

Reducing database size In order to shrink the database, you have two options Enterprise Manager DBCC SHRINKDATABASE Shrinks the size of the data files in the specified database.

Enterprise Manager

T-SQL DBCC SHRINKDATABASE syntax: DBCC SHRINKDATABASE (database_name[, target_percentage]) [, NOTRUNCATE | TRUNCATEONLY]

Multiple Disk for Databases Many benefits –Increase Performance –Fault Tolerance –Recoverability –Easy Maintenance Two options RAID Filegroups

RAID RAID stands for Redundant Array of Inexpensive Disks RAID is a way of combining multiple disk drives into a single entity to improve performance and/or reliability. Many types of RAID, some of which are listed below

RAID Disk Striping (RAID 0) Disk Mirroring (RAID 1) Disk Striping with parity (RAID 5) Disk Striping with parity - RAID 10 (RAID 1 + RAID 0)

RAID 0 - Disk Striping - fast

RAID 1 - Disk Mirror - fault tolerance

RAID 5 - Striping with Parity - speed and fault tolerance

RAID 10 - Striping with Mirror - the works

Class Assignments Try the following exercises Page 182 Page 184 Review questions on Page 196 Next week Chapter 7 and Midterm Review