CSC271 Database Systems Lecture # 17. Summary: Previous Lecture  View updatability  Advantages and disadvantages of views  View materialization.

Slides:



Advertisements
Similar presentations
Access Control & Views Reading: C&B, Chap 7. Dept of Computing Science, University of Aberdeen2 In this lecture you will learn the principles of object.
Advertisements

Chapter 23 Database Security and Authorization Copyright © 2004 Pearson Education, Inc.
Jan. 2014Dr. Yangjun Chen ACS Database security and authorization (Ch. 22, 3 rd ed. – Ch. 23, 4 th ed. – Ch. 24, 6 th )
1 Data Concurrency David Konopnicki 1997 Revised by Mordo Shalom 2004.
Database Security by Muhammad Waheed Aslam SIS Project Leader ITC/KFUPM.
Database Management System
1 Minggu 5, Pertemuan 10 SQL: Views and Access Control Matakuliah: T0206-Sistem Basisdata Tahun: 2005 Versi: 1.0/0.0.
A Guide to SQL, Seventh Edition. Objectives Create a new table from an existing table Change data using the UPDATE command Add new data using the INSERT.
Transaction Management and Concurrency Control
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Security and Transaction Management Pertemuan 8 Matakuliah: T0413/Current Popular IT II Tahun: 2007.
Dec 15, 2003Murali Mani Transactions and Security B term 2004: lecture 17.
Cs3431 Transactions, Logging and Security. cs3431 Transactions: What and Why? A set of operations on a database must appear as one “unit”. Example: Consider.
1 Pertemuan 15 SQL View Matakuliah: >/ > Tahun: > Versi: >
A Guide to MySQL 7. 2 Objectives Understand, define, and drop views Recognize the benefits of using views Use a view to update data Grant and revoke users’
A Guide to SQL, Seventh Edition. Objectives Understand, create, and drop views Recognize the benefits of using views Grant and revoke user’s database.
Database Administration Part 1 Chapter Six CSCI260 Database Applications.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Chapter 5 Data Manipulation and Transaction Control Oracle 10g: SQL
Managing Concurrency in Web Applications. DBI 2007 HUJI-CS 2 Intersection of Concurrent Accesses A fundamental property of Web sites: Concurrent accesses.
Transaction Management and Concurrency Control
Security and Integrity
Chapter 6: Integrity and Security Thomas Nikl 19 October, 2004 CS157B.
Chapter 7 SQL: Data Definition Pearson Education © 2009.
Lecture 7 Integrity & Veracity UFCE8K-15-M: Data Management.
10/25/2012ISC239 Isabelle Bichindaritz1 SQL Commands.
Oracle Database Administration Lecture 3  Transactions  SQL Language: Additional information  SQL Language: Analytic Functions.
CSC271 Database Systems Lecture # 12. Summary: Previous Lecture  Row selection using WHERE clause  WHERE clause and search conditions  Sorting results.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 10 Transaction Management.
1cs Intersection of Concurrent Accesses A fundamental property of Web sites: Concurrent accesses by multiple users Concurrent accesses intersect.
Controlling User Access. Objectives After completing this lesson, you should be able to do the following: Create users Create roles to ease setup and.
Database Management COP4540, SCS, FIU Constraints and security in SQL (Ch. 8.6, Ch22.2)
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 136 Database Systems I SQL Modifications and Transactions.
© Pearson Education Limited, Chapter 14 Physical Database Design – Steps 5 & 6 (Design User Views; Design Security Mechanisms) Transparencies.
11/7/2012ISC329 Isabelle Bichindaritz1 Transaction Management & Concurrency Control.
How transactions work A transaction groups a set of Transact-SQL statements so that they are treated as a unit. Either all statements in the group are.
Outline Introduction Basic SQL Setting Up and Using PostgreSQL
SQL : Data Definition Session 9 – 10 Course Name: Database System Year : 2012.
Transactions and Locks A Quick Reference and Summary BIT 275.
Sekolah Tinggi Ilmu Statistik (STIS) 1 Dr. Said Mirza Pahlevi, M.Eng.
Chapter 6 SQL: Data Definition Transparencies. 2 Chapter 6 - Objectives u Data types supported by SQL standard. u Purpose of integrity enhancement feature.
Chapter 13 Views Oracle 10g: SQL. Oracle 10g: SQL2 Objectives Create a view, using CREATE VIEW command or the CREATE OR REPLACE VIEW command Employ the.
Chapter 6 SQL: Data Definition Transparencies © Pearson Education Limited 1995, 2005.
CSC 411/511: DBMS Design Dr. Nan WangCSC411_L12_JDBC_MySQL 1 Transations.
Transactions, Roles & Privileges Oracle and ANSI Standard SQL Lecture 11.
Chapter 6 SQL: Data Definition Transparencies © Pearson Education Limited 1995, 2005.
Database Management Systems, 2 nd Edition, R. Ramakrishnan and J. Gehrke1 Security Lecture 17.
A Guide to SQL, Eighth Edition Chapter Six Updating Data.
1 Advanced Database Concepts Transaction Management and Concurrency Control.
Database Security. Multi-user database systems like Oracle include security to control how the database is accessed and used for example security Mechanisms:
Module 11: Managing Transactions and Locks
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
©Bob Godfrey, 2002, 2005 Lecture 17: Transaction Integrity and Concurrency BSA206 Database Management Systems.
10 1 Chapter 10 - A Transaction Management Database Systems: Design, Implementation, and Management, Rob and Coronel.
Chapter 7 SQL – Data Definition Pearson Education © 2014.
Database Security. Introduction to Database Security Issues (1) Threats to databases Loss of integrity Loss of availability Loss of confidentiality To.
Database Security Database System Implementation CSE 507 Some slides adapted from Navathe et. Al.
Chapter 13 Managing Transactions and Concurrency Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Database Security Advanced Database Dr. AlaaEddin Almabhouh.
Controlling User Access
SQL: Data Definition Transparencies
Objectives User access Create users Create roles
Database Security and Authorization
Transaction Management and Concurrency Control
Chapter 10 Transaction Management and Concurrency Control
אבטחת נתונים בסביבת SQL Data Security
A Guide to SQL, Eighth Edition
Chapter 7 SQL – Data Definition Pearson Education © 2014.
Introduction of Week 13 Return assignment 11-1 and 3-1-5
-Transactions in SQL -Constraints and Triggers
Presentation transcript:

CSC271 Database Systems Lecture # 17

Summary: Previous Lecture  View updatability  Advantages and disadvantages of views  View materialization

Transactions  SQL defines transaction model based on COMMIT and ROLLBACK  Transaction is logical unit of work with one or more SQL statements guaranteed to be atomic with respect to recovery  An SQL transaction automatically begins with a transaction-initiating SQL statement (e.g., SELECT, INSERT)  Changes made by transaction are not visible to other concurrently executing transactions until transaction completes

Transactions..  Transaction can complete in one of four ways:  COMMIT ends transaction successfully, making changes permanent  ROLLBACK aborts transaction, backing out any changes made by transaction  For programmatic SQL, successful program termination ends final transaction successfully, even if COMMIT has not been executed  For programmatic SQL, abnormal program aborts the transaction

Transactions..  New transaction starts with next transaction-initiating statement  SQL transactions cannot be nested  SET TRANSACTION configures transaction: SET TRANSACTION [READ ONLY | READ WRITE] | [ISOLATION LEVEL READ UNCOMMITTED | READ COMMITTED | REPEATABLE READ | SERIALIZABLE ]

READ ONLY/ READ WRITE  The READ ONLY and READ WRITE qualifiers indicate whether the transaction is read only or involves both read and write operations  The default is READ WRITE  Confusingly, READ ONLY allows a transaction to issue INSERT, UPDATE, and DELETE statements against temporary tables (but only temporary tables)

Isolation Level  The isolation level indicates the degree of interaction that is allowed from other transactions during the execution of the transaction  Dirty read: A transaction reads data that has been written by another as yet uncommitted transaction  Non-repeatable read: A transaction rereads data it has previously read but another committed transaction has modified or deleted the data in the intervening period  Phantom read: A transaction executes a query that retrieves a set of rows satisfying a certain search condition. When the transaction re-executes the query at a later time additional rows are returned that have been inserted by another committed transaction in the intervening period

Isolation Level

IMMEDIATE/DEFERRED Constraints  Do not always want constraints to be checked immediately, but instead at transaction commit  Constraint may be defined as INITIALLY IMMEDIATE (default) or INITIALLY DEFERRED, indicating mode the constraint assumes at start of each transaction  In former case, also possible to specify whether mode can be changed subsequently using qualifier [NOT] DEFERRABLE  SET CONSTRAINTS statement used to set mode for specified constraints for current transaction: SET CONSTRAINTS {ALL | constraintName [,... ]} {DEFERRED | IMMEDIATE}

Authorization  Discretionary access control  Each user is given appropriate access rights (or privileges) on specific database objects  Typically users obtain certain privileges when they create an object and can pass some or all of these privileges to other users at their discretion  Circumvention by a devious unauthorized user tricking an authorized user into revealing sensitive data  Mandatory access control  Each database object is assigned a certain classification level (e.g. Top Secret, Secret, Confidential, Unclassified) and each subject (e.g. users, program) a clearance level

Authorization Identifiers and Ownership  Authorization identifier is normal SQL identifier used to establish identity of a user, usually has an associated password  Used to determine which objects user may reference and what operations may be performed on those objects  Each object created in SQL has an owner, as defined in AUTHORIZATION clause of schema to which object belongs  Owner is only person who may know about it

Privileges  Privileges are the actions that a user is permitted to carry out on a given base table or view, the privileges defined by the ISO standard are:  SELECT Retrieve data from a table  INSERT Insert new rows into a table  UPDATE Modify rows of data in a table  DELETE Delete rows of data from a table  REFERENCES Reference columns of named table in integrity constraints  USAGE Use domains, character sets etc.

Privileges..  Can restrict INSERT/UPDATE/REFERENCES to named columns  Owner of table must grant other users the necessary privileges using GRANT statement  To create view, user must have SELECT privilege on all tables that make up view and REFERENCES privilege on the named columns, likewise INSER, UPDATE, DELTE privileges only if owner has these privileges for every table in view

GRANT  The GRANT statement is used to grant privileges on database objects to specific users  The format of the GRANT statement is: GRANT{PrivilegeList | ALL PRIVILEGES} ON ObjectName TO {AuthorizationIdList | PUBLIC} [WITH GRANT OPTION]

Example 6.7  Give the user with authorization identifier ‘Manager’ full privileges to the Staff table GRANT ALL PRIVILEGES ON Staff TO Manager WITH GRANT OPTION;

Example 6.8  Give users ‘Personnel’ and ‘Director’ the privileges SELECT and UPDATE on column salary of the Staff table GRANT SELECT, UPDATE (salary) ON Staff TO Personnel, Director;

Example 6.9  Give all users the privilege SELECT on the Branch table GRANT SELECT ON Branch TO PUBLIC;

REVOKE  REVOKE takes away privileges granted with GRANT REVOKE [GRANT OPTION FOR] {PrivilegeList | ALL PRIVILEGES} ON ObjectName FROM {AuthorizationIdList | PUBLIC} [RESTRICT | CASCADE]

Effects of REVOKE

Example 6.10  Revoke the privilege SELECT on the Branch table from all users REVOKE SELECT ON Branch FROM PUBLIC;

Example 6.11  Revoke all privileges given to ‘Director’ on the Staff table REVOKE ALL PRIVILEGES ON Staff FROM Director;

Summary  Transactions  Authorization  Authorization identifier, ownership, privileges  GRANT/REVOKE

References  All the material (slides, diagrams etc.) presented in this lecture is taken (with modifications) from the Pearson Education website : 