`

Installing Java, Oracle 11g R2 Express Edition and SQL Developer on Ubuntu 64-bi

 
阅读更多

 

Installing Java

We start with installing Java on the machine. My personal preference is to use Oracle Java JDK. Installing this JDK could be done easily by performing the following statements.

1 sudo add-apt-repository ppa:webupd8team/java
2 sudo apt-get update
3 sudo apt-get install oracle-java7-installer

The screen in figure 1 will appear in the terminal, hit enter to proceed. After this, the screen in figure 2 will be shown. Navigate to <Yes> using the left arrow on your keyboard and hit enter. Oracle JDK 7 will be installed.

Binary Code license Figure 1: Binary Code license JDK License AgreementFigure 2: JDK License Agreement

To validate the Java installation, execute the following command:

1 java -version

This should result in the following (or something similar).

1 java version “1.7.0_51”
2 Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
3 Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)

The next next step is to set the JAVA_HOME environment variable. To do this, open the /etc/bash.bashrc file by executing the following statement.

1 sudo gedit /etc/bash.bashrc

Scroll to the bottom of the file and add the following lines.

1 export JAVA_HOME=/usr/lib/jvm/java-7-oracle
2 export PATH=$JAVA_HOME/bin:$PATH

Save the file and close the editor. To load the changes, execute the following statement.

1 source /etc/bash.bashrc

To validate the changes you can execute the following statement.

1 echo $JAVA_HOME

The result of this statement should be the following.

1 /usr/lib/jvm/java-7-oracle

Installing Oracle 11g R2 Express Edition

For the installation of Oracle 11g R2 Express Edition (XE), a couple of additional Linux packages are required. These packages can be installed by executing the following statement.

1 sudo apt-get install alien libaio1 unixodbc

The next step is to download the Oracle 11g R2 Express Edition from the Oracle website. Make sure you select the Linux x64 version from http://www.oracle.com/technetwork/products/express-edition/downloads/index.html. After the download is completed, open the terminal and navigate to the download directory. In my case this can be done by executing the following statement.

1 cd Downloads

The next step step is to unzip the downloaded file. To do this, execute the following command.

1 unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip

A new directory (Disk1) is added to the Download directory. Navigate to this directory:

1 cd Disk1

Now we have to convert the Red Hat package (rpm) to a Debian package. This may be done using the alien command. The -d parameter is used to inform alien that a Debian package should be generated. When the -scripts parameter is toggled, alien will try to convert the scripts that are meant to be run when the package is installed and removed.

1 sudo alien --scripts -d oracle-xe-11.2.0-1.0.x86_64.rpm

This step may take a while, while this statement is executing we can do the following steps. Open a new terminal window for these steps.

The Red Hat package, relies on the /sbin/chkconfig file, which is not used in Ubuntu. To successfully install Oracle XE we use a simple trick. Start by creating a custom /sbin/chkconfig file by executing the following statement.

1 sudo gedit /sbin/chkconfig

Copy and paste the following into the editor:

01 #!/bin/bash
02 # Oracle 11gR2 XE installer chkconfig hack for Ubuntu
03 file=/etc/init.d/oracle-xe
04 if [[ ! `tail -n1 $file | grep INIT` ]]; then
05 echo >> $file
06 echo '### BEGIN INIT INFO' >> $file
07 echo '# Provides: OracleXE' >> $file
08 echo '# Required-Start: $remote_fs $syslog' >> $file
09 echo '# Required-Stop: $remote_fs $syslog' >> $file
10 echo '# Default-Start: 2 3 4 5' >> $file
11 echo '# Default-Stop: 0 1 6' >> $file
12 echo '# Short-Description: Oracle 11g Express Edition' >> $file
13 echo '### END INIT INFO' >> $file
14 fi
15 update-rc.d oracle-xe defaults 80 01
16 #EOF

Save the file and close the editor. Now we have to provide the file with the appropriate execution privileges.

1 sudo chmod 755 /sbin/chkconfig

After this, we have to create the file /etc/sysctl.d/60-oracle.conf to set the additional kernel parameters. Open the file by executing the following statement.

1 sudo gedit /etc/sysctl.d/60-oracle.conf

Copy and paste the following into the file. Kernel.shmmax is the maximum possible value of physical RAM in bytes. 536870912 / 1024 /1024 = 512 MB.

1 # Oracle 11g XE kernel parameters
2 fs.file-max=6815744
3 net.ipv4.ip_local_port_range=9000 65000
4 kernel.sem=250 32000 100 128
5 kernel.shmmax=536870912

Save the file. The changes in this file may be verified by executing:

1 sudo cat /etc/sysctl.d/60-oracle.conf

Load the kernel parameters:

1 sudo service procps start

The changes may be verified again by executing:

1 sudo sysctl -q fs.file-max

This method should return the following:

1 fs.file-max = 6815744

After this, execute the following statements to make some more required changes:

1 sudo ln -s /usr/bin/awk /bin/awk
2 mkdir /var/lock/subsys
3 touch /var/lock/subsys/listener

Close the second terminal window and return to the first terminal window. The rpm package should be converted and a new file called oracle-xe-11.2.0-2_amd64.deb have been generated. To run this file, execute the following command:

1 sudo dpkg --install oracle-xe_11.2.0-2_amd64.deb

Execute the following to avoid getting a ORA-00845: MEMORY_TARGET error. Note: replace “size=4096m” with the size of your (virtual) machine’s RAM in MBs.

1 sudo rm -rf /dev/shm
2 sudo mkdir /dev/shm
3 sudo mount -t tmpfs shmfs -o size=4096m /dev/shm

Create the file /etc/rc2.d/S01shm_load.

1 sudo gedit /etc/rc2.d/S01shm_load

Copy and paste the following in the file. Note: replace “size=4096m” with the size of your machine’s RAM in MBs.

01 #!/bin/sh
02 case "$1" in
03 start) mkdir /var/lock/subsys 2>/dev/null
04 touch /var/lock/subsys/listener
05 rm /dev/shm 2>/dev/null
06 mkdir /dev/shm 2>/dev/null
07 mount -t tmpfs shmfs -o size=4096m /dev/shm ;;
08 *) echo error
09 exit 1 ;;
10 esac

Save the file, close the editor and provide the appropriate execution privileges.

1 sudo chmod 755 /etc/rc2.d/S01shm_load

Configuring Oracle 11g R2 Express Edition

If you have successfully installed to Oracle 11g R2 Express Edition server, it’s time to configure the server. To start the configuration of the server, execute the following command and follow the “wizard” in the terminal. Default values are shown between brackets for each question.

1 sudo /etc/init.d/oracle-xe configure

Now it is time to set-up some environmental variables. Open the /etc/bash.bashrc file by executing the following statement:

1 sudo gedit /etc/bash.bashrc

Scroll to the bottom of the file and add the following lines.

1 export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
2 export ORACLE_SID=XE
3 export NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh`
4 export ORACLE_BASE=/u01/app/oracle
5 export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
6 export PATH=$ORACLE_HOME/bin:$PATH

Save the file and close the editor. To load the changes, execute the following statement:

1 source /etc/bash.bashrc

To validate the changes you can execute the following statement.

1 echo $ORACLE_HOME

This statement should result in the following output.

1 /u01/app/oracle/product/11.2.0/xe

After this step it is recommended to reboot the machine. After the reboot is completed, you should be able to start the Oracle server using the following command:

1 sudo service oracle-xe start

A file named oraclexe-gettingstarted.desktop is placed on your desktop. To make this file executable, navigate to you desktop.

1 cd ~/Desktop

To make the file executable, execute the following statement.

1 sudo chmod a+x oraclexe-gettingstarted.desktop

Installing SQL Developer

Finally, after the installation of Oracle 11g R2 Express Edition and Java, SQL Developer could be installed. This is done by performing the following steps.

Download Oracle SQL Developer from the Oracle site. Select the Linux RPM package: http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html. Open a terminal window and navigate to the Download directory:

1 cd Downloads

Convert the Red Hat package to a Ubuntu package. Note: this may take a while.

1 sudo alien --scripts -d sqldeveloper-4.0.0.13.80-1.noarch.rpm

A file named sqldeveloper_4.0.0.13.80-2_all.deb will be generated. To run this file, execute the following statement:

1 sudo dpkg --install sqldeveloper_4.0.0.13.80-2_all.deb

Create a .sqldeveloper directory in your home folder:

1 sudo mkdir /home/.sqldeveloper/

Run SQL Developer from the terminal.

1 sudo /opt/sqldeveloper/sqldeveloper.sh

Now enter the full Java path. In my case this is done as follows:

1 /usr/lib/jvm/java-7-oracle

 

 

分享到:
评论

相关推荐

    Installing Oracle 11g Release 2 Enterprise Edition

    标题《Installing Oracle 11g Release 2 Enterprise Edition》和描述中提到的内容,强调的是安装Oracle 11g R2 EE版数据库软件的过程和注意事项。在这个过程中,首先需要了解的是,官方不推荐在生产环境中使用Oracle...

    Installing Oracle Database 11g on Linux

    - 安装Perl和Java:Oracle 11g需要Perl 5.8.5及以上版本和Java Development Kit (JDK) - 创建Oracle用户和组:`groupadd oinstall && useradd -g oinstall -G dba oracle -s /bin/bash` 2. **下载Oracle软件**: ...

    oracle-11g安装手册

    - Requirements for Installing Oracle 11g R2 RDBMS on RHEL (and OEL) 5 on AMD64/EM64T。 #### 三、Oracle 11g的安装 1. **安装流程**: - 运行Oracle Database安装程序。 - 配置单点登录(Single Sign-On)...

    Oracle Database 11g Release 2 (11.2.0.3) RAC On Oracle Linux 6

    This article describes the installation of Oracle Database 11g release 2 (11.2.0.3 64-bit) RAC on Linux (Oracle Linux 6.3 64-bit) using VirtualBox (4.2.6) with no additional shared disk devices. ...

    PL/SQL Developer - 中文

    PL/SQL Developer - 中文...The language packs need to be installed after installing PL/SQL Developer, and will work with both the registered and trial version. PL/SQL Developer 12.0 or later is required.

    Requirements For Installing Oracle10gR2 On RHEL 5&OEL 5 (x86_64)

    ### 安装Oracle 10g R2在RHEL 5 & OEL 5 (x86_64)上的需求 #### 概述 本文档详细介绍了在Red Hat Enterprise Linux(RHEL)5和Oracle Enterprise Linux(OEL)5(x86_64架构)上安装Oracle 10g Release 2数据库的...

    Exam Ref 70-410: Installing and Configuring Windows Server 2012 R2

    Prepare for Microsoft Exam 70-410 – and help demonstrate your real-world mastery of implementing and configuring core services in Windows Server 2012 R2. Designed for experienced IT professionals ...

    riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip

    《RISC-V架构与ESP开发环境详解:基于riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-win64》 在现代计算机科学中,RISC-V(Reduced Instruction Set Computer - V)架构以其开放源码、模块化和低功耗的特性,逐渐...

    Oracle administration guide + Concepts Oracle + Installing Oracle Database 10 g on Sun Solaris 10 by Using RC

    安装Oracle Database 10g在Sun Solaris 10操作系统上是一个技术性较强的步骤,"Installing Oracle Database 10 g on Sun Solaris 10 by Using RC"文档会详细指导这一过程。这通常包括硬件和软件需求分析、操作系统...

    Installing Oracle 10G On Linux

    在本文中,我们将深入探讨如何在Linux环境下安装Oracle 10G数据库系统。Oracle 10G是一款功能强大的关系型数据库管理系统,广泛应用于企业级的数据存储和管理。Linux作为开源且稳定的操作系统,是部署Oracle数据库的...

    Oracle.Application.Express.Administration.For.DBAs.and.Developers.epub

    This book helps database and system administrators succeed in managing Oracle Application Express (APEX) environments. Focus is on creating the right combination of scalability, high-availability, ...

    Installing-oracle-10g.zip_oracle

    《在Linux环境下安装Oracle 10g的详细指南》 Oracle 10g是一款功能强大的关系型数据库管理系统,尤其在企业级应用中广泛使用。在Linux操作系统上安装Oracle 10g,不仅可以充分利用Linux的稳定性,还能享受到开源...

    MinGW(x86_64-8.1.0-release-win32-sjlj-rt_v6-rev0.7z)

    这个压缩包文件 "x86_64-8.1.0-release-win32-sjlj-rt_v6-rev0.7z" 提供的是MinGW的64位版本,对应于GCC(GNU Compiler Collection)8.1.0版本,支持x86_64架构。GCC是开源的、跨平台的编译器套件,包括C、C++、...

    Installing-Mumax-and-Gnuplot-in-Windows-10-Step-by-Step

    1. 打开 mingw-w64 官方网站,下载 mingw-w64 安装程序。 2. 安装 mingw-w64,按照提示进行安装。 3. 配置环境变量,以便在命令行中使用 mingw-w64。 知识点7:安装 g95-Mingw g95-Mingw 是一个开源的 Fortran ...

    x86_64-8.1.0win32-seh-rt_v6-rev0.zip

    MinGW-W64 GCC-8.1.0 x86_64-posix-seh 版本 地址:https://sourceforge.net/projects/mingw-w64/files/mingw-w64/

    Oracle Solaris 11 Installing Oracle Solaris 11 Systems-204

    本教程"Oracle Solaris 11 Installing Oracle Solaris 11 Systems-204"着重于系统的安装过程,旨在帮助用户理解并顺利完成Oracle Solaris 11的部署。 在安装Oracle Solaris 11时,用户需要掌握以下关键知识点: 1....

    mingw-w64-install

    MingW-W64 是一个为 Windows 平台构建的开源 GCC 编译器集合,它提供了对 32 位和 64 位应用程序的支持。MingGW(Minimalist GNU for Windows)最初是为了在 Windows 上提供一个与 GNU 工具链兼容的环境,而 MingW-W...

    Microsoft SQL Server 2016: A Beginner’s Guide, 6th Edition

    Filled with new real-world examples and hands-on exercises, Microsoft SQL Server 2016: A Beginner’s Guide, Sixth Edition 版本, starts by explaining fundamental relational database system concepts....

Global site tag (gtag.js) - Google Analytics