Transactions, Roles & Privileges Oracle and ANSI Standard SQL Lecture 11.

Slides:



Advertisements
Similar presentations
13 Copyright © Oracle Corporation, All rights reserved. Controlling User Access.
Advertisements

Virtual training week 4 structured query language (SQL)
Transaction Processing. Objectives After completing this lesson, you should be able to do the following: –Define transactions effectively for an application.
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)
SQL components In Oracle. SQL in Oracle SQL is made up of 4 components: –DDL Data Definition Language CREATE, ALTER, DROP, TRUNCATE. Creates / Alters.
System Administration Accounts privileges, users and roles
Dec 15, 2003Murali Mani Transactions and Security B term 2004: lecture 17.
Database Administration Part 1 Chapter Six CSCI260 Database Applications.
Chapter 5 Data Manipulation and Transaction Control Oracle 10g: SQL
Agenda Journalling More Embedded SQL. Journalling.
Introduction to DBMS and SQL Introduction to DBMS and SQL GUIDED BY : MR. YOGESH SAROJ (PGT-CS) MR. YOGESH SAROJ (PGT-CS) Presented By : JAYA XII –COM.
Chapter 6 Additional Database Objects
Copyright س Oracle Corporation, All rights reserved. 14 Controlling User Access.
Database Programming Sections 13–Creating, revoking objects privileges.
I Copyright © Oracle Corporation, All rights reserved. Introduction.
Introduction to SEQUEL. What is SEQUEL? Acronym for Structural English Query Language Acronym for Structural English Query Language Standard language.
Copyright © 2011 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are trademarks of Accenture. SQL Workshop Day 3.
Chapter 6 Additional Database Objects Oracle 10g: SQL.
Triggers A Quick Reference and Summary BIT 275. Triggers SQL code permits you to access only one table for an INSERT, UPDATE, or DELETE statement. The.
Controlling User Access. Objectives After completing this lesson, you should be able to do the following: Create users Create roles to ease setup and.
Using Procedures & Functions Oracle Database PL/SQL 10g Programming Chapter 9.
Nitin Singh/AAO RTI ALLAHABAD 1 SQL Nitin Singh/AAO RTI ALLAHABAD 2 OBJECTIVES §What is SQL? §Types of SQL commands and their function §Query §Index.
Roles & privileges privilege A user privilege is a right to execute a particular type of SQL statement, or a right to access another user's object. The.
Outline Introduction Basic SQL Setting Up and Using PostgreSQL
ITBIS373 Database Development Lecture 3a - Chapter 3: Using SQL Queries to Insert, Update, Delete, and View Data.
8 Copyright © 2005, Oracle. All rights reserved. Managing Data.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Database structure and space Management. Segments The level of logical database storage above an extent is called a segment. A segment is a set of extents.
Copyright © 2004, Oracle. All rights reserved. CONTROLLING USER ACCESS Oracle Lecture 8.
Database Programming Sections 14– database transactions and controlling User Access.
Advanced Database- Dr. Arasteh1 Advanced Database Bahman Arasteh ( Ph.D, Software Engineering ) Department of Software Engineering, Azad University of.
Using SQL in PL/SQL Oracle Database PL/SQL 10g Programming Chapter 4.
SQL.. AN OVERVIEW lecture3 1. Overview of SQL 2  Query: allow questions to be asked of the data and display only the information required. It can include.
CSC 411/511: DBMS Design Dr. Nan WangCSC411_L12_JDBC_MySQL 1 Transations.
Altering Tables and Constraints Database Systems Objectives Add and modify columns. Add, enable, disable, or remove constraints. Drop a table. Remove.
IST 318 Database Administration Lecture 9 Database Security.
Chapter 13Introduction to Oracle9i: SQL1 Chapter 13 User Creation and Management.
A Guide to SQL, Eighth Edition Chapter Six Updating Data.
1 Advanced Database Concepts Transaction Management and Concurrency Control.
Oracle 11g: SQL Chapter 7 User Creation and Management.
13 Copyright © Oracle Corporation, All rights reserved. Controlling User Access.
Module 11: Managing Transactions and Locks
Relational Database Management System(RDBMS) Structured Query Language(SQL)
1 Copyright © 2006, Oracle. All rights reserved. Controlling User Access ( 사용자 접근 제어 )
1 Copyright © 2009, Oracle. All rights reserved. Controlling User Access.
Oracle 10g Database Administrator: Implementation and Administration Chapter 10 Basic Data Management.
SQL Introduction to database and SQL. Chapter 1: Databases and Database Users 6 Introduction to Databases Databases touch all aspects of our lives. Examples:
A Guide to MySQL 6. 2 Objectives Create a new table from an existing table Change data using the UPDATE command Add new data using the INSERT command.
1 Database Fundamentals Introduction to SQL. 2 SQL Overview Structured Query Language The standard for relational database management systems (RDBMS)
 CONACT UC:  Magnific training   
SQL Basics Review Reviewing what we’ve learned so far…….
Oracle 11g: SQL Chapter 5 Data Manipulation and Transaction Control.
1 Copyright © 2005, Oracle. All rights reserved. Oracle Database Administration: Overview.
Copyright  Oracle Corporation, All rights reserved. 14 Controlling User Access.
Controlling User Access
Managing Privileges.
DCL – Data Control Language
Controlling User Access
Controlling User Access
Managing Privileges.
IS221: Database Management
Introduction To Database Systems
LAB: Web-scale Data Management on a Cloud
DATABASE MANAGEMENT SYSTEM
Sections 17– database transactions and controlling User Access
مقدمة في قواعد البيانات
SQL .. An overview lecture3.
Managing Privileges.
INTRODUCTION A Database system is basically a computer based record keeping system. The collection of data, usually referred to as the database, contains.
Presentation transcript:

Transactions, Roles & Privileges Oracle and ANSI Standard SQL Lecture 11

Copyright 2006Page 2 Transactions, Roles & Privileges Privileges Privileges Roles Roles Granting Privileges Granting Privileges Revoking Privileges Revoking Privileges Synonyms Synonyms Creating Synonyms Creating Synonyms Droping Synonyms Droping Synonyms Design Structures Design Structures ACID Compliance ACID Compliance

Copyright 2006Page 3 Transactions, Roles & Privileges Privileges: Granted to other users System Privileges System Privileges Session – CREATE SESSION, ALTER SESSION. Session – CREATE SESSION, ALTER SESSION. Table – CREATE TABLE, CREATE ANY TABLE, ALTER ANY TABLE, DROP ANY TABLE, SELECT ANY TABLE, UPDATE ANY TABLE, DELETE ANY TABLE, FLASHBACK ANY TABLE. Table – CREATE TABLE, CREATE ANY TABLE, ALTER ANY TABLE, DROP ANY TABLE, SELECT ANY TABLE, UPDATE ANY TABLE, DELETE ANY TABLE, FLASHBACK ANY TABLE. Index – CREATE ANY INDEX, ALTER ANY INDEX, DROP ANY INDEX. Index – CREATE ANY INDEX, ALTER ANY INDEX, DROP ANY INDEX. Sequence – CREATE SEQUENCE, CREATE ANY SEQUENCE, ALTER ANY SEQUENCE, DROP ANY SEQUENCE. Sequence – CREATE SEQUENCE, CREATE ANY SEQUENCE, ALTER ANY SEQUENCE, DROP ANY SEQUENCE. View – CREATE VIEW, CREATE ANY VIEW, DROP ANY VIEW. View – CREATE VIEW, CREATE ANY VIEW, DROP ANY VIEW.

Copyright 2006Page 4 Transactions, Roles & Privileges Privileges: Granted to other users Object Privileges Object Privileges Select - Enables another user to query data or a sequence value. Select - Enables another user to query data or a sequence value. Insert - Enables another user to enter data from a table or view. Insert - Enables another user to enter data from a table or view. Update - Enables another user to change data from a table or view. Update - Enables another user to change data from a table or view. Delete - Enables another user to remove data from a table or view. Delete - Enables another user to remove data from a table or view. Index – Enables another user to create indexes on a table. Index – Enables another user to create indexes on a table. Reference – Enables another user to reference a primary key in a foreign key constraint. Reference – Enables another user to reference a primary key in a foreign key constraint. Execute - Enables another user to run a stored function, procedure, or package. Execute - Enables another user to run a stored function, procedure, or package. Alter - Enables another user to modify a table or a sequence. Alter - Enables another user to modify a table or a sequence. All – Enables another user to have all priviliges on a table. All – Enables another user to have all priviliges on a table.

Copyright 2006Page 5 Transactions, Roles & Privileges Privileges: Granting Process Object Privileges Object Privileges You grant privileges by using the GRANT command. You grant privileges by using the GRANT command. You revoke privileges by using the REVOKE command. You revoke privileges by using the REVOKE command. Grant Option Grant Option You grant privileges along with the right to grant the same privilege(s) to other users. You grant privileges along with the right to grant the same privilege(s) to other users.

Copyright 2006Page 6 Transactions, Roles & Privileges Roles: Defined Are collections of privileges. Are collections of privileges. Can be granted to users the same way as individual privileges. Can be granted to users the same way as individual privileges. Enable the DBA to manage sets of privileges and change them one place with cascading impacts. Enable the DBA to manage sets of privileges and change them one place with cascading impacts.

Copyright 2006Page 7 Transactions, Roles & Privileges Granting Privileges GRANT GRANT ON ON TO ;

Copyright 2006Page 8 Transactions, Roles & Privileges Revoking Privileges REVOKE REVOKE FROM ;

Copyright 2006Page 9 Transactions, Roles & Privileges Synonyms: Defined Are aliases that enable a relative naming. Are aliases that enable a relative naming. Replace absolute reference by schema name, a dot, and object name. Replace absolute reference by schema name, a dot, and object name. Can be deployed as public or private variants: Can be deployed as public or private variants: Private synonyms are only available in a single schema: Private synonyms are only available in a single schema: They simplify calls to objects. They simplify calls to objects. They translate the synonym to an absolute reference. They translate the synonym to an absolute reference. Public synonyms are available throughout the database instance. Public synonyms are available throughout the database instance. They simplify calls to objects. They simplify calls to objects. They translate the synonym to an absolute reference. They translate the synonym to an absolute reference.

Copyright 2006Page 10 Transactions, Roles & Privileges Synonym: Creating public synonyms CREATE PUBLIC SYNONYM CREATE PUBLIC SYNONYM FOR ;

Copyright 2006Page 11 Transactions, Roles & Privileges Synonym: Creating private synonyms CREATE SYNONYM CREATE SYNONYM FOR ;

Copyright 2006Page 12 Transactions, Roles & Privileges Synonym: Dropping synonyms DROP SYNONYM ;

Copyright 2006Page 13 Transactions, Roles & Privileges Design Structures: Definers’ rights Is the default when creating stored programs. Is the default when creating stored programs. Means that the stored program executes with the same privileges as the defining user. Means that the stored program executes with the same privileges as the defining user. Can mean that calling the stored programs lets it run against any schema level data. Can mean that calling the stored programs lets it run against any schema level data. Typically means that users only access a slice of data in any schema, like a private virtual database. Typically means that users only access a slice of data in any schema, like a private virtual database.

Copyright 2006Page 14 Transactions, Roles & Privileges Design Structures: Definers’ rights

Copyright 2006Page 15 Transactions, Roles & Privileges Design Structures: Invokers’ rights Is the override when creating stored programs. Is the override when creating stored programs. Means that the stored program executes with the local privileges, which generally differ from the definer’s privileges. Means that the stored program executes with the local privileges, which generally differ from the definer’s privileges. Typically means that users only access their own schema data, like a distributed or local database. Typically means that users only access their own schema data, like a distributed or local database.

Copyright 2006Page 16 Transactions, Roles & Privileges Design Structures: Invokers’ rights

Copyright 2006Page 17 Transactions, Roles & Privileges ACID: Defined A – ATOMIC, which means that everything or nothing happens. A – ATOMIC, which means that everything or nothing happens. C – CONSISTENT, which means that everything happens the same whether processed serially or in parallel. C – CONSISTENT, which means that everything happens the same whether processed serially or in parallel. I – ISOLATED, which means partial results are hidden from other users. I – ISOLATED, which means partial results are hidden from other users. D – DURABLE, which means changes become permanent when finalized. D – DURABLE, which means changes become permanent when finalized.

Copyright 2006Page 18 Transactions, Roles & Privileges ACID: DML statements Single DML statements: Single DML statements: Are transactions. Are transactions. Lock affected rows. Lock affected rows. Prevent others from updating locked rows. Prevent others from updating locked rows. Changes are only visible to the session making them until a COMMIT command is executed. Changes are only visible to the session making them until a COMMIT command is executed. Locks are also released when a ROLLBACK command is executed, which undoes the prior change. Locks are also released when a ROLLBACK command is executed, which undoes the prior change.

Copyright 2006Page 19 Transactions, Roles & Privileges ACID: Sets of DML statements Multiple DML statements: Multiple DML statements: Are compound transactions, which means they are made up of smaller transaction units. Are compound transactions, which means they are made up of smaller transaction units. Lock affected rows in more than one table or view. Lock affected rows in more than one table or view. Prevent others from updating locked rows. Prevent others from updating locked rows. Changes are only visible to the session making them until a COMMIT command is executed. Changes are only visible to the session making them until a COMMIT command is executed. Locks are also released when a ROLLBACK command is executed, which undoes the prior change. Locks are also released when a ROLLBACK command is executed, which undoes the prior change.

Copyright 2006Page 20 Transactions, Roles & Privileges ACID: Data Control Statements (DCL) DCL statements are: DCL statements are: The SAVEPOINT command, that sets a marker that enables undoing transactions only to a save point. The SAVEPOINT command, that sets a marker that enables undoing transactions only to a save point. The COMMIT command, which makes permanent the data change. The COMMIT command, which makes permanent the data change. The ROLLBACK command, which can undo everything since: The ROLLBACK command, which can undo everything since: The last COMMIT command. The last COMMIT command. A specific SAVEPOINT command. A specific SAVEPOINT command.

Copyright 2006Page 21 Transactions, Roles & Privileges ACID: ROLLBACK command ROLLBACK [TO ];

Copyright 2006Page 22 Transactions, Roles & Privileges ACID: SAVEPOINT command SAVEPOINT ;

Copyright 2006Page 23 Transactions, Roles & Privileges ACID: COMMIT command SAVEPOINT ;

Copyright 2006Page 24 Summary Privileges Privileges Roles Roles Granting Privileges Granting Privileges Revoking Privileges Revoking Privileges Synonyms Synonyms Creating Synonyms Creating Synonyms Droping Synonyms Droping Synonyms Design Structures Design Structures ACID Compliance ACID Compliance