sudo apt-get upgrade
sudo apt-get install gcc make binutils libaio1 gawk ksh libc6-dev rpm libmotif3 alien lsb-rpm libtool
sudo addgroup oinstall
sudo addgroup dba
sudo addgroup nobody
sudo usermod -g nobody nobody
sudo mkdir /home/oracle
sudo useradd -g oinstall -G dba -p password -d /home/oracle -s /bin/bash oracle
sudo passwd -l oracle
sudo chown -R oracle:oinstall /home/oracle
sudo ln -s /usr/bin/awk /bin/awk
sudo ln -s /usr/bin/rpm /bin/rpm
sudo ln -s /usr/bin/basename /bin/basename
sudo mkdir /etc/rc.d
for i in 0 1 2 3 4 5 6 S ; do sudo ln -s /etc/rc$i.d /etc/rc.d/rc$i.d ; done
sudo mkdir -p /u01/app/oracle
sudo chown -R oracle:oinstall /u01
The orginal kernel parameters can be found by running the following.
sudo /sbin/sysctl -a | grep kernel.sem
sudo /sbin/sysctl -a | grep kernel.shm
sudo /sbin/sysctl -a | grep file-max
sudo /sbin/sysctl -a | grep ip_local_port_range
sudo /sbin/sysctl -a | grep rmem_default
sudo /sbin/sysctl -a | grep rmem_max
sudo /sbin/sysctl -a | grep wmem_default
sudo /sbin/sysctl -a | grep wmem_max
The output of the above command returns
kernel.sem = 250 32000 32 128
kernel.shmmax = 33554432
kernel.shmall = 2097152
kernel.shmmni = 4096
fs.file-max = 794920
net.ipv4.ip_local_port_range = 32768 61000
net.core.rmem_default = 124928
net.core.rmem_max = 131071
net.core.wmem_default = 124928
net.core.wmem_max = 131071
change the kernel parameters if the setting found above is lower than the recommendation given in the following table.
shmmni | 4096 |
shmall | 2097152 |
shmmax | 2147483648 |
semmsl | 250 |
semmns | 32000 |
semopm | 100 |
semmni | 128 |
file-max | 65536 |
ip_local_port_range | 1024 - 65000 |
rmem_default | 1048576 |
rmem_max | 1048576 |
wmem_default | 262144 |
wmem_max | 262144 |
sudo cat >> /etc/sysctl.conf << EOF
kernel.shmmax = 2147483648
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144
EOF
sudo cat >> /etc/security/limits.conf << EOF
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536EOFsudo cat >> /etc/pam.d/login << EOF
session required /lib/security/pam_limits.so
session required pam_limits.so
EOF
sudo sysctl -p
sudo cat >> /etc/profile << EOF
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.1.0/db_1
export PATH=$PATH:/u01/app/oracle/product/11.1.0/db_1/bin
export ORACLE_SID=cert11
EOF
sudo cat >> /etc/init.d/oracledb << EOF
#!/bin/bash
#
# /etc/init.d/oracledb
#
# Run-level Startup script for the Oracle Listener and Instances
# It relies on the information on /etc/oratab
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1
export ORACLE_OWNR=oracle
export PATH=$PATH:$ORACLE_HOME/bin
if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
then
echo "Oracle startup: cannot start"
exit 1
fi
case "$1" in
start)
# Oracle listener and instance startup
echo -n "Starting Oracle: "
su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl start"
su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbstart"
touch /var/lock/oracle
echo "OK"
;;
stop)
# Oracle listener and instance shutdown
echo -n "Shutdown Oracle: "
su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop"
su $ORACLE_OWNR -c $ORACLE_HOME/bin/dbshut
rm -f /var/lock/oracle
echo "OK"
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: `basename $0` start|stop|restart|reload"
exit 1
esac
exit 0
EOF
sudo chmod a+x /etc/init.d/oracledb
cd /etc/init.d
sudo update-rc.d oracledb defaults 99
Edit .bash_profile and add the following
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1
export ORACLE_OWNR=oracle
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
install oracle software only
./runInstaller -ignoreSysPrereqs
then run dbca and name the database (cert11) in my case.
edit /etc/oratab and set the last field to 'Y' to start oracle automatically at boot.
No comments:
Post a Comment