© D. Wong 2003 1 Security and User Authorization in SQL 8.7 pp. 410  Authorization ID = user name  Special authorization ID: PUBLIC  Privileges for:

Slides:



Advertisements
Similar presentations
Chapter 10: Designing Databases
Advertisements

Why Object-Oriented DBMS? Abstract data types Interface with host programming language (the impedance mismatch). Object identity: (peter, 40, {(john, 15,
Jane Reid, BSc/IT DB, QMUL, 25/2/02 1 Object-oriented DBMS Background to ODBMS ODBMS requirements Object components ODB conceptual design –Graphical ODB.
CSC 570 Notes for Chapter 10 Advanced Topics in Relational Databases.
Object Databases Baochuan Lu. outline Concepts for Object Databases Object Database Standards, Languages, and Design Object-Relational and Extended-Relational.
ODMG Standard: Object Model1 OBJECT-ORIENTED DATABASE SYSTEMS ODMG Standard: Object Model Susan D. Urban and Suzanne W. Dietrich Department of Computer.
Winter 2002Arthur Keller – CS 18015–1 Schedule Today: Feb. 28 (TH) u Datalog and SQL Recursion, ODL. u Read Sections , Project Part 6.
Additional ODL Concepts OO Model to Relational Model Object-Relational Design OO vs OR.
Data Management Design
Fundamentals, Design, and Implementation, 9/e Chapter 7 Using SQL in Applications.
Programs with SQL Host language + Embedded SQL Preprocessor Host Language + function calls Host language compiler Host language program Preprocessor Host.
Other Data Models. Text New edition (DBS the complete book): Chapter 4 Old edition (First course in DBS): –Section 2.1 –Section –Section 2.4.1,
Fundamentals, Design, and Implementation, 9/e Chapter 16 Object-Oriented Database Processing.
Object Oriented Databases - Overview
SQL Overview Defining a Schema CPSC 315 – Programming Studio Spring 2008 Project 1, Lecture 3 Slides adapted from those used by Jeffrey Ullman, via Jennifer.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 11 Object and Object- Relational Databases.
1 Announcements Research Paper due Monday November 22.
Databases Illuminated Chapter 7 The Object-Oriented Model.
RIZWAN REHMAN, CCS, DU. Advantages of ORDBMSs  The main advantages of extending the relational data model come from reuse and sharing.  Reuse comes.
Advanced Database CS-426 Week 13 – Object Relational Databases.
Object-Oriented Database Design using UML and ODMG
Introduction To Databases IDIA 618 Fall 2014 Bridget M. Blodgett.
Object and object-relational databases 1. Object databases vs. Object-relational databases Object databases Stores complex objects – Data + functions.
Database Design April 3, Projects, More Details Goal: build a DB application. (almost) anything goes. Groups of 3-4. End of week 2: groups formed.
Advanced Database CS-426 Week 2 – Logic Query Languages, Object Model.
SQL Overview Defining a Schema CPSC 315 – Programming Studio Slides adapted from those used by Jeffrey Ullman, via Jennifer Welch Via Yoonsuck Choe.
Object Query Language (OQL) and Language Binding
Agenda  TMA03  M877 Block 3 Databases with Objects.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 7-1 David M. Kroenke’s Chapter Seven: SQL for Database Construction and.
1 Introduction to databases concepts CCIS – IS department Level 4.
DBMS Lecture 9  Object Database Management Group –12 Rules for an OODBMS –Components of the ODMG standard  OODBMS Object Model Schema  OO Data Model.
ORDBS1 Object Relational Database Systems: 1. Introduction 2. Objects in SQL3 3. Comparison of ODL/OQL and SQL3 Approaches CIS 671.
CST203-2 Database Management Systems Lecture 2. One Tier Architecture Eg: In this scenario, a workgroup database is stored in a shared location on a single.
Why Object-Oriented DBMS? Abstract data types (relational data model is too simple). Interface with host programming language Managing large number of.
Chapter 21 A Object Data Model - Intro Copyright © 2004 Pearson Education, Inc.
Object-Oriented Database Management Systems (ODBMS)
1 Advanced Databases (CM036): Lecture # 5 ( Object-Relational and Nested-Relational Databases) Introduction to Object-Relational features of Oracle 9i.
ADVANCED DATABASE SYSTEMS DR. FATEMEH AHMADI- ABKENARI SEPTEMBER Object Databases.
Database Management COP4540, SCS, FIU Constraints and security in SQL (Ch. 8.6, Ch22.2)
Database Management COP4540, SCS, FIU Database Modeling A Introduction to object definition language (ODL)
Chapter 12: Designing Databases
Chapter 18 Object Database Management Systems. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for object.
Lecture2: Database Environment Prepared by L. Nouf Almujally 1 Ref. Chapter2 Lecture2.
Object Definition Language
1 CS 430 Database Theory Winter 2005 Lecture 2: General Concepts.
1 Advanced Databases (CM036) – Lecture # 12: The ODMG Standard for Object Databases Object Query Language (OQL) & Language Binding Advanced Database Technologies.
© D. Wong Ch. 2 Entity-Relationship Data Model (continue)  Data models  Entity-Relationship diagrams  Design Principles  Modeling of constraints.
FEN NOEA/IT - Databases/ODB1 ODB – Object DataBases Object-Oriented – Fundamental Concepts UML and EE/R OO and Relational Databases Introduction.
Databases Illuminated
Object Relational Features
11-1 CHAPTER 11 Concepts for Object-Oriented Databases.
AND OBJECT-ORIENTED DATABASES OBJECT-RELATIONAL DATABASES.
The ODMG Standard for Object Databases
Chapter 18 Object Database Management Systems. Outline Motivation for object database management Object-oriented principles Architectures for object database.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Chapter 12 Outline Overview of Object Database Concepts Object-Relational Features Object Database.
1 10 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 10 Designing Databases.
1 Part IV: Object-Relational Databases  Ch. 30: Types, Object Views, Methods  Ch. 31: Nested Tables and Varying Arrays  Ch. 32: Large Objects  Ch.
Database System Concepts Introduction Purpose of Database Systems View of Data Data Models Data Definition Language Data Manipulation Language Transaction.
OODBMS and ORDBMS. Background Object-oriented software, based on the principles of user-defined datatypes, along with inheritance and polymorphism, is.
Introduction to Database Programming with Python Gary Stewart
Why Object-Oriented DBMS?
SQL Environment.
OBJECTS & DATABASES Arnaud Sahuguet – CIS-550.
Object-Oriented Database Management System (ODBMS)
Chapter 12 Outline Overview of Object Database Concepts
ISC321 Database Systems I Chapter 10: Object and Object-Relational Databases: Concepts, Models, Languages, and Standards Spring 2015 Dr. Abdullah Almutairi.
Data Model.
Object Definition Language
Object-Relational Features
Chapter 15: Object-Oriented Database Development
Presentation transcript:

© D. Wong Security and User Authorization in SQL 8.7 pp. 410  Authorization ID = user name  Special authorization ID: PUBLIC  Privileges for: SELECT, INSERT, UPDATE, DELETE, REFERENCE, USAGE, TRIGGER, EXECUTE, UNDER  For SELECT, INSERT, UPDATE, may also specify on attribute level  Privileges are needed for relations in the subqueries also. e.g. Fig pp 411

© D. Wong Creating privileges  Owner of schema or modules has all privileges  Establish ownership at: 1.When a schema is created. 2.When a session is initiated by a CONNECT statement. e.g. CONNECT TO ABC_server AS conn1 AUTHORIZATION smith; 3.When a module is created, use an optional AUTHORIZATION clause

© D. Wong Granting privileges  Owner of a relation has GRANT privilege.  If you have the "GRANT" privilege to a set of privileges, you may grant them to any user. GRANT ON GRANT ON TO [WITH GRANT OPTION] e.g. GRANT SELECT, INSERT ON Studio TO kirk, picard WITH GRANT OPTION;-- by Janeway GRANT SELECT, INSERT ON Studio TO sisko; -- by picard GRANT SELECT, INSERT(name) ON Studio TO sisko; -- by kirk  Grant diagram e.g. Fig pp. 417

© D. Wong Revoking Privileges  Privileges can be revoked: REVOKE [GRANT OPTION FOR] ON FROM {CASCADE | RESTRICT} e.g. REVOKE SELECT, INSERT ON Studio FROM picard CASCADE ;  If A has been given a privilege by several different people on the same element, then all of them have to revoke in order for A to lose the privilege  If A granted privilege P to B, who granted P to C, then A revokes P from B will also revoke P from C. e.g. Fig 8.29 pp 420

© D. Wong Object-Oriented Data Model  ODMG –Object Database Management Group –Deals with OO standard for database –Also deals with ORDBMS (Object Relational DBMS)  Major parts of ODMG standard: –ODL: Object Definition Language, how to specify the db schema –OQL: the SQL-like Object Query Language –Host language binding: how to use ODL and OQL from within procedural languages. The standard define bindings for C++, SmallTalk, and Java. In ODMG, the host language also serves as the object manipulation language.

© D. Wong ODMG database management system  Application is written in a host language e.g. C++, Java  In order to access the db, the application must be linked with the ODBMS libraries and with the code that implements its class methods.  Much of the code that manipulates objects is part of the database itself.  Each class has a set of methods. Method signatures are specified in the schema using ODL.  The code for these methods is stored on the database server.  ODBMS invokes the appropriate code whenever a method is called.  OODMG database data is modified directly in the host language e.g. Stud.Name = "Joe";// Stud contains the oid of a // persistent Student object

© D. Wong Architecture of an ODMG database Schema Spec. in ODL(Embedded in C++, Java, etc) Source code for class methods in host language (C++, Java, …) Host language compiler Linker Method Implementation Binaries Stored in DBMS ODL Preprocessor Metadata Object Data ODBMS Software ODBMS Libraries Method Implementation Obj. code Information stored at the Server Data Access Ref. "Databases and Transaction Processing" – Lewis, Addison Wesley

© D. Wong Structure of ODMG Applications ODBMS ODBMS library Method implementation binaries stored in DBMS Application source code in host language Host language compiler Application Object code Linker Executable code Ref. "Databases and Transaction Processing" – Lewis, Addison Wesley

© D. Wong Object Definition Language (ODL)  Conceptual model to describe the attributes, methods, and relationships of each object type (class), including it's inheritance properties.  ODL classes describes 3 kinds of elements: 1.Attributes: values associated with the object 2.Relationship: connection between the object itself and other objects 3.Methods: functions that may be applied to objects of the class. Methods are specified by it's signature: name, arguments (names, order, and type), return value type, name of any exceptions it can raise. e.g. Fig. 4.2 pp137

© D. Wong Object Definition Language (ODL) (continued)  Class declaration  Class include: 1.Class Name 2.Key declaration(s). Optional. 3.Extent Declaration = name for the set of currently existing objects of a class (I.e. relation instance in relational model) 4.Element declarations: attributes, relationships, methods class [(extent names)] { }

© D. Wong Object Definition Language (ODL) (continued 2)  Attribute declaration (non-objects): attribute ; e.g. 1 attribute string name; e.g. 2 attribute Struct Addr{ string street, string city} address;  Relationship (and inverse relationship) declaration (objects): relationship [rangetype] inverse className:: ; e.g. relationship Set stars inverse Star::starredIn;

© D. Wong  Method declaration (arguments) raises ( ); (arguments) raises ( ); e.g. 1: void lengthInhours() raises (noLengthFound); e.g. 2: void starName(out Set ) ;  Arguments: in : read-only out: for returning values inout: for both

© D. Wong ODL Relationships  Only binary relationships supported –Use a connecting class to represent multiway relationships Fig. 2.9 pp. 34.  Relationships are defined in inverse pairs. Fig. 4.3 pp Many-many: have a set type of class in each direction 2.Many-one: a set type for the one, and a simple class name for the many 3.One-one: simple class name in both

© D. Wong  Subclass (S is a subclass of D) Class C extends D { class C's declarations } e.g. class Cartoon extends Movie { relationship Set voices; }  Multiple inheritance (separate the super classes by : in the extend declaration) e.g. class CartoonMurderMystery extends MurderMystery : Cartoon  Name conflict resolutions with Multiple inheritance pp. 151

© D. Wong ODL data types  Basis: 1.Atomic type: integer, float, characters, string, boolean, enum 2.Class names  Structured types: 1.Set: Set // finite sets of elements of type T 2.Bag: Bag // finite bags of element type T 3.List: List // finite lists of 0 or more elements T 4.Array: Array // T = type, i = no. of elements 5.Dictionary: Dictionary, T is key type, S is range type. Each pair has unique key value. 6.Structures : Struct N { field1, …}

© D. Wong Keys declaration in ODL  Optional because each object is identified by an internal OID  May declare one or more keys in the extent declaration e.g. class Movie (extent Movies key (title, year)) { attribute string title; attribute integer year; …}

© D. Wong ODL to Relational Design  Invent a new attribute to serve as key when there is no key in the ODL design  ODL attributes that are not atomic are converted into relation attributes that usually are redesigned with normalization  Methods are not converted to relational design. But can have methods in Object Relational design

© D. Wong Object-Relational DB (ORDB)  SQL-99 adopted a limited subset of the object relational model  ORDBMS is a conservative extension to the existing RDBMS.  In general, ORDB consists of: –A set of relations (which can be viewed as classes) –Each relation consists of a set of tuples (which can be viewed as instances of the class that represents the relation) –Each tuple is of the form (oid, val) where oid is an object id and val is a tuple value whose components can be arbitrary values (e.g. primitive values, sets of tuples, and references to other objects)

© D. Wong ORDB, ODB, RDB  Difference between ORDB and ODB –In ORDB, the top-level structure of each object instance is always a tuple. In ODB, top-level structure can be an arbitrary value.  Difference between ORDB and RDB: –RDB tuple components must be primitive values –ORDB tuple components can be arbitrary values

© D. Wong Oracle Object example create type ADDRESS_TY as object (Street VARCHAR2(50), CityVARCHAR2(25), CityVARCHAR2(25), StateCHAR(2), StateCHAR(2), ZipNUMBER); ZipNUMBER); create type PERSON_TY as object (NameVARCHAR2(25), BirthDate DATE; BirthDate DATE; AddressADDRESS_TY AddressADDRESS_TY member function AGE_DAYS (BirthDate IN DATE) return NUMBER); member function AGE_DAYS (BirthDate IN DATE) return NUMBER);

© D. Wong Oracle Object example (continued)  Defining methods for user defined types using PL/SQL: Create type body PERSON_TY as Member function AGE_DAYS (BirthDate DATE) return NUMBER is begin RETURN ROUND(SysDate – BirthDate); end; -- if there are more methods to the data type, may define here end;/

© D. Wong Oracle Object example (continued 2)  Create table with user defined abstract data types: create table CUSTOMER (Customer_ID NUMBER, Person PERSON_TY); Person PERSON_TY);  Use constructors for inserting data: insert into CUSTOMER values (1, PERSON_TY('Joe Smith', '01- JAN-90', ADDRESS_TY('10 Spring ST', 'BHM', 'AL', 35110)));  Use path names to access the attributes: SELECT Person.Address.Street FROM CUSTOMER; SELECT Person.AGE_DAYS(Person.BirthDate) FROM CUSTOMER; UPDATE CUSTOMER SET Person.Address.City = 'Birmingham' WHERE Person.Address.City = 'BHM';

© D. Wong Object-Orient Analysis and Design  Normalization in relational model relates each attribute to its primary key e.g. The following is in 3NF: create table CUSTOMER (Customer_ID NUMBER, (Customer_ID NUMBER, Name VARCHAR2(25), Name VARCHAR2(25), BirthDate DATE; BirthDate DATE; Street VARCHAR2(50), Street VARCHAR2(50), CityVARCHAR2(25), CityVARCHAR2(25), StateCHAR(2), StateCHAR(2), ZipNUMBER ); ZipNUMBER );  For OO, further group related columns into abstract data types (ADT) (e.g. ADDRESS_TY ) for reuse.  Then look for relationships among ADTs to determine if nesting is appropriate (e.g. PERSON_TY);