Monday, November 24, 2008

Installation 3/6 - Oracle installation

Oracle debian installer download
To begin with, please download Oracle 10g Express edition from Oracle website. Since Ubuntu is built based on debian, debian installer is required.


Install Oracle Server

Using dpkg command, we can install the Oracle debian installer. Let's assume that the name of the installer is "oracle-xe-universal_10.2.0.1-1.0_i386.deb". Please input the below command.

dpkg -i oracle-xe-universal_10.2.0.1-1.0_i386.deb

Needless to say, you should input the command at the path contains the installer. Otherwise, correct path should be followed by the file name.
During the installation process, the installer prompted for configuration. When prompted, just ruen the following command.

$ /etc/init.d/oracle-xe configure

Then you can set the folliwng configuration information
  • A HTTP port for the Oracle Database GUI management (the default is 8080)
  • A port for the Oracle database listener (the defualt is 1521)
  • A password for sys and system admin user accounts
  • Whether you want to start automatically when the computer starts

Install Oracle Client
At this time, we will install the Oracle client. As same as the Oracle server, we need to download the debian Oracle client installer. After downloading it, please input the below command.

dpkg -i oracle-xe-client_10.2.0.1-1.0_i386.deb


Disk Swapping
During the installation process, some system may cause error due to insufficient swap space. If you don't see any error related with swap space, you can skip this section. If you encounter the problem, please refer the oracle installation memory in which you can calculate how much swap space is required. Then, you can input the below command.

dd if=/dev/zero of=/swapfile bs=1M count=800
mkswap /swpfile
swapon /swpfile


You can control the swap size using bs and count. As you can see, the swap page size will be the mutiple of the bs with the count.


Setting the Environment Variables
After installation, we need to set up the environment variables for Oracle server. Oracle provides a script that sets the environment variables. Just find the oracle_env.csh or oracle_env.sh file. You can use the below command to find them.

find -name "oracle_env.*"

Once you find the path, just move to there and run the one of the scripts. For C or tcsh shell, you can run oracle_env.csh. For Bourne, Bash, or Korn shell, just run oracle_env.sh.


Start and Stop Service

The following commands are for start and stop respectively.

$ /etc/init.d/oracle-xe start
$ /etc/init.d/oracle-xe stop


Enabling Remote Client Access
Basically, Oracle server dosen't allow the remote client access. To allow it, you need to start the Oracle service first. Then, run SQL*Plus with system account.

$ sqlplus system

Then, input password. You will see the SQL*Plus screen. Input the following command allowing remote clinet access.

SQL> EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);


Verifying the Oracle Installation
Just access the Oracle Database though the below URL through web browser.

http://{IP address}:port/apex/

If you can see the following screen, you can think the basic installation is done well. In addtion, please verify the database with other functions of the web site such as table creation and deleting.

No comments: