Configuration and Use of Oracle 11g XE and Oracle SQL Developer

Keywords: Oracle SQL Database sqlplus

The Oracle database is used in the project, so backup and restore are needed locally (there is no database shared on the LAN).

For example, there is now a backup file of student.dmp database.

Install and configure Oracle 11g XE

brief introduction

The following is from Oracle Database Express Version 11g Version 2 OTN Licensing Protocol:

Any use of the Oracle Database Express Edition is subject to the following limitations;

  1. Express Edition is limited to a single > instance on any server;
  1. Single instance
  1. Express Edition may be installed on a multiple CPU server, but may only be executed on one processor in any server;
  1. Single CPU support
  1. Express Edition may only be used to support up to 11GB of user data (not including Express Edition system data);
  1. The database should not exceed 11GB
  1. Express Edition may use up to 1 GB RAM of available memory.
  1. Maximum memory usage is 1GB

SYSTEM table space cannot be extended

download

Oracle Database Express Version 11g Version 2

install

Very simple installation, because it's a single instance XE version.
Just configure the installation path and password. Note that it is best to restart once the installation is completed, otherwise the introduction to automatically adding to the desktop can not be opened.

Configuration and import

  1. Run the cmd.exe command prompt.
  2. Start sqlplus
  3. Log in with the default user system (the password is set during installation, for example, I set oracle as the default password).
     1 Microsoft Windows [Version 10.0.14393]
     2 (c) 2016 Microsoft Corporation. All rights reserved.
     3 
     4 C:\Users\co>sqlplus
     5 
     6 SQL*Plus: Release 11.2.0.2.0 Production on Tuesday, February 21, 17:25:09 2017
     7 
     8 Copyright (c) 1982, 2014, Oracle.  All rights reserved.
     9 
    10 Please enter user name: system
     11 Enter password:
    12 
    13 connected to:
    14 Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
    15 
    16 SQL>

     

  4. Create table spaces
    • Query existing table spaces (storage files)

      1 SQL> select name from v$datafile;
      2 
      3 NAME
      4 --------------------------------------------------------------------------------
      5 C:\ORACLEXE\APP\ORACLE\ORADATA\XE\SYSTEM.DBF
      6 C:\ORACLEXE\APP\ORACLE\ORADATA\XE\SYSAUX.DBF
      7 C:\ORACLEXE\APP\ORACLE\ORADATA\XE\UNDOTBS1.DBF
      8 C:\ORACLEXE\APP\ORACLE\ORADATA\XE\USERS.DBF
    • Create table spaces

       1 SQL> create tablespace student datafile 'c:\oraclexe\app\oracle\oradata\xe\student.dbf' size 2048m;
       2 
       3 The table space has been created.
       4 
       5 SQL> select name from v$datafile;
       6 
       7 NAME
       8 --------------------------------------------------------------------------------
       9 C:\ORACLEXE\APP\ORACLE\ORADATA\XE\SYSTEM.DBF
      10 C:\ORACLEXE\APP\ORACLE\ORADATA\XE\SYSAUX.DBF
      11 C:\ORACLEXE\APP\ORACLE\ORADATA\XE\UNDOTBS1.DBF
      12 C:\ORACLEXE\APP\ORACLE\ORADATA\XE\USERS.DBF
      13 C:\ORACLEXE\APP\ORACLE\ORADATA\XE\STUDENT.DBF
    • Create users and assign permissions

      1 SQL> create user student identified by student default tablespace student;
      2 
      3 Users have been created.
      4 
      5 SQL> grant dba to student;
      6 
      7. The authorization was successful.
    • Revoke the user's other table space permissions, otherwise it will be imported into the SYSTEM table space by default, and the SYSTEM table space is not extensible in the XE version.

       1 SQL> revoke unlimited tablespace from student;
       2 
       3 The revocation was successful.
       4 
       5 SQL> alter user student quota 0 on users;
       6 
       7 User has changed.
       8 
       9 SQL> alter user student quota unlimited on student;
      10 
      11 User has changed.
      12 
      13 SQL> select username,default_tablespace from user_users;
      14 
      15 USERNAME                     DEFAULT_TABLESPACE
      16 ---------------------------- ---------------------------
      17 STUDENT                      STUDENT
    • Exit sqlplus

      1 SQL> exit
      2 from Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production To break off
    • Import database using imp

      imp student/student file=student.dmp ignore=y full=y

       

      Keyword Description (default value) Keyword Description (default value)
      USERID User name/password FULL Import the entire file (N)
      BUFFER Data buffer size FROMUSER Owner User Name List
      FILE Input file (EXPDAT.DMP) TOUSER User Name List
      SHOW List only the contents of the file (N) TABLES List of table names
      IGNORE Ignore creation errors (N) RECORDLENGTH Length of IO Records
      GRANTS Import permission (Y) INCTYPE Incremental import types
      INDEXES Import Index (Y) COMMIT Submit Array Insertion (N)
      ROWS Import data row (Y) PARFILE Parameter file name
      LOG Screen Output Log Files CONSTRAINTS Import Limitation (Y)

Connecting with Orace SQL Developer

Download and decompress (no installation required)

SQL Developer Download

Connect to the database

  1. Open the main program. \sqldeveloper.exe
  2. make new connection
    • Based on the values previously set in sqlplus
      field value
      Connection name student_conn
      User name student
      Password student
      Save password Checklist
    • Select connection
  3. Now you can see that Student has been added before on the left connection panel.
  4. Start using Oracle SQL Developer!

Posted by TKKP on Wed, 19 Dec 2018 22:42:05 -0800