Escolar Documentos
Profissional Documentos
Cultura Documentos
04 HOWTO
Submitted by hswong3i on Sat, 2012-04-28 10:37 This HOWTO will guide you though installation of Oracle Database 11g Release 2 on Ubuntu 12.04. Before start I will assume you have a clean Ubuntu Server 12.04 installed with minimal packages requirement. It is strongly recommend to install on a new host, as it will modify a lot of default settings ;-)
In case you are NOT using remote X11 with SSH so local GUI is required, install additional packages as below:
tasksel install lubuntu-core
Once everything get ready you may start the GUI and test with:
startx
search localdomain
In case of using OpenStack VM, default search domain assigned by DHCP would be "novalocal"; therefore we need to update /etc/dhcp/dhclient.conf as below:
supersede domain-name "localdomain"; supersede domain-search "localdomain", "novalocal";
Running /etc/init.d/hostname.sh (or simply reboot your Ubuntu), then test the hostname of system with:
hostname
Ok up to this point your Ubuntu 12.04 should basically configure for installing Oracle 11gR2.
On the other hand, it is suggest to have swap with 1.5 time of your physical memory, e.g. around 2GB. Check it with:
grep SwapTotal /proc/meminfo
In case I am using libvirt + KVM VM client, I don't hope to create swap partition by default or else if all VMs are running out of resourse they will all keep on swapping to harddisk and finally all gone... Here I will create a temperate swap file and activate it during installation; once reboot it will gone automatically (or manually disable it with swapoff /tmp/swap):
dd if=/dev/zero of=/tmp/swap bs=1M count=4096 chmod 600 /tmp/swap mkswap /tmp/swap swapon /tmp/swap grep SwapTotal /proc/meminfo
Shared memory is very important, too. Or else you may face the ORA-00845 error message. First check it with:
df -kh /dev/shm/
If you have less than 512MB (I will suggest for 1GB), edit your /etc/fstab and add/modify the following line:
tmpfs /dev/shm tmpfs defaults,size=1024M 0 0
Most likely, you should run the following command for create the required system groups and users. Latest Ubuntu already come with user nobody so we don't need to retouch it:
addgroup --system oinstall addgroup --system dba useradd -r -g oinstall -G dba -m -s /bin/bash -d /var/lib/oracle oracle passwd oracle
-a -a -a -a -a -a -a -a
| | | | | | | |
umask 022 export ORACLE_HOSTNAME=localhost.localdomain export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1 export ORACLE_SID=AL32UTF8 export NLS_LANG=.AL32UTF8 export ORACLE_UNQNAME=AL32UTF8 unset TNS_ADMIN if [ -d "$ORACLE_HOME/bin" ]; then PATH="$ORACLE_HOME/bin:$PATH" fi
If you are using PuTTY + Xming, for sure that the X11 forward is enabled. Copy the file linux_11gR1_database.zip to oracle's home directory, then unzip it:
cp linux.x64_11gR2_database_1of2.zip /var/lib/oracle cp linux.x64_11gR2_database_2of2.zip /var/lib/oracle cd /var/lib/oracle unzip -q linux.x64_11gR2_database_1of2.zip unzip -q linux.x64_11gR2_database_2of2.zip chown -Rf oracle:oinstall /var/lib/oracle/
I will STRONGLY suggest for a complete reboot, and double-check ALL pre-installation BEFORE starting the next step.
Next we go though the installation (I don't have the "Oracle Support Password" so just skip in here):
In "System Class", choose "Server Class" (we hope to give a full control during installation):
Memory -> Enable Automatic Memory Management: TRUE Character sets: Use Unicode (AL32UTF8)
In "Specify Management Options", choose "Use Database Control for database management" but keep other else empty:
In "Specify Schema Passwords", I am a bit lazy so choose "Use the same password for all accounts" (don't do this in production server!):
Database Administrator (OSDBA) Group: dba Database Operator (OSOPER) Group: oinstall
In "Preform Prerequisite Checks", just simply ignore all warning message (since we are using Debian but not Oracle officially supported OS):
Oh it should that almost done! Special note for Ubuntu 12.04: If you face error during installation so update as below:
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 sed -i 's/^\(\s*\$(MK_EMAGENT_NMECTL)\)\s*$/\1 -lnnz11/g' $ORACLE_HOME/sysman/lib/ins_emagent.mk sed -i 's/^\(\$LD \$LD_RUNTIME\) \(\$LD_OPT\)/\1 -Wl,--no-as-needed \2/g' $ORACLE_HOME/bin/genorasdksh sed -i 's/^\(\s*\)\(\$(OCRLIBS_DEFAULT)\)/\1 -Wl,--no-as-needed \2/g' $ORACLE_HOME/srvm/lib/ins_srvm.mk
sed -i 's/^\(TNSLSNR_LINKLINE.*\$(TNSLSNR_OFILES)\) \(\$(LINKTTLIBS)\)/\1 -Wl,--no-as-needed \2/g' $ORACLE_HOME/network/lib/env_network.mk sed -i 's/^\(ORACLE_LINKLINE.*\$(ORACLE_LINKER)\) \(\$(PL_FLAGS)\)/\1 Wl,--no-as-needed \2/g' $ORACLE_HOME/rdbms/lib/env_rdbms.mk
Now following the instructions and run the following commands with "root" user:
/u01/app/oraInventory/orainstRoot.sh /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
Confirm with installation progress In previous screen the installer mentioned that we can access "Enterprise Manager Database Control URL - (AL32UTF8)" from https://localhost.localdomain:1158/em, so now let's open the browser and test it with following account:
#Optional : for Enterprise Manager software only su - $ORA_OWNR -c "$ORA_HOME/bin/emctl start dbconsole" touch /var/lock/oracle echo "OK" ;; stop) # Oracle listener and instance shutdown echo -n "Shutdown Oracle: " #Optional : for Enterprise Manager software only su - $ORA_OWNR -c "$ORA_HOME/bin/emctl stop dbconsole" su - $ORA_OWNR -c "$ORA_HOME/bin/lsnrctl stop" su - $ORA_OWNR -c "$ORA_HOME/bin/dbshut $ORA_HOME" rm -f /var/lock/oracle echo "OK" ;; reload|restart) $0 stop
Finally, install the script so Oracle will start during system bootup:
update-rc.d-insserv oracle defaults 99 01
NOTE: You may find the following error message during /etc/init.d/oracle/stop:
Shutdown Oracle: ulimit: 25: bad number
You can then update /u01/app/oracle/product/11.2.0/dbhome_1/bin/emctl with #!/bin/bash to solve the problem:
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 sed -i 's/^#!\/bin\/sh -f\s*/#!\/bin\/bash -f/g' $ORACLE_HOME/bin/emctl