SlideShare a Scribd company logo
1 of 18
Download to read offline
Database Lab
Controlling User Access
Ruba Sultan
Controlling User Access1
 Database security can be classified into two
categories:
 System security
 It covers access and use of the database at the system level
such as username and password, disk space allocated to
user and system operations allowed by the user.
 Data security
 Covers access and use of the database objects and the
actions that those users can have on the objects.
2
1 Introduction to Oracle: SQL and PL/SQL P14-4 Neena Kochhar, Ellen Gravina and Priya Nathan, July 1999
Privilege2
 Privileges are the right to execute a particular SQL
statements.
 There are two types of privileges:
 System privilege
 Gain access to the database.
 Object privilege
 Manipulate the content of the database objects.
 Schema: is a collection of objects such as tables, views
and sequences, It is owned by database user and has
the same name as that user.
2 Introduction to Oracle: SQL and PL/SQL P14-4 Neena Kochhar, Ellen Gravina and Priya Nathan, July 1999
System Privilege3
4
 The DBA has high-level system privileges
 CREATE new users
 Remove users
 Remove tables
 Back up tables
3 Introduction to Oracle: SQL and PL/SQL P14-5 Neena Kochhar, Ellen Gravina and Priya Nathan, July 1999
Creating Users4
 The DBA creates users by using the CREATE USER
statement.
CREATE USER username
IDENTIFIED BY password;
Notes:
 The user does not have any privilege at this points.
 The DBA can then grant a number of privileges to that user,
these privilege determine what the user can do at the
database level.
5
4 Introduction to Oracle: SQL and PL/SQL P14-6 Neena Kochhar, Ellen Gravina and Priya Nathan, July 1999
User System Privileges5
 Once a user is created, the DBA can grant specific
system privileges to a user.
GRANT privilege [, privilege…]
TO user [, user…];
 Typical system privileges granted to user:
 CREATE SESSION
 CREATE TABLE
 CREATE SEQUENCE
 CREATE VIEW
 CREATE PROCEDURE
6
5 Introduction to Oracle: SQL and PL/SQL P14-7 Neena Kochhar, Ellen Gravina and Priya Nathan, July 1999
Questions
 Question1
Create two users the first with name Ahmad and
password abc123 the other one with name Asmaa
and password xyz123.
 Question2
Give both users (Ahmad and Asmaa) these system
privileges Create session, Create table and Create
view.
7
Roles6
8
 A role is a named group of related privileges that
can be granted to the user.
 Role make granting and revoking privileges easier to
perform and maintain.
 A user can have access to several roles, and several
users can be assigned the same role.
6 Introduction to Oracle: SQL and PL/SQL P14-9 Neena Kochhar, Ellen Gravina and Priya Nathan, July 1999
Creating and Assigning a Role7
9
 DBA must create the role
 The DBA can assign privileges to the role using
GRANT statement.
 The DBA can assign users to the role using GRANT
statement.
 The syntax for creating a role
CREATE ROLE rolename;
7 Introduction to Oracle: SQL and PL/SQL P14-10 Neena Kochhar, Ellen Gravina and Priya Nathan, July 1999
Changing Password8
10
 The DBA creates your user account and initializes your
password.
 You can change your password by using the ALTER USER
statement.
ALTER USER Ahmad
IDENTIFIED BY abcdef;
8 Introduction to Oracle: SQL and PL/SQL P13-4 Neena Kochhar, Ellen Gravina and Priya Nathan, July 1999
Object Privileges9
11
9 Introduction to Oracle: SQL and PL/SQL P14-12 Neena Kochhar, Ellen Gravina and Priya Nathan, July 1999
Object Privilege Table View Sequence Procedure
ALTER  
DELETE  
EXECUTE 
INDEX 
INSERT  
REFERENCE 
SELECT   
UPDATE  
Object Privileges10
12
 Object privileges vary from object to object.
 An owner has all the privileges one the object.
 An owner can give specific privileges on that owner’s
object.
GRANT objectprivilege[(columns)]
ON object
To {user|role|PUBLIC}
[WITH GRANT OPTION]
10 Introduction to Oracle: SQL and PL/SQL P14-13 Neena Kochhar, Ellen Gravina and Priya Nathan, July 1999
Questions
13
 Question3
Give both users Ahmad and Asmaa the SELECT
privilege on Employees table.
 Question4
Give Asmaa the UPDATE privilege on salary and
commission columns in Employees table.
WITH GRANT OPTION and PUBLIC11
 A privilege that is granted WITH GRANT OPTION
can be passed on to other users and roles by the
grantee.
 Object privileges granted WITH GRANT OPTIONS
are revoked when the grantor’s privilege is
revoked.
 An owner of a table can grant access to all users by
using the PUBLIC keyword.
14
11 Introduction to Oracle: SQL and PL/SQL P14-15 Neena Kochhar, Ellen Gravina and Priya Nathan, July 1999
Revoke Object Privileges12
 Use REVOKE statement to revoke privileges granted
to other users.
 Privileges granted to others through the WITH
GRANT OPTION will also be revoked.
REVOKE {privilege [, privilege…]|ALL}
ON object
FROM {user[, user…] | role |PUBLIC}
[CASCADE CONSTRAINTS];
15
12 Introduction to Oracle: SQL and PL/SQL P14-17 Neena Kochhar, Ellen Gravina and Priya Nathan, July 1999
Revoke Object Privileges(cont)
 CASCADE CONSTRAINT is required to remove any
referential integrity constraints made to the object
by means of the REFERENCES privilege.
16
Questions
 Question5
Write a complete SQL statements that creates two
users Ameer and Susan, each of these user must
have privilege(s) to access Employees table in hr
user account. A role need to be created with name
HumanRes and it has ALTER privilege on
Employees table and add the two users(Ameer and
Susan) to this role.
Notes:
 hr provides privileges to Ameer and Ameer
provides privileges to Susan.
17
Questions
18
User: hr
Pwd: oradb
User: Ameer
Pwd: abc123
SELECT
INSERT
UPDATE
User: Susan
Pwd: xyz123
Select
UPDATE
User: system
Pwd: oradb
Role: HumanRes
ALTER

More Related Content

Similar to Users66666666666666666666666666666666666666

OER- Unit 3 Authorization-DB security
OER- Unit 3 Authorization-DB securityOER- Unit 3 Authorization-DB security
OER- Unit 3 Authorization-DB securityGirija Muscut
 
Sql ch 15 - sql security
Sql ch 15 - sql securitySql ch 15 - sql security
Sql ch 15 - sql securityMukesh Tekwani
 
Access Control Facilities in Oracle Database 11g r2
Access Control Facilities in Oracle Database 11g r2Access Control Facilities in Oracle Database 11g r2
Access Control Facilities in Oracle Database 11g r2Amin Saqi
 
Clase 18 privilegios modificada
Clase 18 privilegios   modificadaClase 18 privilegios   modificada
Clase 18 privilegios modificadaTitiushko Jazz
 
Clase 18 privilegios modificada
Clase 18 privilegios   modificadaClase 18 privilegios   modificada
Clase 18 privilegios modificadaTitiushko Jazz
 
Write the query for creating the users exp 11
Write the query for creating the users exp 11Write the query for creating the users exp 11
Write the query for creating the users exp 11vishal choudhary
 
User Information in Oracle introduction.pptx
User Information in Oracle introduction.pptxUser Information in Oracle introduction.pptx
User Information in Oracle introduction.pptxAzarHamid
 
User, roles and privileges
User, roles and privilegesUser, roles and privileges
User, roles and privilegesYogiji Creations
 
e computer notes - Controlling user access
e computer notes - Controlling user accesse computer notes - Controlling user access
e computer notes - Controlling user accessecomputernotes
 
03_DP_300T00A_Secure_Environment.pptx
03_DP_300T00A_Secure_Environment.pptx03_DP_300T00A_Secure_Environment.pptx
03_DP_300T00A_Secure_Environment.pptxKareemBullard1
 
New PLSQL in Oracle Database 12c
New PLSQL in Oracle Database 12cNew PLSQL in Oracle Database 12c
New PLSQL in Oracle Database 12cConnor McDonald
 
Database Management System Security.pptx
Database Management System  Security.pptxDatabase Management System  Security.pptx
Database Management System Security.pptxRoshni814224
 
Security in Relational model
Security in Relational modelSecurity in Relational model
Security in Relational modelSlideshare
 
Introduction of security in neo4j database
Introduction of security in neo4j databaseIntroduction of security in neo4j database
Introduction of security in neo4j databasesetarehkhodarahmi
 
Database Security Methods, DAC, MAC,View
Database Security Methods, DAC, MAC,ViewDatabase Security Methods, DAC, MAC,View
Database Security Methods, DAC, MAC,ViewDr-Dipali Meher
 

Similar to Users66666666666666666666666666666666666666 (20)

Db pre
Db preDb pre
Db pre
 
Oracle Database
Oracle DatabaseOracle Database
Oracle Database
 
OER- Unit 3 Authorization-DB security
OER- Unit 3 Authorization-DB securityOER- Unit 3 Authorization-DB security
OER- Unit 3 Authorization-DB security
 
Sql ch 15 - sql security
Sql ch 15 - sql securitySql ch 15 - sql security
Sql ch 15 - sql security
 
Access Control Facilities in Oracle Database 11g r2
Access Control Facilities in Oracle Database 11g r2Access Control Facilities in Oracle Database 11g r2
Access Control Facilities in Oracle Database 11g r2
 
Oracle
Oracle Oracle
Oracle
 
Clase 18 privilegios modificada
Clase 18 privilegios   modificadaClase 18 privilegios   modificada
Clase 18 privilegios modificada
 
Clase 18 privilegios modificada
Clase 18 privilegios   modificadaClase 18 privilegios   modificada
Clase 18 privilegios modificada
 
Write the query for creating the users exp 11
Write the query for creating the users exp 11Write the query for creating the users exp 11
Write the query for creating the users exp 11
 
User Information in Oracle introduction.pptx
User Information in Oracle introduction.pptxUser Information in Oracle introduction.pptx
User Information in Oracle introduction.pptx
 
Dbms
DbmsDbms
Dbms
 
User, roles and privileges
User, roles and privilegesUser, roles and privileges
User, roles and privileges
 
e computer notes - Controlling user access
e computer notes - Controlling user accesse computer notes - Controlling user access
e computer notes - Controlling user access
 
03_DP_300T00A_Secure_Environment.pptx
03_DP_300T00A_Secure_Environment.pptx03_DP_300T00A_Secure_Environment.pptx
03_DP_300T00A_Secure_Environment.pptx
 
New PLSQL in Oracle Database 12c
New PLSQL in Oracle Database 12cNew PLSQL in Oracle Database 12c
New PLSQL in Oracle Database 12c
 
Less07 Users
Less07 UsersLess07 Users
Less07 Users
 
Database Management System Security.pptx
Database Management System  Security.pptxDatabase Management System  Security.pptx
Database Management System Security.pptx
 
Security in Relational model
Security in Relational modelSecurity in Relational model
Security in Relational model
 
Introduction of security in neo4j database
Introduction of security in neo4j databaseIntroduction of security in neo4j database
Introduction of security in neo4j database
 
Database Security Methods, DAC, MAC,View
Database Security Methods, DAC, MAC,ViewDatabase Security Methods, DAC, MAC,View
Database Security Methods, DAC, MAC,View
 

More from 227567

chapter 5 - main memory (1).pptxfdjdjgjghdj
chapter 5 - main memory (1).pptxfdjdjgjghdjchapter 5 - main memory (1).pptxfdjdjgjghdj
chapter 5 - main memory (1).pptxfdjdjgjghdj227567
 
lab2sql222222222222222222222222222222222
lab2sql222222222222222222222222222222222lab2sql222222222222222222222222222222222
lab2sql222222222222222222222222222222222227567
 
lab14444444444444444444444444444444444444444
lab14444444444444444444444444444444444444444lab14444444444444444444444444444444444444444
lab14444444444444444444444444444444444444444227567
 
constraints2100000000000000000000000000000
constraints2100000000000000000000000000000constraints2100000000000000000000000000000
constraints2100000000000000000000000000000227567
 
DBMS_ddlVFSBFSBS22222222222222222222222222222222222
DBMS_ddlVFSBFSBS22222222222222222222222222222222222DBMS_ddlVFSBFSBS22222222222222222222222222222222222
DBMS_ddlVFSBFSBS22222222222222222222222222222222222227567
 
Computer Organization and Architecture (1) (1) (1).pptx
Computer Organization and Architecture (1) (1) (1).pptxComputer Organization and Architecture (1) (1) (1).pptx
Computer Organization and Architecture (1) (1) (1).pptx227567
 
CH03 COMBUTER 000000000000000000000.pptx
CH03 COMBUTER 000000000000000000000.pptxCH03 COMBUTER 000000000000000000000.pptx
CH03 COMBUTER 000000000000000000000.pptx227567
 

More from 227567 (7)

chapter 5 - main memory (1).pptxfdjdjgjghdj
chapter 5 - main memory (1).pptxfdjdjgjghdjchapter 5 - main memory (1).pptxfdjdjgjghdj
chapter 5 - main memory (1).pptxfdjdjgjghdj
 
lab2sql222222222222222222222222222222222
lab2sql222222222222222222222222222222222lab2sql222222222222222222222222222222222
lab2sql222222222222222222222222222222222
 
lab14444444444444444444444444444444444444444
lab14444444444444444444444444444444444444444lab14444444444444444444444444444444444444444
lab14444444444444444444444444444444444444444
 
constraints2100000000000000000000000000000
constraints2100000000000000000000000000000constraints2100000000000000000000000000000
constraints2100000000000000000000000000000
 
DBMS_ddlVFSBFSBS22222222222222222222222222222222222
DBMS_ddlVFSBFSBS22222222222222222222222222222222222DBMS_ddlVFSBFSBS22222222222222222222222222222222222
DBMS_ddlVFSBFSBS22222222222222222222222222222222222
 
Computer Organization and Architecture (1) (1) (1).pptx
Computer Organization and Architecture (1) (1) (1).pptxComputer Organization and Architecture (1) (1) (1).pptx
Computer Organization and Architecture (1) (1) (1).pptx
 
CH03 COMBUTER 000000000000000000000.pptx
CH03 COMBUTER 000000000000000000000.pptxCH03 COMBUTER 000000000000000000000.pptx
CH03 COMBUTER 000000000000000000000.pptx
 

Recently uploaded

How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17Celine George
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSean M. Fox
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxMarlene Maheu
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................MirzaAbrarBaig5
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...Nguyen Thanh Tu Collection
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptxVishal Singh
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppCeline George
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文中 央社
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project researchCaitlinCummins3
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjMohammed Sikander
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxCeline George
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptxPoojaSen20
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...EduSkills OECD
 
ANTI PARKISON DRUGS.pptx
ANTI         PARKISON          DRUGS.pptxANTI         PARKISON          DRUGS.pptx
ANTI PARKISON DRUGS.pptxPoojaSen20
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽中 央社
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi RajagopalEADTU
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code ExamplesPeter Brusilovsky
 

Recently uploaded (20)

How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptx
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptx
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
ANTI PARKISON DRUGS.pptx
ANTI         PARKISON          DRUGS.pptxANTI         PARKISON          DRUGS.pptx
ANTI PARKISON DRUGS.pptx
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopal
 
Supporting Newcomer Multilingual Learners
Supporting Newcomer  Multilingual LearnersSupporting Newcomer  Multilingual Learners
Supporting Newcomer Multilingual Learners
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 

Users66666666666666666666666666666666666666

  • 1. Database Lab Controlling User Access Ruba Sultan
  • 2. Controlling User Access1  Database security can be classified into two categories:  System security  It covers access and use of the database at the system level such as username and password, disk space allocated to user and system operations allowed by the user.  Data security  Covers access and use of the database objects and the actions that those users can have on the objects. 2 1 Introduction to Oracle: SQL and PL/SQL P14-4 Neena Kochhar, Ellen Gravina and Priya Nathan, July 1999
  • 3. Privilege2  Privileges are the right to execute a particular SQL statements.  There are two types of privileges:  System privilege  Gain access to the database.  Object privilege  Manipulate the content of the database objects.  Schema: is a collection of objects such as tables, views and sequences, It is owned by database user and has the same name as that user. 2 Introduction to Oracle: SQL and PL/SQL P14-4 Neena Kochhar, Ellen Gravina and Priya Nathan, July 1999
  • 4. System Privilege3 4  The DBA has high-level system privileges  CREATE new users  Remove users  Remove tables  Back up tables 3 Introduction to Oracle: SQL and PL/SQL P14-5 Neena Kochhar, Ellen Gravina and Priya Nathan, July 1999
  • 5. Creating Users4  The DBA creates users by using the CREATE USER statement. CREATE USER username IDENTIFIED BY password; Notes:  The user does not have any privilege at this points.  The DBA can then grant a number of privileges to that user, these privilege determine what the user can do at the database level. 5 4 Introduction to Oracle: SQL and PL/SQL P14-6 Neena Kochhar, Ellen Gravina and Priya Nathan, July 1999
  • 6. User System Privileges5  Once a user is created, the DBA can grant specific system privileges to a user. GRANT privilege [, privilege…] TO user [, user…];  Typical system privileges granted to user:  CREATE SESSION  CREATE TABLE  CREATE SEQUENCE  CREATE VIEW  CREATE PROCEDURE 6 5 Introduction to Oracle: SQL and PL/SQL P14-7 Neena Kochhar, Ellen Gravina and Priya Nathan, July 1999
  • 7. Questions  Question1 Create two users the first with name Ahmad and password abc123 the other one with name Asmaa and password xyz123.  Question2 Give both users (Ahmad and Asmaa) these system privileges Create session, Create table and Create view. 7
  • 8. Roles6 8  A role is a named group of related privileges that can be granted to the user.  Role make granting and revoking privileges easier to perform and maintain.  A user can have access to several roles, and several users can be assigned the same role. 6 Introduction to Oracle: SQL and PL/SQL P14-9 Neena Kochhar, Ellen Gravina and Priya Nathan, July 1999
  • 9. Creating and Assigning a Role7 9  DBA must create the role  The DBA can assign privileges to the role using GRANT statement.  The DBA can assign users to the role using GRANT statement.  The syntax for creating a role CREATE ROLE rolename; 7 Introduction to Oracle: SQL and PL/SQL P14-10 Neena Kochhar, Ellen Gravina and Priya Nathan, July 1999
  • 10. Changing Password8 10  The DBA creates your user account and initializes your password.  You can change your password by using the ALTER USER statement. ALTER USER Ahmad IDENTIFIED BY abcdef; 8 Introduction to Oracle: SQL and PL/SQL P13-4 Neena Kochhar, Ellen Gravina and Priya Nathan, July 1999
  • 11. Object Privileges9 11 9 Introduction to Oracle: SQL and PL/SQL P14-12 Neena Kochhar, Ellen Gravina and Priya Nathan, July 1999 Object Privilege Table View Sequence Procedure ALTER   DELETE   EXECUTE  INDEX  INSERT   REFERENCE  SELECT    UPDATE  
  • 12. Object Privileges10 12  Object privileges vary from object to object.  An owner has all the privileges one the object.  An owner can give specific privileges on that owner’s object. GRANT objectprivilege[(columns)] ON object To {user|role|PUBLIC} [WITH GRANT OPTION] 10 Introduction to Oracle: SQL and PL/SQL P14-13 Neena Kochhar, Ellen Gravina and Priya Nathan, July 1999
  • 13. Questions 13  Question3 Give both users Ahmad and Asmaa the SELECT privilege on Employees table.  Question4 Give Asmaa the UPDATE privilege on salary and commission columns in Employees table.
  • 14. WITH GRANT OPTION and PUBLIC11  A privilege that is granted WITH GRANT OPTION can be passed on to other users and roles by the grantee.  Object privileges granted WITH GRANT OPTIONS are revoked when the grantor’s privilege is revoked.  An owner of a table can grant access to all users by using the PUBLIC keyword. 14 11 Introduction to Oracle: SQL and PL/SQL P14-15 Neena Kochhar, Ellen Gravina and Priya Nathan, July 1999
  • 15. Revoke Object Privileges12  Use REVOKE statement to revoke privileges granted to other users.  Privileges granted to others through the WITH GRANT OPTION will also be revoked. REVOKE {privilege [, privilege…]|ALL} ON object FROM {user[, user…] | role |PUBLIC} [CASCADE CONSTRAINTS]; 15 12 Introduction to Oracle: SQL and PL/SQL P14-17 Neena Kochhar, Ellen Gravina and Priya Nathan, July 1999
  • 16. Revoke Object Privileges(cont)  CASCADE CONSTRAINT is required to remove any referential integrity constraints made to the object by means of the REFERENCES privilege. 16
  • 17. Questions  Question5 Write a complete SQL statements that creates two users Ameer and Susan, each of these user must have privilege(s) to access Employees table in hr user account. A role need to be created with name HumanRes and it has ALTER privilege on Employees table and add the two users(Ameer and Susan) to this role. Notes:  hr provides privileges to Ameer and Ameer provides privileges to Susan. 17
  • 18. Questions 18 User: hr Pwd: oradb User: Ameer Pwd: abc123 SELECT INSERT UPDATE User: Susan Pwd: xyz123 Select UPDATE User: system Pwd: oradb Role: HumanRes ALTER