Installing Oracle Database 11g on Linux (…well, Solaris)
Lets look at setting up the Oracle Database 11g on Linux:
http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/11g/r1/prod/install/dbinst/dbinst.htm
On step #1, we see the text, “Checking operating system version: must be redhat-3, SuSE-9, redhat—4, UnitedLinux-l.O, asianux-1 or asianux—2.” I think I’ll opt for a different OS and go a little off script here. And since we’re working with Oracle in the first place, why not go with Oracle Solaris? This led me to the Oracle Solaris 11 Express 2010.11 VM (http://www.oracle.com/technetwork/server-storage/solaris11/downloads/index.html) for Oracle VM VirtualBox (http://www.oracle.com/technetwork/server-storage/virtualbox/downloads/index.html).
Configuring networking was a little confusing. If you have VirtualBox configured with NAT, you’ll see that the default gateway is 10.0.2.2 and dns 10.0.2.3. When you start the VM, the Network Auto-Magic will start with dhcp and assign an IP such as 10.0.2.15. I’d rather have a static IP within the subnet of my LAN. To fix the subnet issue, I configured VirtualBox networking to run in bridge mode with the proper physical interface. Then after starting Solaris, DHCP is still enabled, but I’m getting an address within my LAN. Next a few commands are necessary to setup a static IP. Networking references that are useful are http://download.oracle.com/docs/cd/E19963-01/html/821-1458/gjbmq.html#scrolltoc and http://www.pouwiel.com/?p=2085
oracle@solaris:~$ netstat -r Routing Table: IPv4 Destination Gateway Flags Ref Use Interface -------------------- -------------------- ----- ----- ---------- --------- default 192.168.0.1 UG 1 0 e1000g0 solaris solaris UH 3 232 lo0 192.168.0.0 192.168.0.6 U 3 3 e1000g0 Routing Table: IPv6 Destination/Mask Gateway Flags Ref Use If --------------------------- --------------------------- ----- --- ------- ----- solaris solaris UH 2 88 lo0 fe80::/10 fe80::a00:27ff:fe79:aeec U 2 0 e1000g0 oracle@solaris:~$ cat /etc/resolv.conf nameserver 192.168.0.1 oracle@solaris:~$ su Password: oracle@solaris:~# svcadm disable network/physical:nwam oracle@solaris:~# svcadm enable network/physical:default oracle@solaris:~# ipadm create-if e1000g0 oracle@solaris:~# ipadm create-addr -T static -a 192.168.0.15/24 e1000g0/v4 oracle@solaris:~# ping google.com ping: sendto No route to host
We can fix the routing issue with the help of this documentation page:
http://download.oracle.com/docs/cd/E19253-01/816-5166/route-1m/index.html Note that the -p switch persists the route.
oracle@solaris:~# route -p add default 192.168.0.1 add net default: gateway 192.168.0.1 add persistent net default: gateway 192.168.0.1 oracle@solaris:~# ping google.com google.com is alive oracle@solaris:~#
Networking is now configured within the LAN subnet with a static IP address. As far as the virtual hard drive that is included with the image, there’s only one disk that’s dynamically expanding up to 20GB. There’s 14.5GB free space that can be used. We’ll be installing the database later on, so I added an additional virtual hard drive that’s dynamically expanding up to 100GB. I won’t get close to using that much space, but it’s nice to have a little breathing room with dynamically expanding drives. To do that, I shutdown Solaris, created a new virtual disk image (.vdi) within VirtualBox, and then started Solaris. From here, I logged into the terminal, and issued the following commands:
oracle@solaris:~# devfsadm oracle@solaris:~# format Searching for disks... Failed to inquiry this logical diskFailed to inquiry this logical diskdone AVAILABLE DISK SELECTIONS: 0. c7d0 /pci@0,0/pci-ide@1,1/ide@0/cmdk@0,0 1. c8d0 /pci@0,0/pci-ide@1,1/ide@1/cmdk@0,0 Specify disk (enter its number): 1 selecting c8d0 Controller working list found [disk formatted, defect list found] No Solaris fdisk partition found. FORMAT MENU: disk - select a disk type - select (define) a disk type partition - select (define) a partition table current - describe the current disk format - format and analyze the disk fdisk - run the fdisk program repair - repair a defective sector show - translate a disk address label - write label to the disk analyze - surface analysis defect - defect list management backup - search for backup labels verify - read and display labels save - save new disk/partition definitions volname - set 8-character volume name ! - execute , then return quit format> quit oracle@solaris:~# zpool create app /dev/dsk/c8d0 oracle@solaris:~# zpool list NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT app 99.5G 112K 99.5G 0% 1.00x ONLINE - rpool 19.9G 4.25G 15.6G 21% 1.00x ONLINE - oracle@solaris:~# chown -R oracle /app
So now that we’ve got something to work with, lets get to the installation of the database.
The OBE is rather old being that it’s geared for Database 11.1. I’d rather not install 11.1 when 11.2 is available. So I downloaded the 11.2.0.1.0 media for Solaris (x86 -64) from the download page (http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html). After extracting the .zip files and running the installer, I hit a nasty exception:
oracle@solaris:~/Downloads/database$ ./runInstaller Starting Oracle Universal Installer... Checking Temp space: must be greater than 180 MB. Actual 894 MB Passed Checking swap space: must be greater than 150 MB. Actual 1221 MB Passed Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed Preparing to launch Oracle Universal Installer from /tmp/OraInstall2011-06-06_06-18-33AM. Please wait ...oracle@solaris:~/Downloads/database$ Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/OraInstall2011-06-06_06-18-33AM/jdk/jre/lib/amd64/motif21/libmawt.so: ld.so.1: java: fatal: libXm.so.4: open failed: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1647) at java.lang.Runtime.load0(Runtime.java:769) at java.lang.System.load(System.java:968) at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50) at java.security.AccessController.doPrivileged(Native Method) at java.awt.Toolkit.loadLibraries(Toolkit.java:1509) at java.awt.Toolkit.(Toolkit.java:1530) at com.jgoodies.looks.LookUtils.isLowResolution(Unknown Source) at com.jgoodies.looks.LookUtils.(Unknown Source) at com.jgoodies.looks.plastic.PlasticLookAndFeel.(PlasticLookAndFeel.java:122) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:242) at javax.swing.SwingUtilities.loadSystemClass(SwingUtilities.java:1783) at javax.swing.UIManager.setLookAndFeel(UIManager.java:480) at oracle.install.commons.util.Application.startup(Application.java:758) at oracle.install.commons.flow.FlowApplication.startup(FlowApplication.java:164) at oracle.install.commons.flow.FlowApplication.startup(FlowApplication.java:181) at oracle.install.commons.base.driver.common.Installer.startup(Installer.java:265) at oracle.install.ivw.db.driver.DBInstaller.startup(DBInstaller.java:114) at oracle.install.ivw.db.driver.DBInstaller.main(DBInstaller.java:132)
Great, now what?! Luckily, I found this post which indicates that a few additional packages are needed before the install will be able to proceed. After installing them, the installation started as expected.
pfexec pkg install SUNWarc pfexec pkg install SUNWctpls pfexec pkg install SUNWhea pfexec pkg install SUNWmfrun pfexec pkg install SUNWscp pfexec pkg install SUNWswmt
When getting into the installation, I ran into an Oracle error, “ORA-27102: out of memory”. The cause of this is related to available privileged memory versus memory allocated to Oracle.
I found this article useful, section 4.1.1: http://download.oracle.com/docs/cd/E11882_01/relnotes.112/e16779/toc.htm, as well as this forum post which helped clarify memory issues: http://forums.oracle.com/forums/thread.jspa?threadID=375567
The prctl command dynamically updates privileged memory, the projadd command persists the update. On a system with 4GB ram, by default, 1GB ram is available for use by the Oracle database. By default the database installer allocates 40% of available ram to the database. For the 4GB system, that would be a little more than 1.5GB. Since only 1GB is allocated as privileged, and the database needs 1.5GB, we hit the error. This can be avoided by increasing the privileged allocation to somewhere around 50% of total ram. In this case, I increased it to 2GB.
oracle@solaris:~$ prctl -n project.max-shm-memory -i process $$ process: 954: bash NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT project.max-shm-memory privileged 1022MB - deny - system 16.0EB max deny - oracle@solaris:~$ su Password: oracle@solaris:~# oracle@solaris:~# prctl -n project.max-shm-memory -r -v 2G -i project 3 oracle@solaris:~# exit exit oracle@solaris:~$ prctl -n project.max-shm-memory -i process $$ process: 954: bash NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT project.max-shm-memory privileged 2.00GB - deny - system 16.0EB max deny - oracle@solaris:~$ su Password: oracle@solaris:~# projadd -U oracle -K "project.max-shm-memory=(priv,2G,deny)" user.oracle
Now I’m finally able to install the database.
I slightly varied from the standards with the installation path. For more information about the Oracle Flexible Architecture (OFA) standardized guidelines, see http://download.oracle.com/docs/cd/E11882_01/install.112/e17163/appendix_ofa.htm#BABHAIIJ.
