I have yet to find a great, all-encompassing guide for all of these that seems to discuss all issues. So, here’s my attempt to instruct how to install Oracle 10g db server and Oracle 10g HTTP Server. Please feel free to contact me with corrections, updates, and questions.
Background
After struggling with trying to install Oracle 10g db server 64-bit on Ubuntu 9.04 x64, I simply gave up. There were too many library incompatibilities on both ends (deprecated libraries, libraries named differently, and the simple fact that Oracle 10g db server 64-bit is NOT entirely 64-bit – oops, thanks Oracle). So, for ease of getting it working (since Ubuntu is not officially recommended by Oracle), I will be using the 32-bit version and an older version of Ubuntu. Ubuntu 9.* has updated various libraries and you will have to do a lot more linking of various items that are deprecated, as well as finding old binaries and packages from out-of-date repositories.
To make my life easier, I’m going to install Ubuntu 8 as a new VMWare Workstation image on my Windows desktop. This will allow me a lot of control locally without any network lag, but I’ll still be able to upload to my ESXi server for VMWare Infrastructure use later. The other nice thing is I can snapshot now and then, and backtrack.
Pre-requisites
I’m assuming you will do this install on a LAN where you can have one machine freely talk to another via TCP.
I’m also assuming your main machine is running Windows 200, XP, Vista, or 7 (I am using Windows 7) and that you have a copy of VMWare Workstation (I am using v6.5) installed on it.
You will need to download and install a few external pieces of software (including oracle) but I will point those out as I go. These include PuTTY, WinSCP, Xming, and Xming-fonts.
Download Ubuntu
First, download an ISO image of Ubuntu 8.04.3 LTS Server (Intel x386). Why Server and not Desktop? I try to keep the footprint small. Yes, the Oracle installers need an X-Windows environment. We’ll take care of that later, and yes, we’ll do it on Windows.
Create a New VMWare Image
Once that has finished downloading, open VMWare Workstation, and click File… New… Virtual Machine. You will see the New Virtual Machine Wizard:

Select “Typical”, and click “Next”.

Select “Installer disc image file (iso)” and then navigate to the ubuntu server ISO that you just download. Click “Next”.

On the next dialog, change these values appropriately. This is a machine name only in how VMWare identifies the machine and file name. I’d recommend change this to something that makes sense such as “ubuntu_hardy_x32_server_1″, but this is up to you. Click “Next”.

On the next page of the wizard, select a maximum disk size. Changing this later is a bit annoying (as you have to re-partition using Linux disk partition utilities). I’d suggest setting this higher for now.
Additionally, Oracle requires a certain size SWAP file (at least 1GB) and Ubuntu will automatically partition a swap file size during setup, based on total disk size. In order to make sure you do not have to reconfigure later, I’d suggest making the maximum drive size at least 36GB.
VMWare Workstation is nice in that it will only allocate space as it’s needed, so it will not automatically set aside your maximum space all at once (ESXi server works a bit differently). If you plan to move this image around, I’d suggest selecting “Split virtual disk into 2GB files”, otherwise don’t worry about it. Click “Next”.

Review this screen, and click “Finish”. Memory allocation can be adjusted later on the machine’s settings, in real-time. Oracle will run at 512MB RAM anyway since that is its minimum requirement.
Now you will go through a standard Ubuntu install.
Install Ubuntu Server
Select your language (I selected “English”).
Select “Install Ubuntu Server”.
Again select your language for Install (I selected “English”).
Select your country (I selected “United States”).
Select your keyboard layout (or do the auto-detect wizard, I selected “No” and then “USA”).
Wait for components to load…
Select a hostname. For this blog post, I’m going to leave it as “ubuntu”, however what you call your machines is entirely up to you and can be changed later. The machine name however, will be a crucial automatic part of the Oracle install. If you are going to change the machine name, it’s best to do it before installing Oracle.
Select your timezone (I selected “Eastern”).
Select your disk partitioning method. I selected “Guided – use entire disk” as I really don’t want to mess around with the Linux Volume Manager. I’d suggest this as your choice, unless you have experience using LVM.
Select the disk to partition. I selected “SCSI3 (0,0,0) (sda) – 58.0 GB VMware, VMWare Virtual S”.
You will then be presented with a screen asking you to confirm the partitioning of the disk into 2 partitions – one formatted with ext3 as the primary partition, and the other one formatted as a Linux swap partition. Select “Yes” to write the changes to disk.
The system will now install itself (don’t worry, this moves along faster than a Windows installer – you will only wait a couple of minutes).
When that finishes, you are prompted to enter a user account. I would suggest to NOT enter the “oracle” user at this time. Instead, enter an id (or your own) you will normally use for administration and maintenance of this box. I entered “bsodano”. Throughout the rest of this document I will refer to this account as the “user” account. Enter and re-verify a password for this user.
Configure your HTTP Proxy (if any). Most likely, you will leave this blank and hit “Enter” (this is what I did).
The installer will then scan the apt repository across the internet. If you do not have internet access, you can ignore this step and just continue forward. If your machine is connected to the internet, VMware workstation will use NAT to proxy through your local Windows machine out to the internet. You are promoted to select more software to install. i will select “OpenSSH server” to connect remotely later, and “Mail server” (which installs Postfix and Dovecot) because I will want to configure the mail server to work with Oracle. Click “Continue”.
Postfix Configuration will ask you if this is an “Internet Site” – if you want this server to relay mail, then select it and hit “Enter”.
Select your local domain name for the mail server, or just leave “ubuntu.localdomain”. This is adjustable later.
Finally, you will get to the “Finish the installation” screen which should state “Installation complete”. Select “Continue”.
If all goes well, the machine should boot and you should see something resembling this in the VMWare console window:

Login with the “user” account. In VMWare Workstation, you can click on the “I Finished Installing” button. If you get prompted to install VMWare Tools, you can click “Never Remind Me”. VMWare Tools will not really help us with anything in a shell-only environment.
Snapshot
Now, one of the best features of VMWare is the ability to snapshot the state of a machine at a point in time. I’d suggest taking a snapshot regularly throughout this process if you need to revert or try something again. This marks the first spot you should take a snapshot.
In VMWare Workstation, go to VM… Snapshot… Take Snapshot. You are presented with a dialogue window. Create a name and description. Click “OK” to create the snapshot.

Additional Configuration
One thing – if you did not install OpenSSH Server during the install, you will want to do that now. Make sure your Windows machine is connected to the Internet. At the bash shell prompt, type in the following two commands. The first updates the apt-repositories’ cache, the second one will install OpenSSH Server:
sudo apt-get update
sudo apt-get install openssh-server
Once OpenSSH Server is installed, right-click on the virtual machine in VMWare Workstation and click settings. Click on “Edit Virtual Machine” settings in the screen that replaced the console window.
Adjust memory from 512MB if you need to (Oracle’s minimum requirement is 512MB RAM so this setting can stay this way).
Under Network Adapter, change from “NAT” to “Bridged”. Hit “OK”.
At the shell prompt, type the following to release and renew your IP address:
sudo dhclient -r
sudo dhclient
ifconfig
My IP Address is 192.168.1.108:

On my windows machine I can go to a Command Prompt, and see what my IP address is for my local machine – 192.168.1.131:

Windows Machine IP Address: 192.168.1.131
Ubuntu Machine IP Address: 192.168.1.108
On the Ubuntu machine, in the virtual machine console we’re going to type “exit” to logout. Right-click on the virtual machine under “Powered On” and click “Close”. Select “Run in Background”. Minimize VMWare Workstation for now.
Oracle Environment Preparation
If you do not already have it, download PuTTY. I’ll use it for the remaining how-to’s and steps for getting Oracle running.
Open PuTTY:

Under “Connection” on the left, expand “SSH” and select “X11″. Check off “Enable X11 forwarding”. Go back and select “Session”.
Under “Host Name (or IP Address)” type in the Ubuntu box’s IP. Keep port “22″ and “SSH” selected. Click on the text box under “Saved Sessions” and type in a name for this such as “Ubuntu”. Click the “Save” button to the right. Now these settings are saved for future use.
Click “Open”. You will see a screen like this one pop up:

Click “Yes” and then login with your “user” account. Your PuTTY window should look like this:

Now, let’s prep the environment. First, install the necessary pre-requisite binaries on the system via the following commands. Ubuntu will only need the following updates/new packages (let’s run an apt update and upgrade first):
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install make binutils gcc lesstif2 lesstif2-dev libaio1 libstdc++5 build-essential libdb1-compat rpm x11-xserver-utils libxp6 libxtst6 unzip -y
What are these additional libraries for? I’ll break them down:
make – the GNU version of the make utility
binutils – the GNU assembler, linker, and binary utilities
gcc – the GNU C compiler
lesstif2 – OSF/Motif 2.1 libraries
lesstif2-dev – development library and header files for LessTif 2.1
libaio1 – linux kernel aio access library
libstdc++5 – GNU standard C++ library v3
build-essential – informational list of build essential packages
rpm – Red Hat package manager
libdb1-compat – Berkeley database routines (required for HTTP Server install only)
x11-xserver-utils – X Server utilities (required for X Server usage for Oracle GUI installer)
libxp6 – X Printing extension library (required for X Server usage for Oracle GUI installer)
libxtst6 – X11 Testing Resource Extension library (required for X Server usage for Oracle GUI installer)
unzip – De-archiver for zip files (required to unzip install files from Oracle)
Emulate Red Hat
Next, fake-out the Oracle Installer by pretending to be Red Hat Linux. You do this by entering the following commands. Red Hat has a slightly different directory structure than Ubuntu:
sudo ln -s /usr/bin/awk /bin/awk
sudo ln -s /usr/bin/rpm /bin/rpm
sudo ln -s /usr/bin/sort /bin/sort
sudo ln -s /usr/bin/basename /bin/basename
sudo ln -s /etc /etc/rc.d
Create a file that has Red Hat system information. This file is scanned by the installer and if it doesn’t exist or if the information appears to be different than expected, the installer will complain.
sudo touch /etc/redhat-release
sudo chmod 666 /etc/redhat-release
sudo echo "Red Hat Linux release 3.0 (drupal)" > /etc/redhat-release
Create Directories
Now, let’s make the directories that will store the Oracle 10g database and http binaries and configuration, as well as the databases. I’m going to modify the Optimal Flexible Architecture (OFA) guide for naming conventions, simply because the paths become ridiculously long to manage and personally, I just don’t like them that much. I’m going to store Oracle Db 10g files in “/u01/oracle/db/10g”, Http server files in “/u01/oracle/http/10g”, Oracle data files in “/u02/oracle/data”, installer and inventory information in “/u01/oracle/inventory”, installer files in “/u01/oracle/install”, and backup files in “/u03/oracle/backup”. So let’s make those directories:
sudo mkdir -p /u01/oracle/db/10g
sudo mkdir -p /u01/oracle/http/10g
sudo mkdir -p /u01/oracle/install
sudo mkdir -p /u01/oracle/inventory
sudo mkdir -p /u02/oracle/data
sudo mkdir -p /u03/oracle/backup
Create Security Roles and Assign Permissions
Now let’s make our users and groups for oracle, and have them own those directories:
sudo groupadd oinstall
sudo groupadd dba
sudo groupadd nobody
sudo useradd -g oinstall -G dba -p password -d /home/oracle -m oracle -s /bin/bash -u 400
sudo usermod -g nobody nobody
sudo passwd oracle
The usermod command is needed since because when running, the installer looks for a user called “nobody” which is part of a group named “nobody” (in Ubuntu, the user “nobody” is assigned to “nogroup” by default).
Note: I specifically set the “oracle” UID to “400″. I think this practice comes from older installers needing the “oracle” UID to be below 500, which on *nix systems was typically the UID range reserved for system accounts. I do not think for Oracle 10g this matter, this is simply a matter of habit. If you want the system to auto-assign a UID, you can remove the “-u 400″ or set the UID to whichever you want.
Let’s now assign appropriate permissions and user/group owners to these directories:
sudo chown -R oracle:oinstall /u01 /u02 /u03
sudo chmod -R 775 /u01 /u02 /u03
Oracle recommends setting limits on the number of processes and open files each Linux account may use. To make these changes run:
sudo vi /etc/security/limits.conf
and at the end of the file add the following lines:
* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536
then run:
sudo vi /etc/pam.d/su
and uncomment the following:
session required pam_limits.so
and lastly, run:
sudo vi /etc/profile
and at the end of the file, add the following lines:
if [ $USER = "oracle" ]; then
ulimit -u 16384 -n 65536
fi
Set Kernel Parameters
Oracle instances consume memory and CPU resources and Ubuntu doesn’t come configured to allow the quantity of resources to be consumed that we’ll end up needing. To fix that, we therefore have to specify a set of new Kernel Parameters which the operating system should use.
Run:
sudo vi /etc/sysctl.conf
and at the end of the file, add the following lines:
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_max = 262144
What do those parameters and values actually mean?
fs.file-max sets the maximum number of open files that can be handled by the Linux kernel.
kernel.shmall determines the total amount of shared memory to be allocated in pages. In this example, I’ve set it to 2GB.
kernel.shmmax controls the maximum amount of memory to be allocated for shared memory which in this example is 5GB.
kernel.shmmni defines the maximum number of segments system-wide.
net.core.rmem_default and net.core.rmem_max define the default and maximum read buffer queue for network operations (256 KB in this example)
net.core.wmem_default and net.core.wmem_max define the default and maximum write buffer queue for network operations (256 KB in this example)
net.ipv4.ip_local_port_range tells the kernel the port ranges that will be used for outbound connections.
kernel.sem has four parameters:
1. SEMMSL – semaphores per array
2. SEMMNS – max semaphores system-wide (SEMMNI*SEMMSL)
3. SEMOPM – max operations per semop call
4. SEMMNI – max number of semaphore arrays
Now, force the server to re-read the file without need for a reboot by now issuing the command:
sudo /sbin/sysctl -p
Setup Environment Variables
Run the following to edit the home directory environment variables:
sudo vi /home/oracle/.bashrc
At the end of the file, add the following based on the directory structure we have already set up (Make sure to leave a blank line after the last of these lines):
ORACLE_BASE=/u01/oracle
ORACLE_HOME=$ORACLE_BASE/db/10g
ORACLE_HTTPSERVER_HOME=$ORACLE_BASE/http/10g
APEX_HOME=$ORACLE_BASE/install/apex
ORACLE_SID=orcl
ORATAB=/etc/oratabLD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_BASE ORACLE_HOME ORACLE_HTTPSERVER_HOME APEX_HOME ORACLE_SID ORATAB LD_LIBRARY_PATH
PATH=${PATH}:$ORACLE_HOME/bin
Get Oracle 10g and Http Server and Install
Type “exit” in the current bash window, and reconnect with PuTTY to the Ubuntu box. This time, login as the oracle user.
Go to Oracle’s site and register and download Oracle Database 10g Release 2 (10.2.0.1.0) for Linux x86 and Oracle Database 10g Companion CD Release 2 (10.2.0.1.0) for Linux x86 (contains Oracle HTTP Server). Copy files to your Ubuntu instance under the /u01/oracle/install directory. If you aren’t sure how to move files, try downloading and installing WinSCP. It connects over the same port you are using to SSH in with PuTTY, but can perform SFTP file transfers.
Once the files are in the /u01/oracle/install directory, unzip them to /u01/oracle/install/database and /u01/oracle/install/companion:
unzip 10201_companion_linux32.zip
unzip 10201_database_linux32.zip

When you are done, you should have a “companion” and “database” directory in the “/u01/oracle/install” directory.
Snapshot
Now is another great time to go back into VMWare Workstation and take another snapshot, prior to beginning the install of Oracle.
Install X-Windows environment for Windows
Go to Xming and download Xming XServer and the Xming Fonts. Note: the fonts are extremely important. Without installing the fonts, the Oracle DBCA will not work correctly.
Install Xming fonts first.
Install Xming server. In the “Select Components” screen, select “Don’t install an SSH Client”. At the end, select “Create a Quick Launch Icon for XLaunch”.
Run XLaunch selecting all of the defaults, with one exception. On the screen marked “Specify parameter settings”, check off “No Access Control”.
Xming Server should now be running, you will see the “X” in the Windows tray.
You need to set the default display variable for that session to point to your computer. Then you need to add your Windows machine to the xhost access control list for that session. On the Ubuntu box type in the following, replacing the IP address below with the IP address of your Windows machine:
DISPLAY=192.168.1.131:0.0; export DISPLAY
xhost +192.168.1.131
Execute the following to bring up the Oracle installer:
/u01/oracle/install/database/runInstaller

Select “Advanced Installation” and click “Next”.

Change the inventory directory to the one we created earlier and then click “Next”. Leave the group name as “oinstall”.

Select your installation type and click “Next”. I am selecting Standard Edition.

Specify your home directory name and path. If all goes well you shouldn’t have to edit anything here. I’d recommend keeping the home name as “OraDb10g_home1″. Make sure the path is the same one we set up earlier, or enter “/u01/oracle/db/10g/”.

Make your life easier and select Create A Database. This will create a default database (orcl) which will probably be all you will need for a while.

Select a database configuration. I am selecting General Purpose.

Leave the Global Database Name and SID as “orcl”. Change your character set if you need to, and check of “Create database with sample schemas” if you want the “SCOTT” schema with the table “EMP” and “DEPT”. Click “Next”.

Leave “Use Database Control for Database Management” checked and click “Next”.

Select “File System”, and in Specify Database file location type in the path we set up earlier, “/u02/oracle/data”. Click “Next”.

I’m opting to enable Automated Backups. I’ve selected File System, and for the Recovery Area location, I’ve typed in the directory we selected earlier (“/u03/oracle/backup”). I’ve entered the oracle user’s username and password to perform the backup job, but you can enter a different ID. The user you enter will need +RW access to /u02 and /u03 as well as execute access to items in /u01. I would suggest making this user a member of the “dba” or “oinstall” group. When finished, click “Next”.

Specify database schema passwords. Unless you have strict security requirements, make your life esaier and select “Use the same password for all the accounts”. You can always change the passwords later. Enter and Confirm a Password, and then click “Next”.

Get to the summary screen, review, and click “Install”.
The installer will take a few minutes. You should get through it without any issues. When you are done, you will see this screen first with the Database Configuration Assistant (DBCA) completes:

Select “OK”.

Eventually, you will get to this screen where you will need to run the last of these scripts. Go back to your bash window, su to the user id you originally created (not oracle – the user that is part of the sudo group) and enter the following commands then type “exit” to go back to the oracle user’s shell.
sudo /u01/oracle/inventory/orainstRoot.sh
sudo /u01/oracle/db/10g/root.sh
Select “OK” when done, and then you will get to the final screen of the installer:

Jot down these URLs, then click “Exit”, and we are done with the Oracle database 10g server install.
In your terminal window, you may have noticed warning messages that look like the following. Ignore these messages – they appear as a result of installing on a non-official platform.
rpm: To install rpm packages on Debian systems, use alien. See README.Debian.
error: cannot open Packages index using db3 – No such file or directory (2)
error: cannot open Packages database in /var/lib/rpm
rpm: To install rpm packages on Debian systems, use alien. See README.Debian.
error: cannot open Packages index using db3 – No such file or directory (2)
error: cannot open Packages database in /var/lib/rpm
Bug Fixes
Lastly, fix a bug in the Oracle dbstart startup script. Run the following command as your “user” account:
sudo vi /u01/oracle/db/10g/bin/dbstart
Find the following line near line 78:
ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle
Change it to this:
ORACLE_HOME_LISTNER=$ORACLE_HOME
Snapshot
Now is a great time to make another VM snapshot of your current server state.
Install Http Server
Now, let’s move forward and install Http Server as well. We’ll start by running the installer as the oracle user:
/u01/oracle/install/companion/runInstaller

Click “Next”.

Select “Oracle Database Companion Products 10.2.0.1.0″ and then click “Next”.

When you install Http server, you need to create an entirely separate Oracle Home – separate from the directory and name used to install 10g database server. Use the convention and directory structure we created before, changing the Name to “OraHttp10g_home1″ and the path to “/u01/oracle/http/10g”. Click “Next”.

Select “Apache Standalone 10.1.2.0.0″ and click “Next”.

Review the summary, and click “Install”.

Run the following script after running su as the original username you created (user that has sudo privileges). When done, click “OK”.
sudo /u01/oracle/http/10g/root.sh
You should see the following on the screen – answer the defaults for everything:


Review the “End of Installation” screen, jotting down URLs if you need to. Then click “Exit”.
Again, in your terminal window, you may have noticed warning messages that look like the following. Ignore these messages – they appear as a result of installing on a non-official platform.
rpm: To install rpm packages on Debian systems, use alien. See README.Debian.
error: cannot open Packages index using db3 – No such file or directory (2)
error: cannot open Packages database in /var/lib/rpm
rpm: To install rpm packages on Debian systems, use alien. See README.Debian.
error: cannot open Packages index using db3 – No such file or directory (2)
error: cannot open Packages database in /var/lib/rpm
Congratulations, Oracle Database and Http Server are now both successfully installed and running. Now, let's automate their startup.
Automating the startup of Oracle
We’re going to change slightly a script from Graham William’s guide. We will want to automatically start-up oracle, the listeners, enterprise manager console, and oracle http server.
First, edit the /etc/oratab file. The format of this file is like this:
SID:ORACLE_HOME:AUTO_START
As your sudo access user, run “sudo vi /etc/oratab”. Put a Y in the AUTO_START field of the databases you want to start automatically, and a N for the ones you don’t. Your file should look like this when you are done (if you followed the steps above):

Create the init.d script
Now we need to create the startup script. Run the following command as your “user” account to create a startup script called “oracle” in /etc/init.d:
sudo vi /etc/init.d/oracle
Copy and paste or retype the following lines (or upload this file via WinSCP). I’ve borrowed from a typical example and customized slightly to start the Listener, DB Server, Enterprise Management Console, and HTTP Server and made it look a little nicer for startup with Ubuntu Server. There is plenty of room for improvement here, this is simple a basic script:
#!/bin/bash
#
# /etc/init.d/oracle
#
# Run-level Startup script for the Oracle Listener, Instances, EM DB Console, and HTTP Server# It relies on the information on /etc/oratab
ORACLE_BASE=/u01/oracle
ORACLE_HOME=$ORACLE_BASE/db/10g
ORACLE_HTTPSERVER_HOME=$ORACLE_BASE/http/10g
APEX_HOME=$ORACLE_BASE/install/apex
ORACLE_OWNR=oracle
ORACLE_SID=orcl
ORATAB=/etc/oratabLD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_BASE ORACLE_HOME ORACLE_HTTPSERVER_HOME APEX_HOME ORACLE_OWNR ORACLE_SID ORATAB LD_LIBRARY_PATH
PATH=${PATH}:$ORACLE_HOME/bin
if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
then
echo " * Oracle startup error: cannot start"
exit 1
fi
case "$1" in
start)
# Startup
echo -n " * Starting the Oracle listener... "
su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl start"
echo " [ OK ]"
echo -n " * Starting the Oracle database server... "
su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
echo " [ OK ]"
echo -n " * Starting the Enterprise Manager DB Console... "
su $ORACLE_OWNR -c "$ORACLE_HOME/bin/emctl start dbconsole"
echo " [ OK ]"
echo -n " * Starting iSQL*Plus... "
su $ORACLE_OWNR -c "$ORACLE_HOME/bin/isqlplusctl start"
echo " [ OK ]"
echo -n " * Starting Oracle HTTP Server... "
su $ORACLE_OWNR -c "$ORACLE_HTTPSERVER_HOME/opmn/bin/opmnctl startall"
echo " [ OK ]"
touch /var/lock/oracle
;;
stop)
# Shutdown
echo -n " * Shutting down Oracle HTTP Server... "
su $ORACLE_OWNR -c "$ORACLE_HTTPSERVER_HOME/opmn/bin/opmnctl stopall"
echo " [ OK ]"
echo -n " * Shutting down iSQL*Plus... "
su $ORACLE_OWNR -c "$ORACLE_HOME/bin/isqlplusctl stop"
echo " [ OK ]"
echo -n " * Shutting down the Enterprise Manager DB Console... "
su $ORACLE_OWNR -c "$ORACLE_HOME/bin/emctl stop dbconsole"
echo " [ OK ]"
echo -n " * Shutting down the Oracle database server... "
su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
echo " [ OK ]"
echo -n " * Shutting down the Oracle listener... "
su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop"
echo " [ OK ]"
rm -f /var/lock/oracle
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: `basename $0` start|stop|restart"
exit 1
esac
exit 0
In that same command window, run chown and chmod on that script to make it owned by root, and executable:
sudo chown root:root /etc/init.d/oracle
sudo chmod a+x /etc/init.d/oracle
To have this script run automatically at boot, shutdown and restart, issue the following command as your “user” account.
sudo update-rc.d oracle defaults 99
You will see a message come back like this. The script configures all run-states to run this script:
Adding system startup for /etc/init.d/oracle ...
/etc/rc0.d/K99oracle -> ../init.d/oracle
/etc/rc1.d/K99oracle -> ../init.d/oracle
/etc/rc6.d/K99oracle -> ../init.d/oracle
/etc/rc2.d/S99oracle -> ../init.d/oracle
/etc/rc3.d/S99oracle -> ../init.d/oracle
/etc/rc4.d/S99oracle -> ../init.d/oracle
/etc/rc5.d/S99oracle -> ../init.d/oracle
Automation is complete! Try issuing a reboot command to test the automatic startup.
sudo reboot
Installing and Configuring APEX
Download the version of APEX you need from Oracle’s site. Expand the zip file in the /u01/oracle/install directory. You should have a directory now called /u01/oracle/install/apex:

Change directory into /u01/oracle/install/apex:
cd /u01/oracle/install/apex
If you do not have the package rlwrap installed, su in as your “user” account, and run:
sudo apt-get install rlwrap
Then, run sqlplus as oracle:
rlwrap sqlplus / as sysdba
Run apexins.sql passing the following five arguments in the order shown:
@apexins tablespace_apex tablespace_files tablespace_temp images
Where:
- tablespace_apex is the name of the tablespace for the Oracle Application
Express application user.
- tablespace_files is the name of the tablespace for the Oracle Application
Express files user.
- tablespace_temp is the name of the temporary tablespace.
- images is the virtual directory for Oracle Application Express images. To support future Oracle Application Express upgrades, define the virtual image directory as /i/.
Run the following:
@apexins SYSAUX SYSAUX TEMP /i/
Wait for all scripts to complete. This may take several minutes…
Run sqlplus again:
rlwrap sqlplus / as sysdba
Execute the following and then enter a password for the APEX ADMIN account when prompted:
@apxchpwd
- password is the password for the Oracle Application Express admin
account, the Application Express schema owner, and the Application Express
files schema owner.
The Application Express schema owner is the user or schema into which
Oracle Application Express database objects will be installed. The Application
Express files schema owner is the user or schema where uploaded files are
maintained in Oracle Application Express.
In sqlplus, execute the following to disable XML DB HTTP Server:
EXEC DBMS_XDB.SETHTTPPORT(0);
Unlock the APEX_PUBLIC_USER account by executing the following SQL statement:
ALTER USER APEX_PUBLIC_USER ACCOUNT UNLOCK;
Change the password for the APEX_PUBLIC_USER account by executing the following SQL statement, where “password” is the new password:
ALTER USER APEX_PUBLIC_USER IDENTIFIED BY password;
Type exit to exit SQLPlus.
Copy images to Apache HTTP Server:
cp -rf $APEX_HOME/images/* $ORACLE_HTTPSERVER_HOME/Apache/Apache/htdocs/ohs_images
Edit dads.conf:
vi $ORACLE_HTTPSERVER_HOME/Apache/modplsql/conf/dads.conf
Add in the following (replacing “password” with the password you selected for the APEX ADMIN user):
Alias /i/ "/u01/oracle/http/10g/Apache/Apache/htdocs/ohs_images/"
AddType text/xml xbl
AddType text/x-component htc
< Location /pls/apex >
Order deny,allow
PlsqlDocumentPath docs
AllowOverride None
PlsqlDocumentProcedure wwv_flow_file_mgr.process_download
PlsqlDatabaseConnectString ubuntu.localdomain:1521:orcl ServiceNameFormat
PlsqlNLSLanguage AMERICAN_AMERICA.AL32UTF8
PlsqlAuthenticationMode Basic
SetHandler pls_handler
PlsqlDocumentTablename wwv_flow_file_objects$
PlsqlDatabaseUsername APEX_PUBLIC_USER
PlsqlDefaultPage apex
PlsqlDatabasePassword password
Allow from all
</Location>
Stop and Start Oracle Http Server:
$ORACLE_HTTPSERVER_HOME/opmn/bin/opmnctl stopproc ias-component=HTTP_Server
$ORACLE_HTTPSERVER_HOME/opmn/bin/opmnctl startproc ias-component=HTTP_Server
You can now login to the APEX Admin via:
http://ubuntu.localhost:7777/pls/apex/apex_admin with credentials of admin and the password you selected, and continue configuration.
Import URLs to consider once we are done:
iSQL*Plus URL:
- http://ubuntu.localdomain:5560/isqlplus
iSQL*Plus DBA URL:
- http://ubuntu.localdomain:5560/isqlplus/dba
Enterprise Manager 10g Database Control URL:
- http://ubuntu.localdomain:1158/em
Oracle HTTP Server Welcome Page:
- http://ubuntu.localdomain:7777
Oracle Application Express:
- http://ubuntu.localhost:7777/pls/apex
Oracle Application Express Administration Services:
- http://ubuntu.localhost:7777/pls/apex/apex_admin
0.000000
0.000000