Oracle 11gR2 on Ubuntu 10.04
The purpose of the complete install guide below is to have a fully functioning oracle 11gR2 client and software to run local database instances on Ubuntu 10.04. (UPDATE: I have confirmed this install guide works exactly as below for Ubuntu 10.10) There are some details of the Oracle installation on Linux guide that I have not mentioned in this document, because I have verifed this version of Ubuntu to already meet certain qualifications that don’t need to be changed.
Below is the list of required packages according to the 11gr2 install docs:
binutils-2.15.92.0.2 compat-libstdc++-33-3.2.3 elfutils-libelf-0.97 elfutils-libelf-devel-0.97 gcc-3.4.6 gcc-c++-3.4.6 glibc-2.3.4-2.41 glibc-common-2.3.4 glibc-devel-2.3.4 glibc-headers-2.3.4 libaio-devel-0.3.105 libaio-0.3.105 libgcc-3.4.6 libstdc++-3.4.6 libstdc++-devel-3.4.6 make-3.80 numactl-0.6.4.i386 pdksh-5.2.14 sysstat-5.0.5 unixODBC-2.2.11 unixODBC-devel-2.2.11
Here is the list of packages that I installed. Some packages from above were already installed, and some were not even available. The ones not available, I just ignored and after extensive testing, all seems to run fine.
NOTE: all commands below are ran as root (sudo su -) until “su – oracle”
apt-get install elfutils apt-get install libaio1 apt-get install libaio-dev apt-get install libstdc++6-4.4-dev apt-get install numactl apt-get install pdksh apt-get install sysstat apt-get install unixODBC-dev apt-get install unixODBC
This will add the minimum installation group that will own the oracle software, create the oracle user, and allow the oracle user to run x sessions locally so you don’t have to login and logout for any of this installation. You may want to add your “normal” user to the oinstall group later.
groupadd oinstall useradd -s /bin/bash -m -g oinstall oracle passwd oracle xhost local:oracle
The next two pieces of work will change various kernel settings and limits to be able to run database instances locally if you desire.
cp /etc/security/limits.conf /etc/security/limits.conf.bak cat >> /etc/security/limits.conf oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 <Ctrl-C>
cp /etc/sysctl.conf /etc/sysctl.conf.bak cat >> /etc/sysctl.conf fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 2097152 kernel.shmmax = 536870912 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 net.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048586 net.ipv4.tcp_wmem = 262144 262144 262144 net.ipv4.tcp_rmem = 4194304 4194304 4194304 <Ctrl-C>
/sbin/sysctl -p
The below directories are the Oracle recommended Optimal Flexible Architecture (besides all the separation of physical devices)
mkdir -p /u01/app/oracle chown -R oracle:oinstall /u01/app/oracle chmod -R 775 /u01/app/oracle mkdir -p /u01/app/oraInventory chown -R oracle:oinstall /u01/app/oraInventory chmod -R 775 /u01/app/oraInventory
ln -s /usr/bin/awk /bin/awk <-- this was so the root.sh script doesn't fail when trying to find awk
At this point you should have downloaded the two huge zip files from Oracle’s download page:
mv /home/michael/Downloads/linux_11gR2_database_* /home/oracle/ su - oracle unzip linux_11gR2_database_1of2.zip rm linux_11gR2_database_1of2.zip unzip linux_11gR2_database_2of2.zip rm linux_11gR2_database_2of2.zip
Here is the where the actual installation begins. You will get a nice GUI for this part.
cd database ./runInstaller
On the successive list of screens, select the following to install the database software without creating a test database.
"Install database software only" "Single instance database installation" "Enterprise Edition" Oracle Base: "/u01/app/oracle" Software Location: "/u01/app/oracle/product/11.2.0/dbhome_1" Inventory Directory "/u01/app/oraInventory" oraInventory Group Name "oinstall" Database Administrator Group "oinstall" Database Operator Group "oinstall"
A list of prerequisites that are failed will be shown on the screen. I reviewed them and selected “Ignore All” since I verified all the packages were indeed available.
During the install there were a handful of errors about linking such as:
“Error in invoking target ‘idg4odbc’ of makefile ‘/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ins_rdbms.mk’.”
“Error in invoking target ‘idg4odbc’ of makefile ‘/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ins_rdbms.mk’.”
“Error in invoking target ‘install’ of makefile ‘/u01/app/oracle/product/11.2.0/dbhome_1/ctx/lib/ins_ctx.mk’.”
“Error in invoking target ‘all_no_orcl’ of makefile ‘/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ins_rdbms.mk’.
“Error in invoking target ‘utilities’ of makefile ‘/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ins_rdbms.mk’.”
I was able to “Continue” past these errors and complete the installation and creation of database without anymore issues. I read a little bit online about some people having these errors and their GUI tools such as DBCA and Universal Installer not working normally, but I have tested the tools that I use and they seem to be fine.
After the install I placed the following lines in the /etc/profile to ensure the ORACLE_* environment variables get set properly after login for any local users:
export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1 export PATH=$PATH:$ORACLE_HOME/bin
At this point, I moved some known *.ora files into the $ORACLE_HOME/network/admin directory to skip the tns setup
From here you should be able to use the oracle client tools to connect to existing databases on your network. Also, I was able to create an 11gR2 database instance locally without any more system changes, besides the normal instructions for creating an instance from the Oracle documentation.
nice~ this is helpful
steven
July 25, 2010 at 2:02 pm
This was exactly what I was looking for last few days. Installation went smooth as per the artical.
I have only two issues now. I wants to know how to add oracle to sudoers file and it seems I can’t open it for editing. I tried visudo sudoers, but it wants one of the flags like -c, -f. None of those flags seems to help me to update the file. Please let me have the command to add oracle to sudoers file.
Other issue is, I can’t run netca, it says command not found.
One more issue, it seems like the path variables like ORACLE_BASE doesn’t stick, meaning when I open a new terminal and env, the settings are gone.
Hope you will have few minutes to help me. Anyway, As I said, this was the guide that helped me install oracle.
Thanks,
SUjith
Sujith
October 12, 2010 at 4:52 am
After setting path variables on the terminal for the user oracle, I was able to start netca and also login to the db with no issues.
So, I need to know how to add the path variables to profile so that I don’t have to set them every time.
Thanks,
Sujith
Sujith
October 12, 2010 at 9:51 am
To set the variables all the time, I put them in my /etc/profile and they get used by all logins
sys
October 12, 2010 at 10:39 am
Got it. I opened it in gedit and had no issues this time. Thanks a lot for your article.
Sujith
Sujith
October 12, 2010 at 10:47 am
[...] I have confirmed that the exact steps for my previous posting for Ubuntu 10.04 work for 10.10. You can find the link here: Oracle 11gR2 on Ubuntu 10.04 [...]
Oracle 11gR2 on Ubuntu 10.10 « I am SYS
November 16, 2010 at 12:26 pm