Oracle 11gR2 Express Edition

  • apt-get install alien libaio1 unixodbc

  • grep Swap /proc/meminfo should be at least 2095100 KB

  • configure the linux kernel

cat > /etc/sysctl.d/60-oracle.conf <<-EOF
# Oracle 11g XE kernel parameters
fs.file-max=6815744
net.ipv4.ip_local_port_range=9000 65500
kernel.sem=250 32000 100 128
# kernel.shmmax=429496729
kernel.shmmax=107374183
EOF
service procps start
sysctl -q fs.file-max
sysctl -q kernel.shmmax # =memory_target
sysctl -q net.ipv4.ip_local_port_range
sysctl -q kernel.sem
  • dd if=/dev/zero of=/home/oracle-11g-xe.img bs=1 count=0 seek=18G &&mkfs.ext3 -L oraclexe /home/oracle-11g-xe.img

  • echo "/home/oracle-11g-xe.img /u01 ext3 errors=remount-ro,noatime 0 0" >> /etc/fstab && mount /u01

  • echo "shmfs /dev/shm tmpfs defaults,nosuid,nodev,noexec,relatime,size=2097152k 0 0" >> /etc/fstab && mount /dev/shm

    • to disable AMM (Automatic Memory Management) and use ASMM (Automatic Shared Memory Management) without /dev/shm set memory_target=0 in /u01/app/oracle/product/11.2.0/xe/config/scripts/init.ora and /u01/app/oracle/product/11.2.0/xe/config/scripts/initXETemp.ora
  • download oracle-xe-11.2.0-1.0.x86_64.rpm.zip from Oracle XE download page

  • unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip && rm oracle-xe-11.2.0-1.0.x86_64.rpm.zip

  • alien --to-deb --scripts ./Disk1/oracle-xe-11.2.0-1.0.x86_64.rpm && rm ./Disk1/oracle-xe-11.2.0-1.0.x86_64.rpm

  • ln -s /usr/bin/awk /bin/awk; mkdir -p /var/lock/subsys

  • add missing chkconfig script

cat > /sbin/chkconfig <<-EOF
#!/bin/bash
# Oracle 11gR2 XE installer chkconfig hack for Debian based Linux (by dude)
# Only run once.
echo "Simulating /sbin/chkconfig..."
if [ ! \`tail -n1 /etc/init.d/oracle-xe | grep INIT\` ]; then
cat >> /etc/init.d/oracle-xe <<-EOM
#
### BEGIN INIT INFO
# Provides: OracleXE
# Required-Start: \\\$remote_fs \\\$syslog
# Required-Stop: \\\$remote_fs \\\$syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Oracle 11g Express Edition
### END INIT INFO
EOM
fi
update-rc.d oracle-xe defaults 80 01
EOF
chmod 755 /sbin/chkconfig
  1. dpkg --install ./oracle-xe_11.2.0-2_amd64.deb
  2. ln -s /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh /etc/profile.d
  3. sudo /etc/init.d/oracle-xe configure
  4. su -s /bin/bash -c 'echo "exec dbms_xdb.setListenerLocalAccess(false);" | /u01/app/oracle/product/11.2.0/xe/bin/sqlplus / as sysdba' oracle

Start/Stop Database

  • start
    1. su -s /bin/bash -c '/u01/app/oracle/product/11.2.0/xe/bin/lsnrctl start' oracle
    2. su -s /bin/bash -c '/u01/app/oracle/product/11.2.0/xe/bin/sqlplus -s /nolog @/u01/app/oracle/product/11.2.0/xe/config/scripts/startdb.sql' oracle
  • stop
    1. su -s /bin/bash -c '/u01/app/oracle/product/11.2.0/xe/bin/sqlplus -s /nolog @/u01/app/oracle/product/11.2.0/xe/config/scripts/stopdb.sql' oracle
    2. su -s /bin/bash -c '/u01/app/oracle/product/11.2.0/xe/bin/lsnrctl stop' oracle
  • ps U oracle

Administration Interface

  • Apex with workspace “interna”, login “admin”, and password as it has been set during the configuration
  • Apex Admin with login “admin” and password as it has been set during the configuration
  • to reset Apex admin passwords execute su -s /bin/bash -c 'echo "@?/apex/apxxepwd.sql" | /u01/app/oracle/product/11.2.0/xe/bin/sqlplus / as sysdba' oracle
  • to set “sys” or “system” passwords execute su -s /bin/bash -c 'echo "alter user sys identified by \"password\" account unlock; alter user system identified by \"password\" account unlock;" | /u01/app/oracle/product/11.2.0/xe/bin/sqlplus / as sysdba' oracle

 Share!

 
comments powered by Disqus