Top Banner
Prentice Hall © 2004 1 COS 346 Day 20 Day 20
91

Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

Dec 22, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

Prentice Hall © 20041

COS 346

Day 20Day 20

Page 2: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

7-2

Agenda

• Questions?• Assignment 8 Corrected

– 3 A’s, 3 B’s & 2 D’s• Assignment 9 Due • Assignment 10 will be posted next week• New Time line • Finish Discussion on Managing Multiuser Databases

Page 3: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

New time line

• April– 13 - Managing Multiuser

databases

• Assignment 9 due

– 16 - Database access standards

– 20 - Database access standards

• Progress report

• April

– 23 XML and ado.net

• Assignment 10 due

– 27

• Quiz 3

• Capstones Presentations Due

Page 4: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-4

David M. Kroenke’s

Chapter Eleven:

Managing Databases withSQL Server 2000

Part Three

Database Processing:Fundamentals, Design, and Implementation

Page 5: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-5

Indexes

• Indexes are special data structures used to improve database performance

• SQL Server automatically creates an index on all primary and foreign keys

• Additional indexes may be assigned on other columns that are:– Frequently used in WHERE clauses– Used for sorting data

Page 6: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-6

Indexes

• SQL Server supports two kinds of indexes: – Clustered index: the data are stored in the bottom

level of the index and in the same order as that index– Nonclustered index: the bottom level of an index

contains pointers to the data

• Clustered indexes are faster than nonclustered indexes for updating and retrieval

Page 7: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-7

Creating an Index: By GUI in Enterprise Manager

Page 8: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

8-8

Page 9: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-9

Application Logic

• SQL Server database application can be processed using: – Programming language, e.g., C#, C++, Visual Basic,

Java, to invoke SQL Server DBMS commands– Stored procedures– SQL Query Analyzer to invoke database commands

stored in .sql files– Triggers

Page 10: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-10

Stored Procedures

• A stored procedure is a TRANSACT/SQL (T/SQL) complied program stored within the database:– T/SQL surrounds basic SQL statements with programming

constructs such as parameters, variables, and logic structures such as IF and WHILE.

• Stored procedures are programs that can: – Have parameters– Invoke other procedures and functions– Return values– Raise exceptions

• Creating stored procedures– Write a stored procedure in a text file and process the

commands using the Query Analyzer, or– Using Enterprise Manager

Page 11: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-11

Variables are declared after the keyword AS

Parameters

Page 12: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-12

Page 13: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

8-13

Page 14: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-14

Triggers• An SQL Server trigger is a T/SQL procedure that is invoked when a

specified database activity occurs• Triggers can be used to:

– Enforce business rules– Set complex default values– Update views– Implement referential integrity actions

• SQL Server only supports INSTEAD OF and AFTER triggers:– A table may have one or more AFTER triggers – AFTER triggers may not be assigned to views– A view or table may have only one INSTEAD OF trigger for each

triggering action• Triggers can roll back the transactions that caused them to be fired

Page 15: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-15

This is an AFTER trigger on INSERT on the table TRANS.It is will set a default value on AskingPrice.

Page 16: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-16

Triggers:Enforcing a Required Child Constraint

There is an M-M relationship between WORK and TRANSACTION:

Page 17: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-17

Triggers:Enforcing a Required Child Constraint

• The hard way using two triggers – this one enforces the required child:

Page 18: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-18

Triggers:Enforcing a Required Child Constraint

• The hard way using two triggers – this one deletes any duplicate transaction:

Page 19: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-19

Triggers:Enforcing a Required Child Constraint

CREATE VIEW Work_Trans AS

SELECT Title, Description, Copy,ArtistID, DateAcquired, AcquisitionPrice

FROM WORK W JOIN TRANS T

ON W.WorkID = T.WorkID;

A better way - Create the Work_Trans view:

Page 20: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-20

Triggers:Enforcing a Required Child Constraint

• A better way using one trigger – this one works with the Work_Trans view:

Page 21: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-21

Concurrency Control

• Three factors determine the concurrency control behavior of SQL Server:– Transaction isolation level– Cursor concurrency setting– Locking hints provided in the SELECT clause

• Locking behavior also changes, depending on whether actions occur in the context of transactions or cursors independently– Therefore, SQL Server places locks on behalf of the developer– Locks may be placed at many levels of granularity and may be

promoted or demoted as work progresses

Page 22: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-22

SQL Server Concurrency Options

Page 23: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

Setting Conncurrency control

SET TRANSACTION ISOLATION LEVEL REAPEATABLE READ;

DECLARE MY_CURSOR CURSOR DYNAMIC CURSOR SCROLL-LOCKS

FOR

SELECT 8

FROM

dbo.TRANS WITH HOLDLOCKS;

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

8-23

Page 24: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-24

SQL Server 2000 Security

• SQL server provides two modes of authentication:– Windows only: the authentication is provided by the

windows operating system– Mixed security: SQL Server will accept either the

windows-authenticated user name or it will perform its own authentication

• Roles may be assigned to a SQL Server user account:– A role is a group of predefined authorities– Public role has the authority only to connect to the

database

Page 25: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-25

SQL Server Backup

• SQL Server supports several types of backup:– A complete backup makes a copy of the entire

database– A differential backup makes a copy of the database

changes since the last complete backup– Differential backups are faster and can be taken more

frequently– Complete backups are simpler to use for recovery

• The transaction log also needs to be periodically backed up

Page 26: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-26

Database Recovery

• Both data and log files are created by SQL Server

• SQL Server provides a wizard for setting up database maintenance plan, e.g., scheduling database and log backups

• To recover a database with SQL Server:– The database is restored from a prior database

backup– Log after images are applied to the restored database– At the end of the log, changes from any transaction

that failed to commit are then rolled back

Page 27: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-27

SQL Server Recovery Models

• Three recovery models– Simple recovery: neither logging is done nor log

records applied:• To recover a database is to restore the database to the last

backup• This method can be used for a database that is never

changed

– Full recovery: all database changes are logged– Bulk-logged: all changes are logged except those

that cause large log entries

Page 28: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-28

David M. Kroenke’s Database Processing

Fundamentals, Design, and Implementation

(10th Edition)

End of Presentation:Chapter Eleven Part Three

Page 29: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-29

Chapter 11: SQL Server Database Administration

SQL for SQL ServerSQL for SQL ServerBijoy Bordoloi and Douglas BockBijoy Bordoloi and Douglas Bock

Page 30: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-30

Objectives• Develop a general understanding of database administration.• Understand the duties of a database administrator.• Learn about the organization of a SQL Server database file

structure.• Create a database.• Learn concepts concerning the SQL Server system catalog and

database catalogs.• Learn about the special dbo database user account.• Become familiarized with the Enterprise Manager software.• Create system and database user accounts.• Grant, deny, and revoke permissions.• Create and allocate roles.

Page 31: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-31

• Database administration is a specialized area within a large information systems department.

• A database administrator (DBA) works closely with application developers to support application development efforts.

Database Administration Overview

Page 32: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-32

Database Administrator Duties• Install database management system software and

upgrades.• Design and create a database including the allocation

of system disk storage for current and future database storage requirements.

• Start up and shut down database services.• Create user accounts and monitor user activities.• Grant database permissions to control data security

and data access. • Backup and recover a database in the event of

system failure.• Tune a database to optimize database performance. • Manage database network connectivity.• Migrate a database to a new version of the DBMS

software.

Page 33: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-33

Enterprise Manager

• SQL Server 2000’s Enterprise Manager software is a Microsoft Management Console snap-in.

• Enterprise Manager provides a graphical user interface for administering SQL Server databases. Use it to:

– Create databases.– Create tables and other objects.– Create and manage user accounts.– Allocate system and object permissions.– Manage security and schedule tasks.– Perform database backups.

Page 34: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-34

Enterprise Manager Graphical User Interface

The initial window in unexpanded Tree view.

Page 35: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

SQL-Server management Studio

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-35

Page 36: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-36

Expanded Tree Pane – Company Database

Page 37: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-37

Database Types

• Two groups of databases were displayed on the previous slide:

– (1) System databases – includes Master, Model, MSDB, and Tempdb.

– (2) User-Defined Application databases. Those shown include the Company and Riverbend databases used in this textbook and two databases provided by Microsoft as examples – Northwind and Pubs. (optional based on installation)

Page 38: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-38

System Databases

• Master – stores database information about other databases for a given instance of the SQL Server 2000. Also tracks disk space usage, configuration of the DBMS, and information on database objects.

• Model – a database template that is copied whenever you create a new database.

• Tempdb --- stores temporary objects/data such as those created by ORDER BY and JOIN operations.

• MSDB – used to schedule tasks such as database backup.

Page 39: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-39

Database Files

• Physical windows files – includes a primary data file and transaction log file as a minimum.

• Primary data file – stores application data and startup information.

• Transaction log files – stores transaction data to support database recovery.

• Secondary data files – stores application data that will not fit into the primary data file – generally added to additional disk drives.

Page 40: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-40

Database Files Contd.

Page 41: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

8-41

Page 42: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-42

Disk Storage• Database objects are stored using two units

of storage – page and extent.• Database files are divided into pages while

several pages are grouped into extents.• Pages are 8Kb in size. • A data row cannot span pages in SQL Server

– the maximum row size is 8,060 bytes.• Data pages store table row data; Index pages

store index values; Text/Image pages store data of type TEXT, NTEXT, and IMAGE.

• Extents are contiguous pages allocated with 8 pages/extent.

Page 43: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-43

Creating an SQL Server Database

• The CREATE DATABASE statement can be used with SQL Query Analyzer to create a database.

• Enterprise Manager is easier to use – right-click the database node or use the Action menu - New Database option.

Page 44: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-44

Page 45: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-45

Database Properties – General Tab

Page 46: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-46

Database Properties – Data Files Tab Contd.

Page 47: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-47

Database Properties – Data Files Tab

• The Database Properties dialog box – Data Files tab is used to specify file names for the primary data file. The example shown on the next slide is named TestDatabase_Data.

• It is stored to a folder named C:\Data.• The data file has an initial size of 1Mb and is

set to automatically grow in 10% increments.

Page 48: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-48

Database Properties – Transaction Log Tab

• The figure shown on the next slide is the Transaction Log tab used to specify file names for the transaction log file.

• Here the transaction log is named TestDatabase_Log on drive C: in the folder named C:\DataLogs.

Page 49: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-49

Database Properties – Transaction Log Tab Contd.

Page 50: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-50

Files and File Groups

• Larger databases with several secondary data files are easier to manage by defining a filegroup object type – a logical container to hold files as a unit.

• This makes it easier to backup files.

• Use Enterprise Manager to create a filegroup by a right-click of the database in the Tree panel and selection of the Properties menu.

Page 51: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-51

Files and File Groups Contd.

• Select the Filegroups tab and name the filegroup. You can then use the Properties dialog box to create secondary files and assign them to the filegroup.

Page 52: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-52

Page 53: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-53

Create Database Options to Create

Filegroups • The example shown here creates a primary data file along with

a filegroup and secondary data files and log files.

/* SQL Example 11.1 */

CREATE DATABASE TestDatabase

ON PRIMARY

( NAME = TestDatabase_Data,

FILENAME = 'C:\Data\TestDatabase_Data.Mdf',

SIZE = 10, MAXSIZE = 50, FILEGROWTH = 25% ),

FILEGROUP TestDatabaseGroup1

( NAME = TestDatabaseSecondary1_Data,

FILENAME = 'D:\Data\TestDatabaseSecondary1_Data.Ndf',

SIZE = 20, MAXSIZE = 50, FILEGROWTH = 5% ),

Page 54: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-54

Create Database Options to Create Filegroups Contd.

( NAME = TestDatabaseSecondary2_Data, FILENAME = 'E:\Data\

TestDatabaseSecondary2_Data.Ndf', SIZE = 10, MAXSIZE = 50, FILEGROWTH = 5% )LOG ON( NAME = 'TestDatabase_Log', FILENAME = 'G:\Datalogs\TestDatabase_Log.Ldf', SIZE = 5MB, MAXSIZE = 25MB, FILEGROWTH

= 5MB );

Page 55: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-55

SQL Server System Catalog

• The SQL Server system catalog consists of system tables in the Master database.

• System tables stored in individual databases are the database catalog.

• The system catalog stores information about the structure of database objects such as databases, tables, views, and indexes – termed metadata (data about data).

• Only SQL Server should modify the system catalog.

Page 56: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-56

SQL Server and Database Accounts

• Both SQL Query Analyzer and Enterprise Manager can create SQL Server login accounts.

• Within SQL Query Analyzer, you can execute several different procedures to create logins and to modify passwords.

/* SQL Example Creating a Login */EXEC sp_addlogin ‘thumb’, ‘secret’, ‘Company’;/* Changing password */EXEC sp_password ‘secret’, ‘newsecret’, ‘thumb’;

Page 57: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-57

Using Enterprise Manager to Create Login Accounts

• Select Tools menu, Wizards option and expand the Database tree.

• Select the Create Login Wizard option shown here.

Page 58: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-58

Creating Login Accounts – Contd.

Page 59: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-59

Creating Login Accounts – Contd.

Page 60: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-60

Creating Login Accounts – Contd.

Page 61: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

8-61

Page 62: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

8-62

Page 63: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

8-63

Page 64: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-64

Default Database User Accounts

• Users needing access to specific application databases must have a valid database user account for that database.

• Each database has two default accounts: dbo and guest.

• The dbo account owns a database and the account cannot be dropped.

• The guest account is used by users who have no specific database user account.

Page 65: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-65

Creating Database User Accounts

• The sp_grantdbaccess procedure can be executed within SQL Query Analyzer to create a database user account and associate it with an existing Windows users account or SQL Server security login account.

• This example associates a database user account named robertsmith with a Windows user account named rsmith.

EXEC sp_grantdbaccess ‘rsmith’, ‘robertsmith’

EXEC sp_grantdbaccess ‘rsmith’

Page 66: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-66

Creating Database User Accounts Contd.

• Enterprise Manager can be used as shown here to create database user accounts.

• Expand the database tree and select New Database user – use the dialog box to enter the login and user name and grant permissions to the user.

Page 67: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-67

Revoking Database User Accounts Through Enterprise Manager

Page 68: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

8-68

Page 69: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-69

Roles

• Roles make it easier for a DBA to manage the allocation of permissions.

• A role is like a container of a group of permissions for a specific type of system user such as an accountant.

• Each accountant hired will be authorized the permissions contained in the role named Accountant.

• This also applies to other jobs such as Clerk.

Page 70: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-70

Roles Contd.

Page 71: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-71

Fixed Server Roles

• Fixed server roles exist at the server level external to databases.

• Several fixed server roles exist. These include:– Sysadmin – a role granted all permissions for SQL Server

and associated with the system administrator (sa) login and dbo user.

– DbCreator – a role with permission to create/modify databases.

– DiskAdmin – permission to manage disk files.– Other fixed server roles also exist and are described in the

chapter reading.

Page 72: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-72

Allocating Fixed Server Roles – Enterprise Manager

• Expand the security folder and select the Server Roles option. Right-click the role as shown.

Page 73: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-73

Page 74: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-74

Allocating Fixed Server Roles – Enterprise Manager Contd.

• Click the Add button to display the Add Members window as shown and add the members desired and click OK.

Page 75: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-75

Page 76: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-76

Fixed Database Roles

• These roles exist for each database and are grouped according to purpose. They include:– Db_owner – users who perform most database

activities.– Db_accessadmin – permission to add/remove

users.– Db_datareader – SELECT permission on any

database table/view.– Db_datawriter – Can run any DML statement on

any database table/view.– Other roles exist as described in the chapter.

Page 77: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-77

Application Roles

• These roles are used to allocate specific permissions for specific applications such as payroll or inventory management.

• Application roles are allocated to login sessions.• Application roles require a password. • While connected to an application role, the database

user loses all other allocated permissions except those associated with the application role.

/* Example */EXEC sp_addapprole ‘payroll’, ‘payroll_password’

Page 78: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-78

User-Defined Database Roles

• This is the more traditional use of roles – to allocate permissions to groups of users as was described earlier.

• Suppose a role named Clerk has several permissions needed by a newly hired clerk named dbock. This EXEC will create the Clerk role owned by bbordoloi. The role is then granted to dbock.

/* Example Granting Role */

EXEC sp_addrole ‘clerk’, ‘bbordoloi’

EXEC sp_addrolemember ‘clerk’, ‘dbock’

Page 79: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-79

Permissions

• Permissions authorize database users to perform various operations such as CREATE DATABASE and SELECT.

• Permissions are divided into two categories: statement and object.

Page 80: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-80

Granting Statement Permissions

• Use the GRANT statement to grant permissions. Statement permissions include:– CREATE DATABASE – CREATE DEFAULT– CREATE FUNCTION– CREATE PROCEDURE– CREATE RULE– CREATE TABLE– CREATE VIEW– BACKUP DATABASE– BACKUP LOG

Page 81: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-81

Granting Statement Permissions – Contd.

• Grant all permissions to dbock. GRANT ALL TO dbock;

• Grant two permissions to tthumb and bbordoloi

GRANT CREATE TABLE, CREATE VIEW TO

tthumb, bbordol;

• Grant permissions to a role.GRANT CREATE PROCEDURE, CREATE FUNCTION

TO clerk;

Page 82: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-82

Granting Object Permissions Contd.

• Object permissions apply to a specific database object such as a table.

• Permissions include SELECT, UPDATE, INSERT, DELETE, and other object manipulations.

Page 83: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-83

Granting Object Permissions Contd.

• General form of the GRANT statement:GRANT [ALL | permission_list] ON [table/view

[column_list] | procedure] TO account_list [WITH GRANT OPTION] [AS {group_name |

role_name}]

• The object is specified with the ON clause.• The TO clause specifies who receives the

permission.• The WITH GRANT OPTION enables the

grantee to grant the permission to others.

Page 84: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-84

Granting Object Permissions – Contd.

• Grant SELECT on the dependent table. GRANT SELECT ON dependent TO bbordoloi;

• Grant SELECT and DELETE on the dependent table.

GRANT SELECT, DELETE ON dependent TO dbock;

• Grant UPDATE on specific table columns. GRANT UPDATE ON dependent( dep_name,

dep_gender) TO bbordoloi;

• Grant ALL permissions to everyone (PUBLIC). GRANT ALL ON dependent TO PUBLIC;

Page 85: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-85

Granting Object Permissions – Enterprise Manager

Page 86: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

8-86

Page 87: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-87

Denying Permissions

• Denying permissions removes existing permissions from a database user account or role and prevents granting the permission to the database user account by accident through any other defined role.

/* Examples */

DENY CREATE TABLE TO tthumb;

DENY SELECT, UPDATE ON dependent

TO dbock;

Page 88: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-88

Revoking Permissions

• You can revoke both statement and object permissions. Permissions that are revoked can later be allocated again.

/* Examples */REVOKE SELECT ON dependent FROM PUBLIC;REVOKE UPDATE ON dependent FROM dbock;

• You can also revoke GRANT options and cause system users who have been granted permissions by a specific database user to also lose their permissions through the CASCADE clause.

REVOKE GRANT OPTION FOR DELETE ON dependent FROM dbock CASCADE;

Page 89: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-89

System Procedures• System procedures such as the sp_help

procedure can be used to display information about database objects.

/* SQL Example 11.25 */EXEC sp_help dependentName Owner Type---------- ---------- ------------- dependent dbo user table Column_name Type Computed Length----------------- ---------- -------- --------dep_emp_ssn char no 9 dep_name varchar no 50 dep_gender char no 1 other information is also listed . . .

Page 90: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-90

System Procedures – Cont.• Other system procedures such as sp_depends can

display dependency information among objects such as tables and views. This example shows dependency information for the employee table.

/* SQL Example 11.26 */EXEC sp_depends employee;In the current database, the specified object is

referenced by the following:Name type ----------------- ---------------- dbo.ck_emp_salary check cns

Page 91: Prentice Hall © 2004 1 COS 346 Day 20. 7-2 Agenda Questions? Assignment 8 Corrected –3 A’s, 3 B’s & 2 D’s Assignment 9 Due Assignment 10 will be posted.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

9-91

Summary

• A SQL Server installation is managed through the Enterprise Manager.

• A SQL Server database includes physical and logical objects such as files and filegroups.

• The system catalog stores metadata for a SQL Server instance and all databases. Each database has a database catalog.

• You learned to create SQL Server login accounts, database accounts, and roles.

• You also learned to allocate, deny, and revoke system and object permissions to/from accounts and roles.