Install Oracle XE on Ubuntu

Source: Internet
Author: User
Tags sql client

Ubuntu does not support Oracle. online tutorials are too complex and always contain errors. Later, you can find a one that can install XE. Oracle Database 10g Express Edition requires 1006 MB of swap space

  1. Echo"Deb http://oss.oracle.com/debian/ unstable main non-free">/Etc/apt/sources. list
  2. Apt-get update
  3. Apt-get install oracle-xe-client
  4. Apt-get install oracle-xe
  5. Sh/etc/init. d/oracle-sh configure
  6. Vim/etc/Default/Oracle-xe

You can always disable Oracle XE startup in boot time with (no update-rc.d method here ;-)):

Chmod-x/etc/init. d/oracle-xe

The alernative way to the same is to edit/etc/default/oracle-xe and change:

  1. # ORACLE_DBENABLED =True
  2. ORACLE_DBENABLED =False

Web console management
-If you have installed OracleXE database on remote * nix server, you can easily setup a ssh tunnel in order to gain access to a web administration console (since web console is bound to loopback device and therefore unavailable outside to the network ):

$ Ssh oracle-xe-server-L 8081: localhost: 8080

While keeping this proces running (or keep it on background via 'screen' or 'nohup'), you may now login to Oracle XE web administrations console on your local computer: http: // localhost: 8081/apex /. please notice that your ssh daemon on your local computer shocould allow TCP forwarding: AllowTcpForwarding yes in your sshd configuration file.
SQL Remote connection management
-By default OracleXe installation does not allow SQL network connections to your XE database. to enable it, logon to web management console and enable "Remote connections": "Administration-> enable" Available from local server and remote clients "-> press" Apply Changes ". the same procedure can also be done from the commandline:

$ Sqlplus-S system/password @ // localhost/XE <!
EXEC DBMS_XDB.SETLISTENERLOCALACCESS (FALSE );
EXIT;
/
!

If your SQL client uses a Oracle Instant client installation, the SQL connection can be obtained by entering:

[Atrakic @ adm2-43 ~] $ Sqlplus username/password @ // oraclexe. hostname. or. ip // XE

If somewhat connection is refused (due to firewall restrictions) you can use same ssh trick as done previusly:

$ Ssh oracle-xe-server-L1512: Localhost:1512

Where your SQL connection shocould be like this:

Atrakic@ Adm2-43~] $ Sqlplus username/password @// Localhost // XE

User management
Add user
-In order to add single SQL user with non-dba privilages to OracleXE execute following commands:

  1. --
  2. -- Contents of: this_script. SQL
  3. --
  4. Create user myuser identified by the_password default tablespace users temporary tablespace temp quota unlimited on users;
  5. Create role myconnection;
  6. Grant create session, CREATE table, CREATE view, CREATE procedure, CREATE synonym TO myconnection;
  7. GRANT myconnection TO myuser;
  8. /

You can run this SQL script:

  1. # Su-oracle
  2. Oracle@ Server:~ $ Sqlplus/as sys
  3. SQL>@ This_script. SQL
  4. SQL> exit;

Alternatively use web Management console to add new Oracle XE users accordingly.
Delete user
-For deleting a SQL users from OracleXE use web management console or execute following commands from the commandline:

  1. # Su-oracle
  2. Oracle@ Server:~ $ Sqlplus/as sys
  3. SQL> drop user myuser cascade;
  4. SQL> exit;

ORACLE_HOME =/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/
You can create a tablespace in the command line.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.