|
9 years ago 1 |
Java (for SQL Developer and Oracle XE):
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java7-installer
$ java -version
$ sudo gedit /etc/bash.bashrc
Add this text (bold) to the end of the file:
export JAVA_HOME=/usr/lib/jvm/java-7-oracle
export PATH=$JAVA_HOME/bin:$PATH
(save)
$ source /etc/bash.bashrc
$ echo $JAVA_HOME
Oracle Database Express Edition 11g:
$ sudo apt-get install alien libaio1 unixodbc
$ cd Downloads (the folder name depends on your OS language, for english is "Downloads")
$ unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip (previously downloaded)
$ cd Disk1
$ sudo alien --scripts -d oracle-xe-11.2.0-1.0.x86_64.rpm
$ sudo gedit /sbin/chkconfig
Add this text (bold) to the end of the file (if the file is empty don't panic, it's ok ):
#!/bin/bash
# Oracle 11gR2 XE installer chkconfig hack for Ubuntu
file=/etc/init.d/oracle-xe
if [[ ! 'tail -n1 $file | grep INIT' ]]; then
echo >> $file
echo '### BEGIN INIT INFO' >> $file
echo '# Provides: OracleXE' >> $file
echo '# Required-Start: $remote_fs $syslog' >> $file
echo '# Required-Stop: $remote_fs $syslog' >> $file
echo '# Default-Start: 2 3 4 5' >> $file
echo '# Default-Stop: 0 1 6' >> $file
echo '# Short-Description: Oracle 11g Express Edition' >> $file
echo '### END INIT INFO' >> $file
fi
update-rc.d oracle-xe defaults 80 01
#EOF
(save)
$ sudo chmod 755 /sbin/chkconfig
$ sudo gedit /etc/sysctl.d/60-oracle.conf
Same goes here, add this text (bold):
# Oracle 11g XE kernel parameters
fs.file-max=6815744
net.ipv4.ip_local_port_range=9000 65000
kernel.sem=250 32000 100 128
kernel.shmmax=536870912
(save)
$ sudo cat /etc/sysctl.d/60-oracle.conf
$ sudo service procps start
$ sudo ln -s /usr/bin/awk /bin/awk
$ mkdir /var/lock/subsys
$ touch /var/lock/subsys/listener
$ sudo dpkg --install oracle-xe_11.2.0-2_amd64.deb
$ sudo rm -rf /dev/shm
$ sudo mkdir /dev/shm
$ sudo mount -t tmpfs shmfs -o size=2048m /dev/shm
$ sudo gedit /etc/rc2.d/S01shm_load
Add this text (bold) to the file:
#!/bin/sh
case "$1" in
start) mkdir /var/lock/subsys 2>/dev/null
touch /var/lock/subsys/listener
rm /dev/shm 2>/dev/null
mkdir /dev/shm 2>/dev/null
mount -t tmpfs shmfs -o size=2048m /dev/shm ;;
*) echo error
exit 1 ;;
esac
(save)
$ sudo chmod 755 /etc/rc2.d/S01shm_load
$ sudo gedit /etc/bash.bashrc
Add this text (bold) to the end of the file:
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
export ORACLE_SID=XE
export NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh`
export ORACLE_BASE=/u01/app/oracle
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export PATH=$ORACLE_HOME/bin:$PATH
(save)
$ source /etc/bash.bashrc
$ cd ..
$ sudo /etc/init.d/oracle-xe configure
SQL Developer:
$ sudo alien --scripts -d sqldeveloper-4.0.0.13.80-1.noarch.rpm (previously downloaded)
$ sudo dpkg --install sqldeveloper_4.0.0.13.80-2_all.deb
$ sudo mkdir /home/.sqldeveloper/
$ sudo /opt/sqldeveloper/sqldeveloper.sh
/usr/lib/jvm/java-7-oracle <- Use this if sqldeveloper asks you for the java directory
Apache:
$ sudo apt-get install aptitude
$ sudo aptitude install apache2 apache2.2-common apache2-mpm-prefork apache2-utils libexpat1 ssl-cert
$ sudo gedit /etc/apache2/apache2.conf
Add this text (bold) to the end of file:
ServerName db
(save)
$ sudo apache2ctl graceful
PHP:
$ sudo aptitude search php5-
$ sudo aptitude install libapache2-mod-php5 php5 php5-common php5-curl php5-dev php5-gd php5-imagick php5-mcrypt php5-memcache php5-mhash php5-mysql php5-pspell php5-snmp php5-sqlite php5-xmlrpc php5-xsl
$ sudo /etc/init.d/apache2 reload
OCI8 (Oracle drivers for PHP):
$ alien -i oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm (previously downloaded)
$ alien -i oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm (also previously downloaded)
$ sudo apt-get install libaio1
$ export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib/:$LD_LIBRARY_PATH
$ export ORACLE_HOME=/usr/lib/oracle/12.1/client64
$ export PATH=$PATH:$ORACLE_HOME/bin
$ sudo ln -s /usr/include/oracle/12.1/client64 $ORACLE_HOME/include
$ sudo pecl install oci8
$ sudo sh -c 'echo extension=oci8.so > /etc/php5/mods-available/oci8.ini'
$ sudo php5enmod oci8
$ sudo service apache2 reload
All done, use http://localhost/ to test it
No prob :)
Oracle XE 11g really works!
Thank you a lot!