User:Mrjazzman: Difference between revisions

From FAIWiki
Jump to navigation Jump to search
(Setting up Oracle)
 
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Current Works ==
== Current Works ==


[[ User:Mrjazzman/OracleBase ]]


== Oracle ==
[[ User:Mrjazzman/DellServers ]]
=== Package Configs ===
Firstly you need a copy of '''libaio'''. You can google for the deb package. I installed this on my private debian mirror


package_config/ORACLE
== Notes on FAI 3.1 and Multi Distro ==
<pre>
  * /etc/kernel-img.conf needs to be specific for UBUNTU
PACKAGES install
  * Added fcopy /etc/kernel-img.conf to hoots/instsoft.UBUNTU - can not add it during scripts as it's needed for the installation of the kernel image
binutils
* Kernel image for Dapper is linux-image-2.6.15-23-686
libdb2
* Can't use linux-image-* due to dependancy problems
libdb3
libdb4.1
libdb1-compat
cpp-3.3
gcc-3.3
libstdc++5-3.3-dev
libstdc++2.10-glibc2.2
base-files
netbase
libc6
libc6-dev
make
vncserver
libaio
gcc
</pre>
 
scripts/ORACLE/10-setup
<pre>
#!/bin/bash
 
#
#
#
# Configure a server to run Oracle
# Create Users
echo "dba:x:900:oracle" >> ${target}/etc/group
echo "dba:x:900:oracle" >> ${target}/etc/group-
echo "oinstall:x:901:" >> ${target}/etc/group
echo "oinstall:x:901:"  >> ${target}/etc/group-
echo "oinstall:!::" >> ${target}/etc/gshadow
echo "oinstall:!::" >> ${target}/etc/gshadow-
echo "dba:!::oracle" >> ${target}/etc/gshadow
echo "dba:!::oracle" >> ${target}/etc/gshadow-
echo "oracle:x:1000:901::/home/oracle:/bin/bash" >> ${target}/etc/passwd
echo "oracle:$1$LgAZMIrX$63LaKC66qMXeLS/xj/PFv1:13230:0:99999:7:::" >> ${target}/etc/shadow
echo "nobody:x:1800:" >> ${target}/etc/group
echo "nobody:!::" >> ${target}/etc/gshadow
 
#
# Create Directories
 
mkdir -p ${target}/u01/app/oracle
mkdir -p ${target}/u01/oradata 
mkdir    ${target}/home/oracle
chown -R 1000:901 ${target}/home/oracle
chown -R 1000:901 ${target}/u01 
chmod -R 775 ${target}/u01
 
#
# Fix System Details
cat >> ${target}/etc/sysctl.conf << EOF
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
EOF
 
 
cat >> ${target}/etc/security/limits.conf << EOF
*              soft    nproc  2047
*              hard    nproc  16384
*              soft    nofile 1024
*               hard    nofile  65536
EOF
 
cat >> ${target}/etc/profile << EOF
# For Oracle
if [ \$USER = "oracle" ]; then
  if [ \$SHELL = "/bin/ksh" ]; then
      ulimit -p 16384
      ulimit -n 65536
  else
      ulimit -u 16384 -n 65536
  fi
fi
EOF
 
#
# Fake Being Redhat
echo "Red Hat Enterprise Linux AS release 3 (Taroon)" > ${target}/etc/redhat-r
elease
 
 
#
# Setup defaults for the oracle user.
cat >> ${target}/home/oracle/.bash_profile << EOF
umask 022
ORACLE_BASE=/u01/app/oracle
ORACLE_SID=\${HOSTNAME}
ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1/
export ORACLE_BASE ORACLE_SID ORACLE_HOME
export LD_LIBRARY_PATH=/usr/lib:\$ORACLE_HOME/lib
unset TNS_ADMIN
EOF
 
#
# Setup the init scripts
fcopy /etc/init.d/oracle
</pre>
 
 
files/etc/init.d/oracle/ORACLE
<pre>
#!/bin/bash
#
# Run-level Startup script for the Oracle Instance and Listener
#
# chkconfig: 345 91 19
# description: Startup/Shutdown Oracle listener and instance
 
ORA_HOME="/u01/app/oracle/product/10.2.0/db_1"
ORA_OWNR="oracle"
 
# if the executables do not exist -- display error
 
if [ ! -f $ORA_HOME/bin/dbstart -o ! -d $ORA_HOME ]
then
        echo "Oracle startup: cannot start"
        exit 1
fi
 
# depending on parameter -- startup, shutdown, restart
# of the instance and listener or usage display
 
case "$1" in
    start)
        # Oracle listener and instance startup
        echo -n "Starting Oracle: "
        su - $ORA_OWNR -c "$ORA_HOME/bin/lsnrctl start"
        su - $ORA_OWNR -c $ORA_HOME/bin/dbstart
        touch /var/lock/subsys/oracle
        echo "OK"
        ;;
    stop)
        # Oracle listener and instance shutdown
        echo -n "Shutdown Oracle: "
        su - $ORA_OWNR -c "$ORA_HOME/bin/lsnrctl stop"
        su - $ORA_OWNR -c $ORA_HOME/bin/dbshut
        rm -f /var/lock/subsys/oracle
        echo "OK"
        ;;
    reload|restart)
        $0 stop
        $0 start
        ;;
    *)
        echo "Usage: $0 start|stop|restart|reload"
        exit 1
esac
exit 0
</pre>

Latest revision as of 07:28, 20 October 2006

Current Works

User:Mrjazzman/OracleBase

User:Mrjazzman/DellServers

Notes on FAI 3.1 and Multi Distro

* /etc/kernel-img.conf needs to be specific for UBUNTU
* Added fcopy /etc/kernel-img.conf to hoots/instsoft.UBUNTU - can not add it during scripts as it's needed for the installation of the kernel image
* Kernel image for Dapper is linux-image-2.6.15-23-686
* Can't use linux-image-* due to dependancy problems