SlideShare a Scribd company logo
ORACLE DBMS: Managing Users & Tables




                                     by
                         Vazi Okhandiar, PMP, MSCS, MCT
                        NR Computer Learning Center
                       1835 W. Orangewood . Suite 200
                              Orange, CA 92868
                               www.nrclc.com




Vazi Okhandiar                                            Page 1
ORACLE DBMS: Managing Users & Tables

The article consists of perform following 3 tasks using Oracle Relational Database:
     Steps for create an account for a user
     Steps for user to login into Oracle instance and manage data
     Steps for Removing the account from the database instance


STEP 1: Create an account for a user: John
    1. Log into oracle instance as SYSDBA

        >> sqlplus / as sysdba

    2. Create User john with password smith

        SQL> CREATE USER john IDENTIIED BY smith;

    3. Assign the user (john) to use users as the default tablespace.

        SQL> ALTER USER john DEFAULT TABLESPACE users

    4. Assign the user (john) to use temp as the temporary tablespace

        SQL> ALTER USER john TEMPORARY TABLESPACE temp;

    5. Allow user (john) to connect to the database

        SQL> GRANT CONNECT TO john;

    6. Verify that account is created by listing all the users in the database
       SQL> Select * from all_users;

    7. Check if the account is locked;
       SQL> SELECT account_status FROM dba_users where username=’JOHN’;
       If the account is locked then unlock using following command.

        SQL> ALTER USER john ACCOUNT UNLOCK;

    8. Assign John unlimited quota on tablespace users.

        SQL> Alter user john quota unlimited on users;

    9. Grant resource to john

        SQL> GRANT RESOURCE TO user;

    10. Log out of sysdba account
        SQL> exit




Vazi Okhandiar                                                                        Page 2
ORACLE DBMS: Managing Users & Tables

STEP 2: Login as john
   1. Login as john

       >> sqlplus john/smith

   2. Create a table called mytable

       SQL> create table mytable (
              Id number(3),
              FirstName varchar2(15),
              LastName varchar2(15));

   3. Verify the table is created
      SQL> select table_name from all_tables order by table_name;
      Or
      SQL> select table_name from user_tables;

       You should see your table in the output list.

   4. Insert following records into a table.

       SQL> INSERT INTO mytable (ID, FirstName, LastName) Values (1,‘John’, ‘Smith’);
       SQL> INSERT INTO mytable (ID, FirstName, LastName) Values (2,‘Jane’, ‘Doe’);
       SQL> INSERT INTO mytable (ID, FirstName, LastName) Values (3,‘Paul’, ‘Ryan’);

   5. Use SELECT command to verify the data is inserted into the table

       SQL> Select * from mytable;

       ID   FirstName      LastName
       1    John           Smith
       2    Jane           Doe
       3    Paul           Ryan


   6. Remove jane from the table

       SQL > DELETE FROM mytable WHERE id=2;

   7. Use SELECT command to verify the jane’s record has been deleted.

       SQL> Select * from mytable;

       ID   FirstName      LastName
       1    John           Smith
       3    Paul           Ryan

   8. Remove the table from the database


Vazi Okhandiar                                                                          Page 3
ORACLE DBMS: Managing Users & Tables

       SQL> DROP TABLE mytable;

   9. Verify the table is dropped
      SQL> select table_name from user_tables;

       Note: mytable should not be in the list of tables.

   10. Exit out of oracle as john
       SQL > exit


STEP 3: Remove the user

       1. Log in as sysdba
          >> sqlplus / as sysdba

       2. Verify john’s account is still in the database
          SQL> select * from all_users where username=’JOHN’;
          UserName         User_ID            CREATED
          JOHN             91                 03-FEB-13

       3. Remove the user from the database

           SQL> DROP USER john;

           If the user’s schema contains objects, then you must use the CASCADE clause to drop the
           user and the objects:

           SQL> DROP USER john CASCADE;

       4. Verify john’s account has been deleted from the database
          SQL> select * from all_users where username=’JOHN’;

           User dropped.



Reference: Oracle SQL*PLUS Command

http://docs.oracle.com/cd/B13789_01/server.101/b10758/sqlqraa.htm




Vazi Okhandiar                                                                                Page 4

More Related Content

What's hot (20)

PPTX
Memory access tracing [poug17]
Mahmoud Hatem
 
PPT
6. Integrity and Security in DBMS
koolkampus
 
PPTX
Previous question papers of Database Management System (DBMS) By SHABEEB
Shabeeb Shabi
 
PPTX
Introduction to Oracle Data Guard Broker
Zohar Elkayam
 
PDF
Postgresql database administration volume 1
Federico Campoli
 
PDF
Advanced pg_stat_statements: Filtering, Regression Testing & more
Lukas Fittl
 
PDF
Trigger in DBMS
A. S. M. Shafi
 
PPTX
Fast Start Failover DataGuard
Borsaniya Vaibhav
 
PPT
Less06 networking
Amit Bhalla
 
PPT
Less08 users
Amit Bhalla
 
PDF
Visual Basic 6.0
MuralirajSanjeev
 
PPTX
An Introduction To Oracle Database
Meysam Javadi
 
PPTX
Sql queries presentation
NITISH KUMAR
 
PPTX
Normalization
Sakshi Jaiswal
 
PPT
Active directory slides
Timothy Moffatt
 
PDF
MS-SQL SERVER ARCHITECTURE
Douglas Bernardini
 
PDF
Release and patching strategy
Jitendra Singh
 
PPTX
IP tables and Filtering
Aisha Talat
 
PDF
Lecture-1: Introduction to system integration and architecture - course overv...
Mubashir Ali
 
Memory access tracing [poug17]
Mahmoud Hatem
 
6. Integrity and Security in DBMS
koolkampus
 
Previous question papers of Database Management System (DBMS) By SHABEEB
Shabeeb Shabi
 
Introduction to Oracle Data Guard Broker
Zohar Elkayam
 
Postgresql database administration volume 1
Federico Campoli
 
Advanced pg_stat_statements: Filtering, Regression Testing & more
Lukas Fittl
 
Trigger in DBMS
A. S. M. Shafi
 
Fast Start Failover DataGuard
Borsaniya Vaibhav
 
Less06 networking
Amit Bhalla
 
Less08 users
Amit Bhalla
 
Visual Basic 6.0
MuralirajSanjeev
 
An Introduction To Oracle Database
Meysam Javadi
 
Sql queries presentation
NITISH KUMAR
 
Normalization
Sakshi Jaiswal
 
Active directory slides
Timothy Moffatt
 
MS-SQL SERVER ARCHITECTURE
Douglas Bernardini
 
Release and patching strategy
Jitendra Singh
 
IP tables and Filtering
Aisha Talat
 
Lecture-1: Introduction to system integration and architecture - course overv...
Mubashir Ali
 

Viewers also liked (20)

PPT
Database Design Queries
ckrampert
 
PDF
Thomafluid I (Türk)
ReicheltChemietechnik
 
PPTX
Data flow in Extraction of ETL data warehousing
Dr. Dipti Patil
 
PPTX
Taming the ETL beast: How LinkedIn uses metadata to run complex ETL flows rel...
rajappaiyer
 
PPTX
ETL Validator: Flat File Validation
Datagaps Inc
 
PPTX
Capacity Management of an ETL System
ASHOK BHATLA
 
PPTX
Oracle Tablespace - Basic
Eryk Budi Pratama
 
PPTX
ETL Validator: Creating Data Model
Datagaps Inc
 
PDF
Crossref webinar - Maintaining your metadata - latest
Crossref
 
PDF
Seven building blocks for MDM
Kousik Mukherjee
 
PPTX
Building the Data Lake with Azure Data Factory and Data Lake Analytics
Khalid Salama
 
PDF
How to identify the correct Master Data subject areas & tooling for your MDM...
Christopher Bradley
 
PDF
State of Digital Transformation 2016. Altimeter Report
Den Reymer
 
PDF
Introduction to ETL and Data Integration
CloverDX (formerly known as CloverETL)
 
PDF
Gartner: Top 10 Strategic Technology Trends 2016
Den Reymer
 
PPT
Data Warehouse Modeling
vivekjv
 
PDF
Data Warehouse Design and Best Practices
Ivo Andreev
 
PPTX
Quack Chat: Diving into Data Governance
IDERA Software
 
PDF
Gartner TOP 10 Strategic Technology Trends 2017
Den Reymer
 
PPTX
Big Data Analytics with Hadoop
Philippe Julio
 
Database Design Queries
ckrampert
 
Thomafluid I (Türk)
ReicheltChemietechnik
 
Data flow in Extraction of ETL data warehousing
Dr. Dipti Patil
 
Taming the ETL beast: How LinkedIn uses metadata to run complex ETL flows rel...
rajappaiyer
 
ETL Validator: Flat File Validation
Datagaps Inc
 
Capacity Management of an ETL System
ASHOK BHATLA
 
Oracle Tablespace - Basic
Eryk Budi Pratama
 
ETL Validator: Creating Data Model
Datagaps Inc
 
Crossref webinar - Maintaining your metadata - latest
Crossref
 
Seven building blocks for MDM
Kousik Mukherjee
 
Building the Data Lake with Azure Data Factory and Data Lake Analytics
Khalid Salama
 
How to identify the correct Master Data subject areas & tooling for your MDM...
Christopher Bradley
 
State of Digital Transformation 2016. Altimeter Report
Den Reymer
 
Introduction to ETL and Data Integration
CloverDX (formerly known as CloverETL)
 
Gartner: Top 10 Strategic Technology Trends 2016
Den Reymer
 
Data Warehouse Modeling
vivekjv
 
Data Warehouse Design and Best Practices
Ivo Andreev
 
Quack Chat: Diving into Data Governance
IDERA Software
 
Gartner TOP 10 Strategic Technology Trends 2017
Den Reymer
 
Big Data Analytics with Hadoop
Philippe Julio
 
Ad

Similar to Manage users & tables in Oracle Database (20)

PDF
12c db upgrade from 11.2.0.4
uzzal basak
 
PDF
Proxy authentication Itoug TechDays 2019
Enrico Cairo
 
PDF
Create user database management security
Girija Muscut
 
PDF
Database decommission process
K Kumar Guduru
 
PPTX
MySQL
Hideo Amezawa
 
DOC
Create manula and automaticly database
Anar Godjaev
 
ODT
Mysql
ksujitha
 
PPTX
1.1 sql create and drop database statement
MLG College of Learning, Inc
 
PDF
Pini Dibask - Oracle Database Locking Mechanism Demystified (Presentation)
Pini Dibask
 
PDF
DOAG - Oracle Database Locking Mechanism Demystified
Pini Dibask
 
PDF
Hacking Your Way To Better Security - php[tek] 2016
Colin O'Dell
 
PDF
Pluggable database tutorial 2
Osama Mustafa
 
PDF
Kp.3 pengaturan sistem dan user
Desty Yani
 
PPTX
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
Alex Zaballa
 
PPTX
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
Alex Zaballa
 
PPTX
Hacking Your Way to Better Security - PHP South Africa 2016
Colin O'Dell
 
PPTX
Hacking Your Way To Better Security - Dutch PHP Conference 2016
Colin O'Dell
 
PDF
Hacking Your Way To Better Security
Colin O'Dell
 
PPTX
Owasp Indy Q2 2012 Advanced SQLi
owaspindy
 
KEY
ActiveRecord
Blazing Cloud
 
12c db upgrade from 11.2.0.4
uzzal basak
 
Proxy authentication Itoug TechDays 2019
Enrico Cairo
 
Create user database management security
Girija Muscut
 
Database decommission process
K Kumar Guduru
 
Create manula and automaticly database
Anar Godjaev
 
Mysql
ksujitha
 
1.1 sql create and drop database statement
MLG College of Learning, Inc
 
Pini Dibask - Oracle Database Locking Mechanism Demystified (Presentation)
Pini Dibask
 
DOAG - Oracle Database Locking Mechanism Demystified
Pini Dibask
 
Hacking Your Way To Better Security - php[tek] 2016
Colin O'Dell
 
Pluggable database tutorial 2
Osama Mustafa
 
Kp.3 pengaturan sistem dan user
Desty Yani
 
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
Alex Zaballa
 
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
Alex Zaballa
 
Hacking Your Way to Better Security - PHP South Africa 2016
Colin O'Dell
 
Hacking Your Way To Better Security - Dutch PHP Conference 2016
Colin O'Dell
 
Hacking Your Way To Better Security
Colin O'Dell
 
Owasp Indy Q2 2012 Advanced SQLi
owaspindy
 
ActiveRecord
Blazing Cloud
 
Ad

More from NR Computer Learning Center (20)

PPTX
Power BI Desktop Overview
NR Computer Learning Center
 
PPTX
Building Dashboard with Excel
NR Computer Learning Center
 
PPTX
Introduction to Data Analytics
NR Computer Learning Center
 
PPTX
Python - Data Structures
NR Computer Learning Center
 
PPTX
Introduction to SQL
NR Computer Learning Center
 
PDF
Office 2019 tips & tricks
NR Computer Learning Center
 
PDF
App Development with Apple Swift Certification at Certiport Centers
NR Computer Learning Center
 
PDF
Project management fundamentals
NR Computer Learning Center
 
PDF
National College Testing Association (NCTA)
NR Computer Learning Center
 
PDF
National College Testing Association (NCTA)
NR Computer Learning Center
 
PDF
Building a Dashboard in an hour with Power Pivot and Power BI
NR Computer Learning Center
 
PPTX
Introduction to the basic mathematical concept with Python Turtle.
NR Computer Learning Center
 
PDF
Stem presentation - Pathways to Technology Oriented Careers
NR Computer Learning Center
 
PDF
MTA 98 364 - database fundamentals
NR Computer Learning Center
 
PDF
MTA 361 software development fundamentals
NR Computer Learning Center
 
PDF
Introduction to java
NR Computer Learning Center
 
PDF
Introduction to c++
NR Computer Learning Center
 
PDF
Executive dashboard for small business
NR Computer Learning Center
 
PDF
Building a Dashboard in an Hour using Microsoft PowerPivot & Power BI
NR Computer Learning Center
 
PDF
Arduino for teens
NR Computer Learning Center
 
Power BI Desktop Overview
NR Computer Learning Center
 
Building Dashboard with Excel
NR Computer Learning Center
 
Introduction to Data Analytics
NR Computer Learning Center
 
Python - Data Structures
NR Computer Learning Center
 
Introduction to SQL
NR Computer Learning Center
 
Office 2019 tips & tricks
NR Computer Learning Center
 
App Development with Apple Swift Certification at Certiport Centers
NR Computer Learning Center
 
Project management fundamentals
NR Computer Learning Center
 
National College Testing Association (NCTA)
NR Computer Learning Center
 
National College Testing Association (NCTA)
NR Computer Learning Center
 
Building a Dashboard in an hour with Power Pivot and Power BI
NR Computer Learning Center
 
Introduction to the basic mathematical concept with Python Turtle.
NR Computer Learning Center
 
Stem presentation - Pathways to Technology Oriented Careers
NR Computer Learning Center
 
MTA 98 364 - database fundamentals
NR Computer Learning Center
 
MTA 361 software development fundamentals
NR Computer Learning Center
 
Introduction to java
NR Computer Learning Center
 
Introduction to c++
NR Computer Learning Center
 
Executive dashboard for small business
NR Computer Learning Center
 
Building a Dashboard in an Hour using Microsoft PowerPivot & Power BI
NR Computer Learning Center
 
Arduino for teens
NR Computer Learning Center
 

Recently uploaded (20)

PDF
CHILD RIGHTS AND PROTECTION QUESTION BANK
Dr Raja Mohammed T
 
PPTX
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
PPTX
PPT on the Development of Education in the Victorian England
Beena E S
 
PPTX
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PDF
IMP NAAC REFORMS 2024 - 10 Attributes.pdf
BHARTIWADEKAR
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PDF
community health nursing question paper 2.pdf
Prince kumar
 
PPTX
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
PDF
LAW OF CONTRACT (5 YEAR LLB & UNITARY LLB )- MODULE - 1.& 2 - LEARN THROUGH P...
APARNA T SHAIL KUMAR
 
PDF
Dimensions of Societal Planning in Commonism
StefanMz
 
PPSX
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
PPTX
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
PPTX
Quarter1-English3-W4-Identifying Elements of the Story
FLORRACHELSANTOS
 
PDF
LAW OF CONTRACT ( 5 YEAR LLB & UNITARY LLB)- MODULE-3 - LEARN THROUGH PICTURE
APARNA T SHAIL KUMAR
 
PPTX
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PDF
IMP NAAC-Reforms-Stakeholder-Consultation-Presentation-on-Draft-Metrics-Unive...
BHARTIWADEKAR
 
PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
PPTX
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
PPTX
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
CHILD RIGHTS AND PROTECTION QUESTION BANK
Dr Raja Mohammed T
 
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
PPT on the Development of Education in the Victorian England
Beena E S
 
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
IMP NAAC REFORMS 2024 - 10 Attributes.pdf
BHARTIWADEKAR
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
community health nursing question paper 2.pdf
Prince kumar
 
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
LAW OF CONTRACT (5 YEAR LLB & UNITARY LLB )- MODULE - 1.& 2 - LEARN THROUGH P...
APARNA T SHAIL KUMAR
 
Dimensions of Societal Planning in Commonism
StefanMz
 
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
Quarter1-English3-W4-Identifying Elements of the Story
FLORRACHELSANTOS
 
LAW OF CONTRACT ( 5 YEAR LLB & UNITARY LLB)- MODULE-3 - LEARN THROUGH PICTURE
APARNA T SHAIL KUMAR
 
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
IMP NAAC-Reforms-Stakeholder-Consultation-Presentation-on-Draft-Metrics-Unive...
BHARTIWADEKAR
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 

Manage users & tables in Oracle Database

  • 1. ORACLE DBMS: Managing Users & Tables by Vazi Okhandiar, PMP, MSCS, MCT NR Computer Learning Center 1835 W. Orangewood . Suite 200 Orange, CA 92868 www.nrclc.com Vazi Okhandiar Page 1
  • 2. ORACLE DBMS: Managing Users & Tables The article consists of perform following 3 tasks using Oracle Relational Database:  Steps for create an account for a user  Steps for user to login into Oracle instance and manage data  Steps for Removing the account from the database instance STEP 1: Create an account for a user: John 1. Log into oracle instance as SYSDBA >> sqlplus / as sysdba 2. Create User john with password smith SQL> CREATE USER john IDENTIIED BY smith; 3. Assign the user (john) to use users as the default tablespace. SQL> ALTER USER john DEFAULT TABLESPACE users 4. Assign the user (john) to use temp as the temporary tablespace SQL> ALTER USER john TEMPORARY TABLESPACE temp; 5. Allow user (john) to connect to the database SQL> GRANT CONNECT TO john; 6. Verify that account is created by listing all the users in the database SQL> Select * from all_users; 7. Check if the account is locked; SQL> SELECT account_status FROM dba_users where username=’JOHN’; If the account is locked then unlock using following command. SQL> ALTER USER john ACCOUNT UNLOCK; 8. Assign John unlimited quota on tablespace users. SQL> Alter user john quota unlimited on users; 9. Grant resource to john SQL> GRANT RESOURCE TO user; 10. Log out of sysdba account SQL> exit Vazi Okhandiar Page 2
  • 3. ORACLE DBMS: Managing Users & Tables STEP 2: Login as john 1. Login as john >> sqlplus john/smith 2. Create a table called mytable SQL> create table mytable ( Id number(3), FirstName varchar2(15), LastName varchar2(15)); 3. Verify the table is created SQL> select table_name from all_tables order by table_name; Or SQL> select table_name from user_tables; You should see your table in the output list. 4. Insert following records into a table. SQL> INSERT INTO mytable (ID, FirstName, LastName) Values (1,‘John’, ‘Smith’); SQL> INSERT INTO mytable (ID, FirstName, LastName) Values (2,‘Jane’, ‘Doe’); SQL> INSERT INTO mytable (ID, FirstName, LastName) Values (3,‘Paul’, ‘Ryan’); 5. Use SELECT command to verify the data is inserted into the table SQL> Select * from mytable; ID FirstName LastName 1 John Smith 2 Jane Doe 3 Paul Ryan 6. Remove jane from the table SQL > DELETE FROM mytable WHERE id=2; 7. Use SELECT command to verify the jane’s record has been deleted. SQL> Select * from mytable; ID FirstName LastName 1 John Smith 3 Paul Ryan 8. Remove the table from the database Vazi Okhandiar Page 3
  • 4. ORACLE DBMS: Managing Users & Tables SQL> DROP TABLE mytable; 9. Verify the table is dropped SQL> select table_name from user_tables; Note: mytable should not be in the list of tables. 10. Exit out of oracle as john SQL > exit STEP 3: Remove the user 1. Log in as sysdba >> sqlplus / as sysdba 2. Verify john’s account is still in the database SQL> select * from all_users where username=’JOHN’; UserName User_ID CREATED JOHN 91 03-FEB-13 3. Remove the user from the database SQL> DROP USER john; If the user’s schema contains objects, then you must use the CASCADE clause to drop the user and the objects: SQL> DROP USER john CASCADE; 4. Verify john’s account has been deleted from the database SQL> select * from all_users where username=’JOHN’; User dropped. Reference: Oracle SQL*PLUS Command http://docs.oracle.com/cd/B13789_01/server.101/b10758/sqlqraa.htm Vazi Okhandiar Page 4