Showing posts with label express edition. Show all posts
Showing posts with label express edition. Show all posts

Friday, March 15, 2013

Installing Oracle XE on Ubuntu 32-bit

For successful installation of Oracle XE on Ubuntu 32-bit, following requirements must be satisfied :-
a) 512 MB RAM
b) 1 GB swap-space
c) 1.5 GB of free space in the mount-point containing /usr/lib directory.

For installing the Oracle 10g XE R2 do the following :
1) Install the libaio1 package .
            
sudo apt-get install libaio1


2) Download the .deb installer file : 
For the people who want to install Oracle XE on the 32-bit Ubuntu system but are not able to do the same due to unavailability of the installer from Oracle Website , here is some good news. I am sharing the original Oracle 10g R2 XE ( express edition ) installer on my cloud space.

The Link : One Drive Link

File size : 220670896
md5sum : 47a83df38f2cbcd78b9a1f110c1c5d92
sha1sum : be666229e036afa85dcc9437d48a418bf65c3468

Use the above link to download the deb installer file.
 
3) Go to the download location and run below command to install the Oracle 10g XE :
            
dpkg -i oracle-xe_10.2.0.1-1.0_i386.deb


4) Configure the installation:
           
  /etc/init.d/oracle-xe configure


Enter the following configuration information:
  • A valid HTTP port for the Oracle Application Express (the default is 8080) 
  • A valid port for the Oracle database listener (the default is 1521) 
  • A password for the SYS and SYSTEM administrative user accounts 
  • Confirm password for SYS and SYSTEM administrative user accounts  
  • Whether you want the database to start automatically when the computer starts (next reboot).  

5) Set-up the environment variables :
Add following lines to .bashrc of the user which you will using to access the Oracle 10g XE:
  • export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
  • export ORACLE_SID=XE 
  • export PATH=$ORACLE_HOME/bin:$PATH 

6) Start a new shell ( terminal window ) for the changes to take effect or execute the .profile to force the changes made in the same session.
       
  . ./.profile


7) Use the command "sqlplus sys as sysdba" and the password which you created while configuration to connect to the database.

Have a happy Ubuntu Experience...

Note:- If anyone face problem in downloading from the above link, please let me know in the comments.

Thursday, May 10, 2012

Installing Oracle 11g R2 Express Edition on Ubuntu 12.04 64-bit

              Recently I installed Oracle 11g R2 Express Edition on my ubuntu 12.04 ( Precise Pangolin). But for this, I have to google a lot and had to install two times to get a fully working environment. So, I thought it would be better if I share my experience with my fellow ubuntu'ers so that they don't have to face the troubles that I encountered. I have came up with following series of steps ( mostly derived from the link source I given at the end of this post ) for easy and hassle-free installation.
              But at first, I must inform you about the limitations of Oracle 11g R2 Express Edition (XE) which are as follows :

    • The Installer released by Oracle is only meant for 64-bit (x86_64) systems. If you wish to install the 32-bit version , see installing oracle xe on ubuntu 32-bit
    • It will consume, at most, processing resources equivalent to one CPU.
    • Only one installation of Oracle Database XE can be performed on a single computer.
    • The maximum amount of user data in an Oracle Database XE database cannot exceed 11 GB.
    • The maximum amount of RAM that Oracle XE uses cannot exceed 1 GB, even if more is available.
      Now the steps for Installation :

      1) Download the Oracle 11gR2 express edition installer from the link given below:


      ( You will need to create a free oracle web account if you don't already have it )

      2) Unzip it :
      unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip

      3) Install the following packages :
      sudo apt-get install alien libaio1 unixodbc vim

      4) Convert the red-hat ( rpm ) package to Ubuntu-package :
      sudo alien --scripts -d oracle-xe-11.2.0-1.0.x86_64.rpm

      (Note: this may take a while , till that time you can go for step 5 )

      5) Do the following pre-requisite things:
      a) Create a special chkconfig script :

      The Red Hat based installer of Oracle XE 11gR2 relies on /sbin/chkconfig, which is not used in Ubuntu. The chkconfig package available for the current version of Ubuntu produces errors and my not be safe to use. Below is a simple trick to get around the problem and install Oracle XE successfully: 
      sudo vim /sbin/chkconfig

      (copy and paste the following into the file )
      #!/bin/bash
      # Oracle 11gR2 XE installer chkconfig hack for Ubuntu
      file=/etc/init.d/oracle-xe
      if [[ ! `tail -n1 $file | grep INIT` ]]; then
      echo >> $file
      echo '### BEGIN INIT INFO' >> $file
      echo '# Provides: OracleXE' >> $file
      echo '# Required-Start: $remote_fs $syslog' >> $file
      echo '# Required-Stop: $remote_fs $syslog' >> $file
      echo '# Default-Start: 2 3 4 5' >> $file
      echo '# Default-Stop: 0 1 6' >> $file
      echo '# Short-Description: Oracle 11g Express Edition' >> $file
      echo '### END INIT INFO' >> $file
      fi
      update-rc.d oracle-xe defaults 80 01
      Save the above file and provide appropriate execute privilege :
             sudo chmod 755 /sbin/chkconfig

      b) Set the Kernel parameters :
      Oracle 11gR2 XE requires to set the following additional kernel parameters:
      sudo vim /etc/sysctl.d/60-oracle.conf 
      (Enter the following) 
      # Oracle 11g XE kernel parameters  
      fs.file-max=6815744  
      net.ipv4.ip_local_port_range=9000 65000  
      kernel.sem=250 32000 100 128 
      kernel.shmmax=536870912 
      (Save the file) 
      Note: kernel.shmmax = max possible value , e.g. size of physical RAM ( in bytes e.g. 512MB RAM == 512*1024*1024 == 536870912 bytes ) 
      Verify the change : 
      sudo cat /etc/sysctl.d/60-oracle.conf 
      Load new kernel parameters: 
      sudo service procps restart  
      Verify: sudo sysctl -q fs.file-max 
             -> fs.file-max = 6815744 
      c) Increase the system swap space : Analyze your current swap space by following command :
                 free -m 
      Minimum swap space requirement of Oracle 11gR2 XE is 2 GB . In case, your is lesser , you can increase it by following steps in my one of previous post .
      d) make some more required changes :
      i) sudo ln -s /usr/bin/awk /bin/awk 
      ii) mkdir /var/lock/subsys 
      iii) touch /var/lock/subsys/listener 


      6) Now you are ready to install Oracle 11gR2 XE. Go to the directory where you created the ubuntu package file in Step 4 and enter following commands in terminal :
      i) sudo dpkg --install oracle-xe_11.2.0-2_amd64.deb  
      Update : Before you proceed to next step , do have a look at this trouble-shooting post in order to avoid MEMORY TARGET or any other "shared memory" error.

      ii) sudo /etc/init.d/oracle-xe configure 
      Enter the following configuration information:
      • A valid HTTP port for the Oracle Application Express (the default is 8080)  
      • A valid port for the Oracle database listener (the default is 1521) 
      • A password for the SYS and SYSTEM administrative user accounts
      Update / Note:- Few people have also reported ORA-01031: insufficient privileges error while connecting to the database. To avoid this simply use "oracle" ( without quotes ) as your password in this step. 
      • Confirm password for SYS and SYSTEM administrative user accounts
      • Whether you want the database to start automatically when the computer starts (next reboot).
      7) Before you start using Oracle 11gR2 XE you have to set-up more things :
      a) Set-up the environmental variables :
      Add following lines to your .bashrc :
      export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
      export ORACLE_SID=XE
      export NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh`
      export ORACLE_BASE=/u01/app/oracle
      export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
      export PATH=$ORACLE_HOME/bin:$PATH
       
      b) execute your .profile to load the changes:
           
                . ./.profile

      8) Start the Oracle 11gR2 XE :

      sudo service oracle-xe start

      The output should be similar to following :
      user@machine:~$ sudo service oracle-xe start
      Starting Oracle Net Listener.
      Starting Oracle Database 11g Express Edition instance.
      user@machine:~$
       
      8) Create your user :
      a) start sqlplus and login as sys :
      sqlplus sys as sysdba
      ( provide the password you gave while configuring the oracle in Step 6 (ii) ).
      This should come to following :

      SQL*Plus: Release 11.2.0.2.0 Production on Wed May 9 12:12:16 2012

      Copyright (c) 1982, 2011, Oracle. All rights reserved.

      Enter password:

      Connected to:
      Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

      SQL>

      b) Enter following on the sql prompt : Replace username and password by your desired ones.
      SQL> create user username identified by password;

      User created.

      SQL> grant connect,resource to username;

      Grant succeeded. 
       

      9) Now as you have created the user , you can login to it :

      user@machine:~$ sqlplus

      SQL*Plus: Release 11.2.0.2.0 Production on Wed May 9 12:28:48 2012

      Copyright (c) 1982, 2011, Oracle. All rights reserved.

      Enter user-name: temp
      Enter password:

      Connected to:
      Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

      SQL> select 2+2 from dual;

      2+2
      ----------
      4

      SQL>


      Reference Links :-
      1. Oracle 11g reference Documents