1 Database Administration. 2 Objectives  Understand, create, and drop views  Grant and revoke users’ privileges  Understand and obtain information.

Slides:



Advertisements
Similar presentations
Creating Tables. 2 home back first prev next last What Will I Learn? List and provide an example of each of the number, character, and date data types.
Advertisements

Chapter 23 Database Security and Authorization Copyright © 2004 Pearson Education, Inc.
Basic SQL Introduction Presented by: Madhuri Bhogadi.
Database Management System
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.
Introduction to Structured Query Language (SQL)
Concepts of Database Management, 4th Edition, Pratt & Adamski
Authority, Sequence, Changing Data Pepper. SECURITY Everyone can use the same database Different people can make different changes Some to structure Some.
A Guide to Oracle9i1 Advanced SQL And PL/SQL Topics Chapter 9.
Security and Transaction Management Pertemuan 8 Matakuliah: T0413/Current Popular IT II Tahun: 2007.
Concepts of Database Management Sixth Edition
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’
Introduction to Structured Query Language (SQL)
A Guide to SQL, Seventh Edition. Objectives Understand, create, and drop views Recognize the benefits of using views Grant and revoke user’s database.
INTEGRITY Enforcing integrity in Oracle. Oracle Tables mrobbert owner granted access.
View n A single table derived from other tables which can be a base table or previously defined views n Virtual table: doesn’t exist physically n Limitation.
Security and Integrity
Objectives of the Lecture :
Chapter 6: Integrity and Security Thomas Nikl 19 October, 2004 CS157B.
Chapter 6 Additional Database Objects
Concepts of Database Management, Fifth Edition Chapter 4: The Relational Model 3: Advanced Topics.
Chapter 4 The Relational Model 3: Advanced Topics Concepts of Database Management Seventh Edition.
Database Programming Sections 13–Creating, revoking objects privileges.
Chapter 6 Additional Database Objects Oracle 10g: SQL.
Controlling User Access. Objectives After completing this lesson, you should be able to do the following: Create users Create roles to ease setup and.
Chapter 6 Database Administration
Database Management COP4540, SCS, FIU Constraints and security in SQL (Ch. 8.6, Ch22.2)
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
1 A Guide to SQL Chapter 2. 2 Introduction Mid-1970s: SQL developed under the name SEQUEL at IBM by San Jose research facilities to be the data manipulation.
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
Outline Introduction Basic SQL Setting Up and Using PostgreSQL
1 Chapter 6 Database Administration. 2 Introduction Database administration The process of managing a database Database administrator A person or an entire.
Controlling User Access Fresher Learning Program January, 2012.
Controlling User Access. 2 home back first prev next last What Will I Learn? Compare the difference between object privileges and system privileges Construct.
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.
DBAdmin D D D D D a a a a a t t t t t a a a a a b b b b b a a a a a s s s s s e e e e eAdministration / Embedded SQL by: Glen Orsburn Chapter 6.
Chapter 8 Embedded SQL.
Chapter 5 : Integrity And Security  Domain Constraints  Referential Integrity  Security  Triggers  Authorization  Authorization in SQL  Views 
Transactions, Roles & Privileges Oracle and ANSI Standard SQL Lecture 11.
Altering Tables and Constraints Database Systems Objectives Add and modify columns. Add, enable, disable, or remove constraints. Drop a table. Remove.
Chapter 13Introduction to Oracle9i: SQL1 Chapter 13 User Creation and Management.
Database Management Systems, 2 nd Edition, R. Ramakrishnan and J. Gehrke1 Security Lecture 17.
Oracle 11g: SQL Chapter 7 User Creation and Management.
13 Copyright © Oracle Corporation, All rights reserved. Controlling User Access.
Database Security. Multi-user database systems like Oracle include security to control how the database is accessed and used for example security Mechanisms:
1 Copyright © 2009, Oracle. All rights reserved. Controlling User Access.
Creating and Revoking Object Privileges. 2 home back first prev next last What Will I Learn? Explain what a ROLE is and what its advantages are. Construct.
Dr. Chen, Oracle Database System (Oracle) 1 Chapter 7 User Creation and Management Jason C. H. Chen, Ph.D. Professor of MIS School of Business Gonzaga.
A Guide to SQL, Sixth Edition 1 Chapter 5 Updating Data.
Chapter 3 Table Creation and Management Oracle 10g: SQL.
1 Database Fundamentals Introduction to SQL. 2 SQL Overview Structured Query Language The standard for relational database management systems (RDBMS)
Views / Session 3/ 1 of 40 Session 3 Module 5: Implementing Views Module 6: Managing Views.
Database Security Advanced Database Dr. AlaaEddin Almabhouh.
Creating Indexes Database Systems Objectives Distinguish between the indexes that are created automatically and those that are created manually.
Dept. of Computer & Information Sciences
Controlling User Access
Controlling User Access
Managing Privileges.
TABLES AND INDEXES Ashima Wadhwa.
Managing Privileges.
Database Security.
Database Security.
OER- UNIT 3 Authorization
What Is a View? EMPNO ENAME JOB EMP Table EMPVU10 View
Chapter 2 Views.
A Guide to SQL, Eighth Edition
SQL .. An overview lecture3.
Chapter 2 Views.
Managing Privileges.
IST 318 Database Administration
Presentation transcript:

1 Database Administration

2 Objectives  Understand, create, and drop views  Grant and revoke users’ privileges  Understand and obtain information from the system catalog

3 Views  Base tables Existing, permanent tables in a relational database  View A derived table where data is derived from a base table User interacts with the view View provides security

4 View Benefits  Views provide data independence  Different users can view the same data in different ways because each user has their own view  It can contain only those columns required by a given user Greatly simplifies user perception of database Furnishes a measure of security since user as access to data contained only in their view

5 Views  A view is defined by creating a defining query (SQL command that indicates the rows and columns that will appear in the view)  The formulation of the view definition is: CREATE AS  The defining query can be any valid SQL query  Define a view named HOUSEWARES that consists of the part number, part description, units on hand, and unit price of all parts in item class HW

6 Joins  In general, views that involve joins of base tables can cause problems at update  If two base tables have the same primary key and the primary key is used as the join column, updating the database is not a problem

7 DROP View Command  Deletes a view definition only  Table and data on which view is based still exists

8 Security  Security is the prevention of unauthorized access to the database  Two security mechanisms Views GRANT command

9 GRANT and REVOKE Commands  Grant different privileges to users and revoke them later, if necessary: Ability to select rows from a table Insert new rows Update existing rows  GRANT TO  REVOKE FROM

10 Privileges  Privileges that can be granted are SELECT UPDATE DELETE INSERT INDEX  For a user to pass the privilege on to others the database administrator must use GRANT statement and include WITH GRANT OPTION

11 GRANT Command  User Jones must be able to retrieve data from the SALES_REP table GRANT SELECT ON SALES_REP TO JONES;  Users Smith and Brown must be able to add new parts to the PART table. GRANT INSERT ON PART TO SMITH, BROWN;

12 GRANT Command  User Thomas must be able to change the structure of the CUSTOMER table GRANT ALTER ON CUSTOMER TO THOMAS;  User Wilson must have all privileges for the SALES_REP, CUSTOMER, and ORDERS tables GRANT ALL ON SALES_REP, CUSTOMER, ORDERS TO WILSON;

13 REVOKE Command  User Jones is no longer allowed to retrieve data from the SALES_REP table REVOKE SELECT ON SALES_REP FROM JONES;

14 Comprehensive Example  Allow sales rep number 03 (Mary Jones) to access any data concerning the customers she represents, but do not permit her to access data concerning any other customer CREATE VIEW SLSR3CST AS SELECT * FROM CUSTOMER WHERE SLSREP_NUMBER = ’03’ GRANT SELECT ON SLSR3CST TO MARY JONES;

15 The System Catalog  Information concerning tables known to the DBMS is kept in the system catalog, or the data dictionary  System catalog contains tables USER_TABLES (DBA_TABLES) USER_TAB_COLUMNS (DBA_TAB_COLUMNS) USER_VIEWS (DBA_VIEWS)  System catalog is a relational database  Users need special privileges to view the data in the system catalog

16 System Catalog Example  List the name of every table for which the owner (creator of the table) is PRATT SELECT TABLE_NAME FROM DBA_TABLES WHERE OWNER = ‘PRATT’;  List the name of every view whose owner is PRATT SELECT VIEW_NAME FROM DBA_VIEWS WHERE OWNER = ‘PRATT’;

17 Summary  A view is a pseudotable whose contents are derived form data in existing base tables whenever users attempt to access the view  To define a view, use the CREATE VIEW statement This statement includes a defining query that describes the portion of the database included in the view When a user retrieves data from the view, the query entered by the user is merged with the defining query, producing the query that SQL actually executes

18 Summary  Views provide data independence, allow database access control, and simplify the database structure for users  You cannot update views that involve statistics and views with joins of non-primary key columns In this case you must make all updates to the base table  Use the DROP VIEW command to delete a view  Use the GRANT command to give users access privileges to various portions of the database  Use the REVOKE command to terminate previously granted privileges

19 Summary  The DBMS maintains information about the tables, columns, indexes, and other system elements in the system catalog Information about tables is kept in the SYSTABLES table, information about columns is kept in the SYSCOLUMNS table, and information about views is kept in the SYSVIEWS table In Oracle these same tables are named DBA_TABLES, DBA_TAB_COLUMNS, and DBA_VIEWS  Use the SELECT command to obtain information from the system catalog  The DBMS updates the system catalog continuously; users do not update the catalog directly