SlideShare ist ein Scribd-Unternehmen logo
1 von 4
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Database Triggers
Database TriggersDatabase Triggers
Database Triggers
 
Database Performance Tuning
Database Performance Tuning Database Performance Tuning
Database Performance Tuning
 
File Management in Operating System
File Management in Operating SystemFile Management in Operating System
File Management in Operating System
 
MySQL Transactions
MySQL TransactionsMySQL Transactions
MySQL Transactions
 
Distributed concurrency control
Distributed concurrency controlDistributed concurrency control
Distributed concurrency control
 
Oracle Database Sequence
Oracle Database SequenceOracle Database Sequence
Oracle Database Sequence
 
old file system/traditional file sysytem
old file system/traditional file sysytemold file system/traditional file sysytem
old file system/traditional file sysytem
 
Sql and Sql commands
Sql and Sql commandsSql and Sql commands
Sql and Sql commands
 
05 Creating Stored Procedures
05 Creating Stored Procedures05 Creating Stored Procedures
05 Creating Stored Procedures
 
Chapter 13 - I/O Systems
Chapter 13 - I/O SystemsChapter 13 - I/O Systems
Chapter 13 - I/O Systems
 
Oracle backup and recovery
Oracle backup and recoveryOracle backup and recovery
Oracle backup and recovery
 
Data dictionary
Data dictionaryData dictionary
Data dictionary
 
Oracle basic queries
Oracle basic queriesOracle basic queries
Oracle basic queries
 
Client server architecture
Client server architectureClient server architecture
Client server architecture
 
Slide 4 dbms users
Slide 4 dbms usersSlide 4 dbms users
Slide 4 dbms users
 
PL/SQL TRIGGERS
PL/SQL TRIGGERSPL/SQL TRIGGERS
PL/SQL TRIGGERS
 
Import Database Data using RODBC in R Studio
Import Database Data using RODBC in R StudioImport Database Data using RODBC in R Studio
Import Database Data using RODBC in R Studio
 
E-Examination
E-ExaminationE-Examination
E-Examination
 
Backup & recovery with rman
Backup & recovery with rmanBackup & recovery with rman
Backup & recovery with rman
 
SQL Views
SQL ViewsSQL Views
SQL Views
 

Andere mochten auch

Database Design Queries
Database Design QueriesDatabase Design Queries
Database Design Queriesckrampert
 
Data flow in Extraction of ETL data warehousing
Data flow in Extraction of ETL data warehousingData flow in Extraction of ETL data warehousing
Data flow in Extraction of ETL data warehousingDr. Dipti Patil
 
Taming the ETL beast: How LinkedIn uses metadata to run complex ETL flows rel...
Taming the ETL beast: How LinkedIn uses metadata to run complex ETL flows rel...Taming the ETL beast: How LinkedIn uses metadata to run complex ETL flows rel...
Taming the ETL beast: How LinkedIn uses metadata to run complex ETL flows rel...rajappaiyer
 
ETL Validator: Flat File Validation
ETL Validator: Flat File ValidationETL Validator: Flat File Validation
ETL Validator: Flat File ValidationDatagaps Inc
 
Capacity Management of an ETL System
Capacity Management of an ETL SystemCapacity Management of an ETL System
Capacity Management of an ETL SystemASHOK BHATLA
 
ETL Validator: Creating Data Model
ETL Validator: Creating Data ModelETL Validator: Creating Data Model
ETL Validator: Creating Data ModelDatagaps Inc
 
Crossref webinar - Maintaining your metadata - latest
Crossref webinar - Maintaining your metadata - latestCrossref webinar - Maintaining your metadata - latest
Crossref webinar - Maintaining your metadata - latestCrossref
 
(BDT303) Construct Your ETL Pipeline with AWS Data Pipeline, Amazon EMR, and ...
(BDT303) Construct Your ETL Pipeline with AWS Data Pipeline, Amazon EMR, and ...(BDT303) Construct Your ETL Pipeline with AWS Data Pipeline, Amazon EMR, and ...
(BDT303) Construct Your ETL Pipeline with AWS Data Pipeline, Amazon EMR, and ...Amazon Web Services
 
Seven building blocks for MDM
Seven building blocks for MDMSeven building blocks for MDM
Seven building blocks for MDMKousik Mukherjee
 
Building the Data Lake with Azure Data Factory and Data Lake Analytics
Building the Data Lake with Azure Data Factory and Data Lake AnalyticsBuilding the Data Lake with Azure Data Factory and Data Lake Analytics
Building the Data Lake with Azure Data Factory and Data Lake AnalyticsKhalid Salama
 
How to identify the correct Master Data subject areas & tooling for your MDM...
How to identify the correct Master Data subject areas & tooling for your MDM...How to identify the correct Master Data subject areas & tooling for your MDM...
How to identify the correct Master Data subject areas & tooling for your MDM...Christopher Bradley
 
State of Digital Transformation 2016. Altimeter Report
State of Digital Transformation 2016. Altimeter ReportState of Digital Transformation 2016. Altimeter Report
State of Digital Transformation 2016. Altimeter ReportDen Reymer
 
Gartner: Top 10 Strategic Technology Trends 2016
Gartner: Top 10 Strategic Technology Trends 2016Gartner: Top 10 Strategic Technology Trends 2016
Gartner: Top 10 Strategic Technology Trends 2016Den Reymer
 
Data Warehouse Modeling
Data Warehouse ModelingData Warehouse Modeling
Data Warehouse Modelingvivekjv
 
Data Warehouse Design and Best Practices
Data Warehouse Design and Best PracticesData Warehouse Design and Best Practices
Data Warehouse Design and Best PracticesIvo Andreev
 
Quack Chat: Diving into Data Governance
Quack Chat: Diving into Data Governance Quack Chat: Diving into Data Governance
Quack Chat: Diving into Data Governance IDERA Software
 
Gartner TOP 10 Strategic Technology Trends 2017
Gartner TOP 10 Strategic Technology Trends 2017Gartner TOP 10 Strategic Technology Trends 2017
Gartner TOP 10 Strategic Technology Trends 2017Den Reymer
 
Big Data Analytics with Hadoop
Big Data Analytics with HadoopBig Data Analytics with Hadoop
Big Data Analytics with HadoopPhilippe Julio
 

Andere mochten auch (20)

Database Design Queries
Database Design QueriesDatabase Design Queries
Database Design Queries
 
Thomafluid I (Türk)
Thomafluid I (Türk)Thomafluid I (Türk)
Thomafluid I (Türk)
 
Data flow in Extraction of ETL data warehousing
Data flow in Extraction of ETL data warehousingData flow in Extraction of ETL data warehousing
Data flow in Extraction of ETL data warehousing
 
Taming the ETL beast: How LinkedIn uses metadata to run complex ETL flows rel...
Taming the ETL beast: How LinkedIn uses metadata to run complex ETL flows rel...Taming the ETL beast: How LinkedIn uses metadata to run complex ETL flows rel...
Taming the ETL beast: How LinkedIn uses metadata to run complex ETL flows rel...
 
ETL Validator: Flat File Validation
ETL Validator: Flat File ValidationETL Validator: Flat File Validation
ETL Validator: Flat File Validation
 
Capacity Management of an ETL System
Capacity Management of an ETL SystemCapacity Management of an ETL System
Capacity Management of an ETL System
 
ETL Validator: Creating Data Model
ETL Validator: Creating Data ModelETL Validator: Creating Data Model
ETL Validator: Creating Data Model
 
Crossref webinar - Maintaining your metadata - latest
Crossref webinar - Maintaining your metadata - latestCrossref webinar - Maintaining your metadata - latest
Crossref webinar - Maintaining your metadata - latest
 
(BDT303) Construct Your ETL Pipeline with AWS Data Pipeline, Amazon EMR, and ...
(BDT303) Construct Your ETL Pipeline with AWS Data Pipeline, Amazon EMR, and ...(BDT303) Construct Your ETL Pipeline with AWS Data Pipeline, Amazon EMR, and ...
(BDT303) Construct Your ETL Pipeline with AWS Data Pipeline, Amazon EMR, and ...
 
Seven building blocks for MDM
Seven building blocks for MDMSeven building blocks for MDM
Seven building blocks for MDM
 
Building the Data Lake with Azure Data Factory and Data Lake Analytics
Building the Data Lake with Azure Data Factory and Data Lake AnalyticsBuilding the Data Lake with Azure Data Factory and Data Lake Analytics
Building the Data Lake with Azure Data Factory and Data Lake Analytics
 
How to identify the correct Master Data subject areas & tooling for your MDM...
How to identify the correct Master Data subject areas & tooling for your MDM...How to identify the correct Master Data subject areas & tooling for your MDM...
How to identify the correct Master Data subject areas & tooling for your MDM...
 
State of Digital Transformation 2016. Altimeter Report
State of Digital Transformation 2016. Altimeter ReportState of Digital Transformation 2016. Altimeter Report
State of Digital Transformation 2016. Altimeter Report
 
Introduction to ETL and Data Integration
Introduction to ETL and Data IntegrationIntroduction to ETL and Data Integration
Introduction to ETL and Data Integration
 
Gartner: Top 10 Strategic Technology Trends 2016
Gartner: Top 10 Strategic Technology Trends 2016Gartner: Top 10 Strategic Technology Trends 2016
Gartner: Top 10 Strategic Technology Trends 2016
 
Data Warehouse Modeling
Data Warehouse ModelingData Warehouse Modeling
Data Warehouse Modeling
 
Data Warehouse Design and Best Practices
Data Warehouse Design and Best PracticesData Warehouse Design and Best Practices
Data Warehouse Design and Best Practices
 
Quack Chat: Diving into Data Governance
Quack Chat: Diving into Data Governance Quack Chat: Diving into Data Governance
Quack Chat: Diving into Data Governance
 
Gartner TOP 10 Strategic Technology Trends 2017
Gartner TOP 10 Strategic Technology Trends 2017Gartner TOP 10 Strategic Technology Trends 2017
Gartner TOP 10 Strategic Technology Trends 2017
 
Big Data Analytics with Hadoop
Big Data Analytics with HadoopBig Data Analytics with Hadoop
Big Data Analytics with Hadoop
 

Ähnlich wie Manage users & tables in Oracle Database

12c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.412c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.4uzzal basak
 
Proxy authentication Itoug TechDays 2019
Proxy authentication Itoug TechDays 2019Proxy authentication Itoug TechDays 2019
Proxy authentication Itoug TechDays 2019Enrico Cairo
 
Create user database management security
Create user  database management securityCreate user  database management security
Create user database management securityGirija Muscut
 
Database decommission process
Database decommission processDatabase decommission process
Database decommission processK Kumar Guduru
 
Create manula and automaticly database
Create manula and automaticly databaseCreate manula and automaticly database
Create manula and automaticly databaseAnar Godjaev
 
Pini Dibask - Oracle Database Locking Mechanism Demystified (Presentation)
Pini Dibask - Oracle Database Locking Mechanism Demystified (Presentation)Pini Dibask - Oracle Database Locking Mechanism Demystified (Presentation)
Pini Dibask - Oracle Database Locking Mechanism Demystified (Presentation)Pini Dibask
 
DOAG - Oracle Database Locking Mechanism Demystified
DOAG - Oracle Database Locking Mechanism Demystified DOAG - Oracle Database Locking Mechanism Demystified
DOAG - Oracle Database Locking Mechanism Demystified Pini Dibask
 
Hacking Your Way To Better Security - php[tek] 2016
Hacking Your Way To Better Security - php[tek] 2016Hacking Your Way To Better Security - php[tek] 2016
Hacking Your Way To Better Security - php[tek] 2016Colin O'Dell
 
Pluggable database tutorial 2
Pluggable database tutorial 2Pluggable database tutorial 2
Pluggable database tutorial 2Osama Mustafa
 
Kp.3 pengaturan sistem dan user
Kp.3 pengaturan sistem dan userKp.3 pengaturan sistem dan user
Kp.3 pengaturan sistem dan userDesty Yani
 
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should KnowOTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should KnowAlex Zaballa
 
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should KnowOTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should KnowAlex Zaballa
 
Hacking Your Way to Better Security - PHP South Africa 2016
Hacking Your Way to Better Security - PHP South Africa 2016Hacking Your Way to Better Security - PHP South Africa 2016
Hacking Your Way to Better Security - PHP South Africa 2016Colin O'Dell
 
Hacking Your Way To Better Security - Dutch PHP Conference 2016
Hacking Your Way To Better Security - Dutch PHP Conference 2016Hacking Your Way To Better Security - Dutch PHP Conference 2016
Hacking Your Way To Better Security - Dutch PHP Conference 2016Colin O'Dell
 
Hacking Your Way To Better Security
Hacking Your Way To Better SecurityHacking Your Way To Better Security
Hacking Your Way To Better SecurityColin O'Dell
 
Owasp Indy Q2 2012 Advanced SQLi
Owasp Indy Q2 2012 Advanced SQLiOwasp Indy Q2 2012 Advanced SQLi
Owasp Indy Q2 2012 Advanced SQLiowaspindy
 

Ähnlich wie Manage users & tables in Oracle Database (20)

12c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.412c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.4
 
Proxy authentication Itoug TechDays 2019
Proxy authentication Itoug TechDays 2019Proxy authentication Itoug TechDays 2019
Proxy authentication Itoug TechDays 2019
 
Create user database management security
Create user  database management securityCreate user  database management security
Create user database management security
 
Database decommission process
Database decommission processDatabase decommission process
Database decommission process
 
MySQL
MySQLMySQL
MySQL
 
Create manula and automaticly database
Create manula and automaticly databaseCreate manula and automaticly database
Create manula and automaticly database
 
Mysql
MysqlMysql
Mysql
 
1.1 sql create and drop database statement
1.1 sql create and drop database statement1.1 sql create and drop database statement
1.1 sql create and drop database statement
 
Pini Dibask - Oracle Database Locking Mechanism Demystified (Presentation)
Pini Dibask - Oracle Database Locking Mechanism Demystified (Presentation)Pini Dibask - Oracle Database Locking Mechanism Demystified (Presentation)
Pini Dibask - Oracle Database Locking Mechanism Demystified (Presentation)
 
DOAG - Oracle Database Locking Mechanism Demystified
DOAG - Oracle Database Locking Mechanism Demystified DOAG - Oracle Database Locking Mechanism Demystified
DOAG - Oracle Database Locking Mechanism Demystified
 
Hacking Your Way To Better Security - php[tek] 2016
Hacking Your Way To Better Security - php[tek] 2016Hacking Your Way To Better Security - php[tek] 2016
Hacking Your Way To Better Security - php[tek] 2016
 
Pluggable database tutorial 2
Pluggable database tutorial 2Pluggable database tutorial 2
Pluggable database tutorial 2
 
Kp.3 pengaturan sistem dan user
Kp.3 pengaturan sistem dan userKp.3 pengaturan sistem dan user
Kp.3 pengaturan sistem dan user
 
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should KnowOTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
 
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should KnowOTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
 
Hacking Your Way to Better Security - PHP South Africa 2016
Hacking Your Way to Better Security - PHP South Africa 2016Hacking Your Way to Better Security - PHP South Africa 2016
Hacking Your Way to Better Security - PHP South Africa 2016
 
Hacking Your Way To Better Security - Dutch PHP Conference 2016
Hacking Your Way To Better Security - Dutch PHP Conference 2016Hacking Your Way To Better Security - Dutch PHP Conference 2016
Hacking Your Way To Better Security - Dutch PHP Conference 2016
 
Hacking Your Way To Better Security
Hacking Your Way To Better SecurityHacking Your Way To Better Security
Hacking Your Way To Better Security
 
Owasp Indy Q2 2012 Advanced SQLi
Owasp Indy Q2 2012 Advanced SQLiOwasp Indy Q2 2012 Advanced SQLi
Owasp Indy Q2 2012 Advanced SQLi
 
ActiveRecord
ActiveRecordActiveRecord
ActiveRecord
 

Mehr von NR Computer Learning Center

App Development with Apple Swift Certification at Certiport Centers
App Development with Apple Swift Certification at Certiport CentersApp Development with Apple Swift Certification at Certiport Centers
App Development with Apple Swift Certification at Certiport CentersNR Computer Learning Center
 
Building a Dashboard in an hour with Power Pivot and Power BI
Building a Dashboard in an hour with Power Pivot and Power BIBuilding a Dashboard in an hour with Power Pivot and Power BI
Building a Dashboard in an hour with Power Pivot and Power BINR Computer Learning Center
 
Introduction to the basic mathematical concept with Python Turtle.
Introduction to the basic mathematical concept with Python Turtle.Introduction to the basic mathematical concept with Python Turtle.
Introduction to the basic mathematical concept with Python Turtle.NR Computer Learning Center
 
Stem presentation - Pathways to Technology Oriented Careers
Stem presentation - Pathways to Technology Oriented CareersStem presentation - Pathways to Technology Oriented Careers
Stem presentation - Pathways to Technology Oriented CareersNR Computer Learning Center
 
Building a Dashboard in an Hour using Microsoft PowerPivot & Power BI
Building a Dashboard in an Hour using Microsoft PowerPivot & Power BIBuilding a Dashboard in an Hour using Microsoft PowerPivot & Power BI
Building a Dashboard in an Hour using Microsoft PowerPivot & Power BINR Computer Learning Center
 

Mehr von NR Computer Learning Center (20)

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

Kürzlich hochgeladen

Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIShubhangi Sonawane
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 

Kürzlich hochgeladen (20)

Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 

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