Database management systems Database management systems Part 4/4: Stuff and things David.Teller@univ-orleans.fr http://www.univ-orleans.fr/lifo/Members/David.Teller/ 2006-16-02 Database management systems The program The program Client/server Connexion Security Privileges The program Client/server Connexion Security Privileges Database management systems The program The story so far What we have seen so far : Notions I I I I I I DBMS relations keys domains constraints operations Applications I I I little bits of Access, little bits of OOBase CREATE TABLE (and other CREATE) SELECT Database management systems The program Things break Sorry Database management systems The program Today I connexion users I meta-informations I security. I Database management systems The program By the way I hope you succeeded with all the exercises. Database management systems The program By the way I hope you succeeded with all the exercises. Any questions ? Database management systems The program By the way I hope you succeeded with all the exercises. Any questions ? Keep in mind that the instructions I give here must be tested. SQL is a standard but it is hardly implemented by everyone. Database management systems Client/server Connexion The program Client/server Connexion Security Privileges Database management systems Client/server Connexion Client ? Server ? So far, for technical reasons, you’ve been working with local databases only. Database management systems Client/server Connexion Client ? Server ? So far, for technical reasons, you’ve been working with local databases only. In real databases, the server is on a computer and the user is on a different computer. They interact either through terminals or with a client-server architecture. Database management systems Client/server Connexion Terminal Database management systems Client/server Connexion How-to That’s basically a command-line, just like MS-DOS. Database management systems Client/server Connexion How-to That’s basically a command-line, just like MS-DOS. This kind of thing works with I MySQL PostgreSQL I Oracle I Microsoft SQL Server ... I I Database management systems Client/server Connexion How-to That’s basically a command-line, just like MS-DOS. This kind of thing works with I MySQL PostgreSQL I Oracle I Microsoft SQL Server ... I I As they all have different syntax, here’s a hint: help. Database management systems Client/server Connexion Connectivity Q What are Access or OOBase ? Database management systems Client/server Connexion Connectivity Q What are Access or OOBase ? A They are just graphical interfaces, used to connect to database on servers. Essentially, they’re going to use the terminal but hide it from you. They happen to contain their own mini-server for testing and learning purposes. Database management systems Client/server Connexion Connectivity Q What are Access or OOBase ? A They are just graphical interfaces, used to connect to database on servers. Essentially, they’re going to use the terminal but hide it from you. They happen to contain their own mini-server for testing and learning purposes. In the case of OOBase, it’s a crappy one (HSQLDB). Database management systems Client/server Connexion Connectivity Q What are Access or OOBase ? A They are just graphical interfaces, used to connect to database on servers. Essentially, they’re going to use the terminal but hide it from you. They happen to contain their own mini-server for testing and learning purposes. In the case of OOBase, it’s a crappy one (HSQLDB). Q How do they cope with different syntax and semantics ? Database management systems Client/server Connexion Connectivity Q What are Access or OOBase ? A They are just graphical interfaces, used to connect to database on servers. Essentially, they’re going to use the terminal but hide it from you. They happen to contain their own mini-server for testing and learning purposes. In the case of OOBase, it’s a crappy one (HSQLDB). Q How do they cope with different syntax and semantics ? A A module called ODBC (Open DataBase Connectivity) or JDBC (Java DataBase Connectivity) contains drivers for each DBMS. Database management systems Client/server Connexion Connecting ? I would have like to let you connect. Database management systems Client/server Connexion Connecting ? I would have like to let you connect. OOBase seems to work. Database management systems Client/server Connexion Connecting ? I would have like to let you connect. OOBase seems to work. Access doesn’t. I just couldn’t get Access to work. Database management systems Client/server Connexion Connecting ? I would have like to let you connect. OOBase seems to work. Access doesn’t. I just couldn’t get Access to work. Server 193.49.89.10 – that’s my laptop Database master2 User master_student Password berruyer Database management systems Client/server Connexion Go ahead 1. Connect, using whatever you can. 2. Add a field date to Wanted and make it part of the Key. 3. Add some information about Phil DeFer the Outlaw. 4. Add the necessary to the database to specify the kind of hat used by each character. Database management systems Client/server Connexion Go ahead 1. Connect, using whatever you can. 2. Add a field date to Wanted and make it part of the Key. 3. Add some information about Phil DeFer the Outlaw. 4. Add the necessary to the database to specify the kind of hat used by each character. Any comments ? Database management systems Client/server Connexion Go ahead 1. Connect, using whatever you can. 2. Add a field date to Wanted and make it part of the Key. 3. Add some information about Phil DeFer the Outlaw. 4. Add the necessary to the database to specify the kind of hat used by each character. Any comments ? You may have had problems of concurrency. Database management systems Client/server Connexion Go ahead 1. Connect, using whatever you can. 2. Add a field date to Wanted and make it part of the Key. 3. Add some information about Phil DeFer the Outlaw. 4. Add the necessary to the database to specify the kind of hat used by each character. Any comments ? You may have had problems of concurrency. That’s one of the reasons why we need control. Database management systems Security Privileges The program Client/server Connexion Security Privileges Database management systems Security Privileges Security Security is all about preventing the wrong user from doing the wrong things. Database management systems Security Privileges Security Security is all about preventing the wrong user from doing the wrong things. Any suggestion for a mechanism ? Database management systems Security Privileges MAC Unix-style Mandatory Access Control: for a user u to be allowed to perform an operation o on some entity e, someone must have given u the right to perform exactly this operation o on exactly that entity e. Database management systems Security Privileges MAC Unix-style Mandatory Access Control: for a user u to be allowed to perform an operation o on some entity e, someone must have given u the right to perform exactly this operation o on exactly that entity e. Of course, giving the right to perform an operation is an operation by itself. Database management systems Security Privileges Operations Privilege Alter Create Create view Create user Insert Delete Drop File Grant option References Shutdown Show view Update Usage Context Tables Databases,Tables,Indexes Tables Server Admin Tables Tables Databases,Tables File access on server Databases,Tables,Functions,Procedures Databases,Tables Server Admin Tables Tables Server Admin Comment To alter the table To create new databases an To create new views To create new users To insert data into tables To delete existing rows To drop databases, tables, a To read and write files on t To give to other users those To have references on table To shut down the server To see views with SHOW C To update existing rows No privileges - allow connec Database management systems Security Privileges More operations ! Create routine Alter routine Create temporary tables Execute Index Lock tables Process Reload Replication client Replication slave Select Show databases Super Functions,Procedures Functions,Procedures Databases Functions,Procedures Tables Databases Server Admin Server Admin Server Admin Server Admin Tables Server Admin Server Admin To To To To To To To To To To To To To use CREATE FUNCTION/PRO alter or drop stored functions/p use CREATE TEMPORARY T execute stored routines create or drop indexes use LOCK TABLES (together view the plain text of currently reload or refresh tables, logs an ask where the slave or master read binary log events from the retrieve rows from table see all databases with SHOW D use KILL thread, SET GLOBA Database management systems Security Privileges Example GRANT ALL ON TABLE master2.* TO master_student ; Grants all table-manipulation rights for database master2 to user master_student.