SlideShare a Scribd company logo
Database administration
 Create database (create tablespace)
 Creating User
 Managing Users
 Granting privileges
 Managing password
 Removing privileges
DATABASE
 Collection of coherent data
 To create database we have :
Syntax: CREATE DATABASE <database_name>
Eg: CREATE DATABASE my_db;
TABLESPACE
The oracle database consist of one or more logical storage units
called tablespaces.
Each tablespace in an Oracle database consists of one or more
files called datafiles, which are physical structures that confirm
to the operating system in which Oracle is running.
Syntax:
CREATE<tablespace name> DATAFILE
'C:oraclexeapporacleproduct10.2.0server<file name.dbf ’
SIZE 50M;
Eg:
Create table space SY_MCA DATAFILE
‘'C:oraclexeapporacleproduct10.2.0serverusr.dbf' ’SIZE 50M;
Create User
The DBA creates user by executing CREATE USER statement.
The user is someone who connects to the database if enough
privilege is granted.
Syntax:
SQL> CREATE USER < username> -- (name of user to be created )
IDENTIFIED BY <password> -- (specifies that the user must
login with this password)
SQL> user created
Eg: create user James identified by bob;
(The user does not have privilege at this time, it has to be granted.
These privileges determine what user can do at database level.)
Privileges
A privilege is a right to execute an SQL statement or to access
another user's object.
In Oracle, there are two types of privileges
 System Privileges
 Object Privileges
 System Privileges : are those through which the user can
manage the performance of database actions. It is normally
granted by DBA to users.
Eg: Create Session,Create Table,Create user etc..
 Object Privileges : allow access to objects or privileges on
object, i.e. tables, table columns. tables,views etc..It includes
alter,delete,insert,select update etc.
(After creating the user, DBA grant specific system privileges to user)
GRANT :
The DBA uses the GRANT statement to allocate system
privileges to other user.
Syntax:
SQL> GRANT privilege [privilege…. … ]
TO USER ;
SQL> Grant succeeded
Eg: Grant create session, create table, create view to James;
Object privileges vary from object to object. An owner has all
privilege or specific privileges on object.
SQL> GRANT object_priv [(column)]
ON object
TO user;
SQL>GRANT select, insert ON emp TO James;
SQL>GRANT select ,update (e_name,e_address)
ON emp TO James;
CHANGE PASSWORD
The DBA creates an account and initializes a password for every
user.You can change password by using ALTER USER
statement.
Syntax:
Alter USER <some user name>
IDENTIFIED BY<New password>
Eg: ALTER USER James
IDENTIFIED BY sam
ROLE:
A role is a named group of related privileges that can be granted
to user.In other words, role is a predefined collection of
previleges that are grouped together,thus privileges are easier
to assign user.
SQL> Create role custom;
SQL> Grant create table, create view TO custom;
SQL> Grant select, insert ON emp TO custom;
Eg: Grant custom to James, Steve;
REVOKE
REVOKE statement is used to remove privileges granted to other
users. The privileges you specify are revoked from the users.
Syntax:
REVOKE [privilege.. …]
ON object
FROM user
Eg:
 REVOKE create session,create table from James;
 REVOKE select ,insert
ON emp
FROM James
THANKS

More Related Content

PPTX
User, roles and privileges
PDF
Sql grant, revoke, privileges and roles
PPT
PPTX
MySql:Introduction
PPT
DOCX
Android sq lite-chapter 22
PPT
ODT
Mysql
User, roles and privileges
Sql grant, revoke, privileges and roles
MySql:Introduction
Android sq lite-chapter 22
Mysql

What's hot (20)

ODP
Sql lite android
PPTX
Android Database
PDF
My sql102
PPTX
Databases in Android Application
PPT
SQLITE Android
PDF
Android Data Persistence
PPTX
Android Database Tutorial
PPS
05 qmds2005 session07
PPTX
Cordova training - Day 9 - SQLITE
PPT
Data Storage In Android
PDF
Demystifying PostgreSQL (Zendcon 2010)
PDF
Demystifying PostgreSQL
PPTX
Android Data Storagefinal
PDF
Android Storage - Internal and External Storages
PPTX
Html web sql database
PDF
GR8Conf 2011: GORM Optimization
PDF
Persitance Data with sqlite
PPTX
android sqlite
PDF
Android - Data Storage
PDF
Tutorial MySQL com Java
Sql lite android
Android Database
My sql102
Databases in Android Application
SQLITE Android
Android Data Persistence
Android Database Tutorial
05 qmds2005 session07
Cordova training - Day 9 - SQLITE
Data Storage In Android
Demystifying PostgreSQL (Zendcon 2010)
Demystifying PostgreSQL
Android Data Storagefinal
Android Storage - Internal and External Storages
Html web sql database
GR8Conf 2011: GORM Optimization
Persitance Data with sqlite
android sqlite
Android - Data Storage
Tutorial MySQL com Java
Ad

Similar to Database administration (20)

PPTX
Database administration commands
DOCX
Advanced db features
DOC
Oracle sql material
PDF
Lecture Notes Unit4 Chapter13 users , roles and privileges
PDF
ClickHouse Unleashed 2020: Our Favorite New Features for Your Analytical Appl...
PPTX
Introducing ms sql_server_updated
PPTX
Db pre
PPT
Sql Commands_Dr.R.Shalini.ppt
PPT
Less07 Users
PPTX
What is SQL Server?
PPTX
Administration and Management of Users in Oracle / Oracle Database Storage st...
PPTX
User Information in Oracle introduction.pptx
PDF
Mysql cheatsheet - Part 2
ODP
Msql
PPTX
03_DP_300T00A_Secure_Environment.pptx
PPT
e computer notes - Controlling user access
PPTX
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
PPTX
Training on Microsoft SQL Server(older version).pptx
PDF
Create user database management security
Database administration commands
Advanced db features
Oracle sql material
Lecture Notes Unit4 Chapter13 users , roles and privileges
ClickHouse Unleashed 2020: Our Favorite New Features for Your Analytical Appl...
Introducing ms sql_server_updated
Db pre
Sql Commands_Dr.R.Shalini.ppt
Less07 Users
What is SQL Server?
Administration and Management of Users in Oracle / Oracle Database Storage st...
User Information in Oracle introduction.pptx
Mysql cheatsheet - Part 2
Msql
03_DP_300T00A_Secure_Environment.pptx
e computer notes - Controlling user access
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
Training on Microsoft SQL Server(older version).pptx
Create user database management security
Ad

Recently uploaded (20)

PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Complications of Minimal Access Surgery at WLH
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
01-Introduction-to-Information-Management.pdf
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Computing-Curriculum for Schools in Ghana
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
Cell Types and Its function , kingdom of life
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
O7-L3 Supply Chain Operations - ICLT Program
Anesthesia in Laparoscopic Surgery in India
Complications of Minimal Access Surgery at WLH
FourierSeries-QuestionsWithAnswers(Part-A).pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Supply Chain Operations Speaking Notes -ICLT Program
01-Introduction-to-Information-Management.pdf
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Final Presentation General Medicine 03-08-2024.pptx
Computing-Curriculum for Schools in Ghana
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Abdominal Access Techniques with Prof. Dr. R K Mishra
Cell Types and Its function , kingdom of life
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf

Database administration

  • 2.  Create database (create tablespace)  Creating User  Managing Users  Granting privileges  Managing password  Removing privileges
  • 3. DATABASE  Collection of coherent data  To create database we have : Syntax: CREATE DATABASE <database_name> Eg: CREATE DATABASE my_db;
  • 4. TABLESPACE The oracle database consist of one or more logical storage units called tablespaces. Each tablespace in an Oracle database consists of one or more files called datafiles, which are physical structures that confirm to the operating system in which Oracle is running. Syntax: CREATE<tablespace name> DATAFILE 'C:oraclexeapporacleproduct10.2.0server<file name.dbf ’ SIZE 50M; Eg: Create table space SY_MCA DATAFILE ‘'C:oraclexeapporacleproduct10.2.0serverusr.dbf' ’SIZE 50M;
  • 5. Create User The DBA creates user by executing CREATE USER statement. The user is someone who connects to the database if enough privilege is granted. Syntax: SQL> CREATE USER < username> -- (name of user to be created ) IDENTIFIED BY <password> -- (specifies that the user must login with this password) SQL> user created Eg: create user James identified by bob; (The user does not have privilege at this time, it has to be granted. These privileges determine what user can do at database level.)
  • 6. Privileges A privilege is a right to execute an SQL statement or to access another user's object. In Oracle, there are two types of privileges  System Privileges  Object Privileges  System Privileges : are those through which the user can manage the performance of database actions. It is normally granted by DBA to users. Eg: Create Session,Create Table,Create user etc..  Object Privileges : allow access to objects or privileges on object, i.e. tables, table columns. tables,views etc..It includes alter,delete,insert,select update etc. (After creating the user, DBA grant specific system privileges to user)
  • 7. GRANT : The DBA uses the GRANT statement to allocate system privileges to other user. Syntax: SQL> GRANT privilege [privilege…. … ] TO USER ; SQL> Grant succeeded Eg: Grant create session, create table, create view to James;
  • 8. Object privileges vary from object to object. An owner has all privilege or specific privileges on object. SQL> GRANT object_priv [(column)] ON object TO user; SQL>GRANT select, insert ON emp TO James; SQL>GRANT select ,update (e_name,e_address) ON emp TO James;
  • 9. CHANGE PASSWORD The DBA creates an account and initializes a password for every user.You can change password by using ALTER USER statement. Syntax: Alter USER <some user name> IDENTIFIED BY<New password> Eg: ALTER USER James IDENTIFIED BY sam
  • 10. ROLE: A role is a named group of related privileges that can be granted to user.In other words, role is a predefined collection of previleges that are grouped together,thus privileges are easier to assign user. SQL> Create role custom; SQL> Grant create table, create view TO custom; SQL> Grant select, insert ON emp TO custom; Eg: Grant custom to James, Steve;
  • 11. REVOKE REVOKE statement is used to remove privileges granted to other users. The privileges you specify are revoked from the users. Syntax: REVOKE [privilege.. …] ON object FROM user Eg:  REVOKE create session,create table from James;  REVOKE select ,insert ON emp FROM James