SlideShare une entreprise Scribd logo
1  sur  16
Security
V. Saranya AP/CSE,
Sri Vidya College of Engg &
Tech, virudhunagar
• A DBMS
should
provide
a
mechanism
to
ensure that “only
authorized
users
can access the
database”
GRANT AND REVOKE
• SQL provides “GRANT” and “REVOKE”
statements to “allow security” to be set up
on the tables in the database.
Security Concepts
• Authorization identifiers
• Ownership
• privileges
Authorization Identifiers
• are “Database users” assigned by DBA.
Owner
• “Can pass privileges” on to other users using
the “GRANT” statement and can cancel the
privileges passed on using “REVOKE”
statement.
Privileges

• Are the actions that a user is permitted.
– Select privilege to retrieve data from the table
– Insert privilege to insert new rows into a table.
– Update Privilege to modify rows of data in a
table.
– Delete Privilege to delete rows of data from a
table.
– References Privilege to reference columns of a
named table in integrity constraints.
– Usage

Privilege
to
use
domains, collations, character sets and
translations.
Granting Privilege to other users
• Used to GRANT privileges on database objects
to specified users.
• GRANT statement is used by the owner of a
table to give other users access to the data.
Syntax

Used to grant all privileges to a
user instead of having to
specify the 6 privileges
individually

Syntax:
GRANT [privilege list / All PRIVILEGES]
On object name
To {authorization id list / PUBLIC }
Allow access to be granted to
[WITH GRANT OPTION]
all
present
and
future
Privilege list consists of one or more of the authorized users not just to the
users currently known to the
following
DBMS.
privileges separated by commas;
Select
Can be the name of a base
Delete
table, view, domain, character
Insert[ (column name[….]) ]
set, collation or translation
Update (column name[….]) ]
References (column name[….]) ]
Usage
Clause allows the users in
authorizationIdList to pass the
privileges to other user.
Example 1
Give the user with authorization identifier
manager full privileges to the staff table.

GRANT ALL PRIVILEGES
ON STAFF
TO manager WITH GRANT OPTION;
Example 2
Give users personnel and director the privileges
select and update on column salary of the staff
table.
GRANT SELECT ,UPDATE (salary)
ON staff
WITH GRANT FOR is
omitted, here the users
TO personnel, Director;
personnel & Director
cannot pass the
privileges on to other
users.
Example 3
Give all users the privileges SELECT on the
branch table.
GRANT SELECT
ON BRANCH
TO PUBLIC;

Means that all users
are able to retrieve all
the data in the branch
table.
REVOKE
• Revoke statement is used to take away all or
some of the privileges that were previously
granted to a user.
GRANT OPTION FOR allows
privileges passed on via the
WITH GRANT OPTION of the
GRANT statement to be revoked
from the privileges themselves.

Syntax
ALL PRIVILEGES granted to
a user by the user revoking
the privileges.

REVOKE [GRANT OPTION FOR] {privilege
List/ALL PRIVILEGES]
ON objectName
FROM { AuthorizationIdList / PUBLIC }
[RESTRICT / CASCADE]
Example 1
Revoke the privilege SELECT on the branch
table from all users.
REVOKE SELECT
ON branch
FROM PUBLIC;
Example 2
REVOKE all privileges you have given to
Director on the staff table.
REVOKE ALL PRIVILEGES
ON STAFF
FROM director;

Contenu connexe

En vedette

Книги-юбиляры 2013 года
Книги-юбиляры 2013 годаКниги-юбиляры 2013 года
Книги-юбиляры 2013 годаnikola511
 
Resolution(decision)
Resolution(decision)Resolution(decision)
Resolution(decision)Slideshare
 
Instance based learning
Instance based learningInstance based learning
Instance based learningSlideshare
 
What is in you
What is in youWhat is in you
What is in youSlideshare
 
Report generation
Report generationReport generation
Report generationSlideshare
 
16 Queens Problem - trial 1
16 Queens Problem  - trial 116 Queens Problem  - trial 1
16 Queens Problem - trial 1Slideshare
 
Neural networks
Neural networksNeural networks
Neural networksSlideshare
 
Girl Rights and Protection in India
Girl Rights and Protection in IndiaGirl Rights and Protection in India
Girl Rights and Protection in IndiaAashray For Everyone
 
Security and Integrity
Security and IntegritySecurity and Integrity
Security and Integritylubna19
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessingSlideshare
 
Crystal report generation in visual studio 2010
Crystal report generation in visual studio 2010Crystal report generation in visual studio 2010
Crystal report generation in visual studio 2010Slideshare
 
Statistical learning
Statistical learningStatistical learning
Statistical learningSlideshare
 
Propositional logic & inference
Propositional logic & inferencePropositional logic & inference
Propositional logic & inferenceSlideshare
 
Major issues in data mining
Major issues in data miningMajor issues in data mining
Major issues in data miningSlideshare
 
Logical reasoning
Logical reasoning Logical reasoning
Logical reasoning Slideshare
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship ModelSlideshare
 
6. Integrity and Security in DBMS
6. Integrity and Security in DBMS6. Integrity and Security in DBMS
6. Integrity and Security in DBMSkoolkampus
 

En vedette (20)

Dmbs chapter vi
Dmbs chapter viDmbs chapter vi
Dmbs chapter vi
 
Книги-юбиляры 2013 года
Книги-юбиляры 2013 годаКниги-юбиляры 2013 года
Книги-юбиляры 2013 года
 
Resolution(decision)
Resolution(decision)Resolution(decision)
Resolution(decision)
 
Instance based learning
Instance based learningInstance based learning
Instance based learning
 
What is in you
What is in youWhat is in you
What is in you
 
Report generation
Report generationReport generation
Report generation
 
16 Queens Problem - trial 1
16 Queens Problem  - trial 116 Queens Problem  - trial 1
16 Queens Problem - trial 1
 
Neural networks
Neural networksNeural networks
Neural networks
 
Girl Rights and Protection in India
Girl Rights and Protection in IndiaGirl Rights and Protection in India
Girl Rights and Protection in India
 
Security and Integrity
Security and IntegritySecurity and Integrity
Security and Integrity
 
Logic agent
Logic agentLogic agent
Logic agent
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessing
 
Crystal report generation in visual studio 2010
Crystal report generation in visual studio 2010Crystal report generation in visual studio 2010
Crystal report generation in visual studio 2010
 
Statistical learning
Statistical learningStatistical learning
Statistical learning
 
Propositional logic & inference
Propositional logic & inferencePropositional logic & inference
Propositional logic & inference
 
Major issues in data mining
Major issues in data miningMajor issues in data mining
Major issues in data mining
 
Trigger
TriggerTrigger
Trigger
 
Logical reasoning
Logical reasoning Logical reasoning
Logical reasoning
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
 
6. Integrity and Security in DBMS
6. Integrity and Security in DBMS6. Integrity and Security in DBMS
6. Integrity and Security in DBMS
 

Similaire à Security in Relational model

Sql ch 15 - sql security
Sql ch 15 - sql securitySql ch 15 - sql security
Sql ch 15 - sql securityMukesh Tekwani
 
e computer notes - Controlling user access
e computer notes - Controlling user accesse computer notes - Controlling user access
e computer notes - Controlling user accessecomputernotes
 
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
 
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
 
Sql grant, revoke, privileges and roles
Sql grant, revoke, privileges and rolesSql grant, revoke, privileges and roles
Sql grant, revoke, privileges and rolesVivek Singh
 
03_DP_300T00A_Secure_Environment.pptx
03_DP_300T00A_Secure_Environment.pptx03_DP_300T00A_Secure_Environment.pptx
03_DP_300T00A_Secure_Environment.pptxKareemBullard1
 
Database models and DBMS languages
Database models and DBMS languagesDatabase models and DBMS languages
Database models and DBMS languagesDivyaKS12
 
Mysqldbatrainingsession12privilegesinmysql 170302152348
Mysqldbatrainingsession12privilegesinmysql 170302152348Mysqldbatrainingsession12privilegesinmysql 170302152348
Mysqldbatrainingsession12privilegesinmysql 170302152348shubham singh
 
Chapter 6 Database Security and Authorization (4).pdf
Chapter 6 Database Security and Authorization (4).pdfChapter 6 Database Security and Authorization (4).pdf
Chapter 6 Database Security and Authorization (4).pdfabrehamcheru14
 
Security and Authorization
Security and AuthorizationSecurity and Authorization
Security and AuthorizationMegha yadav
 
Les14[1]Controlling User Access
Les14[1]Controlling User AccessLes14[1]Controlling User Access
Les14[1]Controlling User Accesssiavosh kaviani
 
UNIT-1-Security.ppt
UNIT-1-Security.pptUNIT-1-Security.ppt
UNIT-1-Security.pptDharaDarji5
 
Database Management System Security.pptx
Database Management System  Security.pptxDatabase Management System  Security.pptx
Database Management System Security.pptxRoshni814224
 

Similaire à Security in Relational model (20)

Sql ch 15 - sql security
Sql ch 15 - sql securitySql ch 15 - sql security
Sql ch 15 - sql security
 
Les01
Les01Les01
Les01
 
Les14
Les14Les14
Les14
 
Les13
Les13Les13
Les13
 
e computer notes - Controlling user access
e computer notes - Controlling user accesse computer notes - Controlling user access
e computer notes - Controlling user access
 
Database Security Methods, DAC, MAC,View
Database Security Methods, DAC, MAC,ViewDatabase Security Methods, DAC, MAC,View
Database Security Methods, DAC, MAC,View
 
Db pre
Db preDb pre
Db pre
 
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
 
Sql grant, revoke, privileges and roles
Sql grant, revoke, privileges and rolesSql grant, revoke, privileges and roles
Sql grant, revoke, privileges and roles
 
03_DP_300T00A_Secure_Environment.pptx
03_DP_300T00A_Secure_Environment.pptx03_DP_300T00A_Secure_Environment.pptx
03_DP_300T00A_Secure_Environment.pptx
 
Database models and DBMS languages
Database models and DBMS languagesDatabase models and DBMS languages
Database models and DBMS languages
 
Mysqldbatrainingsession12privilegesinmysql 170302152348
Mysqldbatrainingsession12privilegesinmysql 170302152348Mysqldbatrainingsession12privilegesinmysql 170302152348
Mysqldbatrainingsession12privilegesinmysql 170302152348
 
Chapter 6 Database Security and Authorization (4).pdf
Chapter 6 Database Security and Authorization (4).pdfChapter 6 Database Security and Authorization (4).pdf
Chapter 6 Database Security and Authorization (4).pdf
 
Security and Authorization
Security and AuthorizationSecurity and Authorization
Security and Authorization
 
Les14[1]Controlling User Access
Les14[1]Controlling User AccessLes14[1]Controlling User Access
Les14[1]Controlling User Access
 
8034.ppt
8034.ppt8034.ppt
8034.ppt
 
Trigger in DBMS
Trigger in DBMSTrigger in DBMS
Trigger in DBMS
 
UNIT-1-Security.ppt
UNIT-1-Security.pptUNIT-1-Security.ppt
UNIT-1-Security.ppt
 
Database Management System Security.pptx
Database Management System  Security.pptxDatabase Management System  Security.pptx
Database Management System Security.pptx
 

Plus de Slideshare

Logical reasoning 21.1.13
Logical reasoning 21.1.13Logical reasoning 21.1.13
Logical reasoning 21.1.13Slideshare
 
Statistical learning
Statistical learningStatistical learning
Statistical learningSlideshare
 
Reinforcement learning 7313
Reinforcement learning 7313Reinforcement learning 7313
Reinforcement learning 7313Slideshare
 
Neural networks
Neural networksNeural networks
Neural networksSlideshare
 
Instance based learning
Instance based learningInstance based learning
Instance based learningSlideshare
 
Input & output devices
Input & output devicesInput & output devices
Input & output devicesSlideshare
 
Accessing I/O Devices
Accessing I/O DevicesAccessing I/O Devices
Accessing I/O DevicesSlideshare
 
16 queens problem - trial 2
16 queens problem - trial 216 queens problem - trial 2
16 queens problem - trial 2Slideshare
 
Basic Processing Unit
Basic Processing UnitBasic Processing Unit
Basic Processing UnitSlideshare
 
Cache performance considerations
Cache performance considerationsCache performance considerations
Cache performance considerationsSlideshare
 
Memory management
Memory managementMemory management
Memory managementSlideshare
 
Secondary storage devices
Secondary storage devices Secondary storage devices
Secondary storage devices Slideshare
 
Magnetic tape system
Magnetic tape systemMagnetic tape system
Magnetic tape systemSlideshare
 

Plus de Slideshare (15)

OLAP
OLAPOLAP
OLAP
 
Logical reasoning 21.1.13
Logical reasoning 21.1.13Logical reasoning 21.1.13
Logical reasoning 21.1.13
 
Statistical learning
Statistical learningStatistical learning
Statistical learning
 
Reinforcement learning 7313
Reinforcement learning 7313Reinforcement learning 7313
Reinforcement learning 7313
 
Neural networks
Neural networksNeural networks
Neural networks
 
Instance based learning
Instance based learningInstance based learning
Instance based learning
 
Input & output devices
Input & output devicesInput & output devices
Input & output devices
 
Accessing I/O Devices
Accessing I/O DevicesAccessing I/O Devices
Accessing I/O Devices
 
16 queens problem - trial 2
16 queens problem - trial 216 queens problem - trial 2
16 queens problem - trial 2
 
Basic Processing Unit
Basic Processing UnitBasic Processing Unit
Basic Processing Unit
 
Cache performance considerations
Cache performance considerationsCache performance considerations
Cache performance considerations
 
Cachememory
CachememoryCachememory
Cachememory
 
Memory management
Memory managementMemory management
Memory management
 
Secondary storage devices
Secondary storage devices Secondary storage devices
Secondary storage devices
 
Magnetic tape system
Magnetic tape systemMagnetic tape system
Magnetic tape system
 

Dernier

Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationNeilDeclaro1
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptxJoelynRubio1
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Philosophy of china and it's charactistics
Philosophy of china and it's charactisticsPhilosophy of china and it's charactistics
Philosophy of china and it's charactisticshameyhk98
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 

Dernier (20)

Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health Education
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Philosophy of china and it's charactistics
Philosophy of china and it's charactisticsPhilosophy of china and it's charactistics
Philosophy of china and it's charactistics
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 

Security in Relational model

  • 1. Security V. Saranya AP/CSE, Sri Vidya College of Engg & Tech, virudhunagar
  • 2. • A DBMS should provide a mechanism to ensure that “only authorized users can access the database”
  • 3. GRANT AND REVOKE • SQL provides “GRANT” and “REVOKE” statements to “allow security” to be set up on the tables in the database.
  • 4. Security Concepts • Authorization identifiers • Ownership • privileges
  • 5. Authorization Identifiers • are “Database users” assigned by DBA.
  • 6. Owner • “Can pass privileges” on to other users using the “GRANT” statement and can cancel the privileges passed on using “REVOKE” statement.
  • 7. Privileges • Are the actions that a user is permitted. – Select privilege to retrieve data from the table – Insert privilege to insert new rows into a table. – Update Privilege to modify rows of data in a table. – Delete Privilege to delete rows of data from a table. – References Privilege to reference columns of a named table in integrity constraints. – Usage  Privilege to use domains, collations, character sets and translations.
  • 8. Granting Privilege to other users • Used to GRANT privileges on database objects to specified users. • GRANT statement is used by the owner of a table to give other users access to the data.
  • 9. Syntax Used to grant all privileges to a user instead of having to specify the 6 privileges individually Syntax: GRANT [privilege list / All PRIVILEGES] On object name To {authorization id list / PUBLIC } Allow access to be granted to [WITH GRANT OPTION] all present and future Privilege list consists of one or more of the authorized users not just to the users currently known to the following DBMS. privileges separated by commas; Select Can be the name of a base Delete table, view, domain, character Insert[ (column name[….]) ] set, collation or translation Update (column name[….]) ] References (column name[….]) ] Usage Clause allows the users in authorizationIdList to pass the privileges to other user.
  • 10. Example 1 Give the user with authorization identifier manager full privileges to the staff table. GRANT ALL PRIVILEGES ON STAFF TO manager WITH GRANT OPTION;
  • 11. Example 2 Give users personnel and director the privileges select and update on column salary of the staff table. GRANT SELECT ,UPDATE (salary) ON staff WITH GRANT FOR is omitted, here the users TO personnel, Director; personnel & Director cannot pass the privileges on to other users.
  • 12. Example 3 Give all users the privileges SELECT on the branch table. GRANT SELECT ON BRANCH TO PUBLIC; Means that all users are able to retrieve all the data in the branch table.
  • 13. REVOKE • Revoke statement is used to take away all or some of the privileges that were previously granted to a user.
  • 14. GRANT OPTION FOR allows privileges passed on via the WITH GRANT OPTION of the GRANT statement to be revoked from the privileges themselves. Syntax ALL PRIVILEGES granted to a user by the user revoking the privileges. REVOKE [GRANT OPTION FOR] {privilege List/ALL PRIVILEGES] ON objectName FROM { AuthorizationIdList / PUBLIC } [RESTRICT / CASCADE]
  • 15. Example 1 Revoke the privilege SELECT on the branch table from all users. REVOKE SELECT ON branch FROM PUBLIC;
  • 16. Example 2 REVOKE all privileges you have given to Director on the staff table. REVOKE ALL PRIVILEGES ON STAFF FROM director;