Differences
This shows you the differences between two versions of the page.
— |
oracle [2013/11/01 18:56] (current) a created |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Oracle ====== | ||
+ | <note important> | ||
+ | |||
+ | ===== Oracle Install Tips - 10g on RHEL5 ===== | ||
+ | |||
+ | |||
+ | Install requisite packages | ||
+ | |||
+ | yum -y install setarch-2* | ||
+ | |||
+ | yum -y install make-3* | ||
+ | yum -y install glibc-2* | ||
+ | yum -y install libaio-0* | ||
+ | yum -y install compat-libstdc++-33-3* | ||
+ | yum -y install compat-gcc-34-3* | ||
+ | yum -y install compat-gcc-34-c++-3* | ||
+ | yum -y install gcc-4* | ||
+ | yum -y install libXp-1* | ||
+ | yum -y install openmotif-2* | ||
+ | yum -y install compat-db-4* | ||
+ | |||
+ | Update /etc/hosts with correct servername | ||
+ | 10.1.4.200 | ||
+ | |||
+ | Update / | ||
+ | |||
+ | oracle soft nproc 15360 | ||
+ | |||
+ | oracle hard nproc 16384 | ||
+ | oracle soft nofile 64512 | ||
+ | oracle hard nofile 65536 | ||
+ | |||
+ | Create users and groups | ||
+ | |||
+ | groupadd dba | ||
+ | useradd -g dba oracle; echo " | ||
+ | |||
+ | Create directories and chown for oracle | ||
+ | |||
+ | mkdir -p / | ||
+ | |||
+ | chown -R oracle.dba /u01 | ||
+ | |||
+ | Make sure SELINUX is disabled in / | ||
+ | SELINUX=disabled | ||
+ | |||
+ | Update / | ||
+ | |||
+ | # Controls the maximum shared segment size, in bytes - see kernel and hugepages info | ||
+ | kernel.shmmax = 68719476736 | ||
+ | # Controls the maximum number of shared memory segments, in pages | ||
+ | kernel.shmall = 4294967296 | ||
+ | kernel.sem = 250 32000 100 128 | ||
+ | fs.file-max = 104032 | ||
+ | net.ipv4.ip_local_port_range = 1024 65000 | ||
+ | net.core.rmem_default = 1048576 | ||
+ | net.core.rmem_max = 1048576 | ||
+ | net.core.wmem_default = 262144 | ||
+ | net.core.wmem_max = 262144 | ||
+ | |||
+ | |||
+ | run sysctl -p #activates new kernel parameters | ||
+ | |||
+ | To mount an NFS share for backups: | ||
+ | nas.sysxperts.com:/ | ||
+ | nas.sysxperts.com:/ | ||
+ | |||
+ | |||
+ | Edit the oracle users ~/ | ||
+ | |||
+ | # Oracle Settings | ||
+ | TMP=/tmp; export TMP | ||
+ | TMPDIR=$TMP; | ||
+ | |||
+ | ORACLE_BASE=/ | ||
+ | ORACLE_HOME=$ORACLE_BASE/ | ||
+ | ORACLE_SID=TEST; | ||
+ | ORACLE_TERM=xterm; | ||
+ | PATH=/ | ||
+ | PATH=$ORACLE_HOME/ | ||
+ | |||
+ | LD_LIBRARY_PATH=$ORACLE_HOME/ | ||
+ | CLASSPATH=$ORACLE_HOME/ | ||
+ | |||
+ | if [ $USER = " | ||
+ | if [ $SHELL = "/ | ||
+ | ulimit -p 16384 | ||
+ | ulimit -n 65536 | ||
+ | else | ||
+ | ulimit -u 16384 -n 65536 | ||
+ | fi | ||
+ | fi | ||
+ | |||
+ | |||
+ | |||
+ | Start vncserver with (install with yum -y install vnc-server if necessary): | ||
+ | |||
+ | vncserver | ||
+ | |||
+ | vncpasswd | ||
+ | |||
+ | |||
+ | |||
+ | Establish vnc session and run xhost + as root | ||
+ | |||
+ | |||
+ | Extract cpio with: | ||
+ | |||
+ | cpio -idmv < 10201_database_linux_x86_64.cpio | ||
+ | |||
+ | |||
+ | |||
+ | cd to directory where cpio command was run | ||
+ | |||
+ | |||
+ | |||
+ | ./ | ||
+ | |||
+ | |||
+ | |||
+ | download latest patch and unzip | ||
+ | |||
+ | ./ | ||
+ | |||
+ | |||
+ | To uninstall run the deinstaller from the latest patch Disk1/ | ||
+ | |||
+ | |||
+ | Edit /etc/oratab and set restart flag for TEST instance | ||
+ | TEST:/ | ||
+ | |||
+ | sar and dstat is useful for stats on server - yum -y install sysstat dstat | ||
+ | ls -lattr / | ||
+ | sar -A / | ||
+ | |||
+ | man sar and dstat are your friends | ||
+ | |||
+ | See oracle automated startup for init setup (http:// | ||
+ | |||
+ | ++++++++++++++++++++++++++ | ||
+ | |||
+ | Oracle 10g/ | ||
+ | Create file / | ||
+ | |||
+ | #!/bin/sh | ||
+ | # chkconfig: 345 99 01 | ||
+ | # description: | ||
+ | # | ||
+ | # | ||
+ | ORACLE=oracle | ||
+ | case $1 in | ||
+ | ' | ||
+ | cat << | ||
+ | # Start Oracle Net | ||
+ | if [ -f ${ORACLE_HOME}/ | ||
+ | then | ||
+ | echo " | ||
+ | ${ORACLE_HOME}/ | ||
+ | fi | ||
+ | echo " | ||
+ | ${ORACLE_HOME}/ | ||
+ | ${ORACLE_HOME}/ | ||
+ | EOF | ||
+ | ;; | ||
+ | ' | ||
+ | cat << | ||
+ | echo " | ||
+ | ${ORACLE_HOME}/ | ||
+ | # Stop Oracle Net | ||
+ | if [ -f ${ORACLE_HOME}/ | ||
+ | then | ||
+ | echo " | ||
+ | ${ORACLE_HOME}/ | ||
+ | fi | ||
+ | echo " | ||
+ | ${ORACLE_HOME}/ | ||
+ | EOF | ||
+ | ;; | ||
+ | *) | ||
+ | echo " | ||
+ | exit | ||
+ | ;; | ||
+ | esac | ||
+ | # | ||
+ | exit | ||
+ | |||
+ | Run: | ||
+ | chkconfig oracle on | ||
+ | |||
+ | Update the oracle user .bash_profile as follows: | ||
+ | export ORACLE=oracle | ||
+ | export ORACLE_SID=`cat /etc/oratab |sed -e ' | ||
+ | export PATH=$PATH:/ | ||
+ | export ORAENV_ASK=" | ||
+ | . / | ||
+ | |||
+ | Update /etc/oratab with your instances | ||
+ | orcl:/ | ||
+ | orcltest:/ | ||
+ | |||
+ | Alternatively if you want to use your own start scripts you could do the following (BUT WHY?): | ||
+ | |||
+ | Create an / | ||
+ | #!/bin/sh | ||
+ | # | ||
+ | #oracle agent init script | ||
+ | #chkconfig: 2345 97 05 | ||
+ | # | ||
+ | # Source function library. | ||
+ | if [ -f / | ||
+ | . / | ||
+ | elif [ -f / | ||
+ | . / | ||
+ | else | ||
+ | exit 0 | ||
+ | fi | ||
+ | prog=oracle | ||
+ | ORAHOME=/ | ||
+ | AGENT_USER=oracle | ||
+ | email=pvalentino@sysxperts.com | ||
+ | start () { | ||
+ | echo -n $" | ||
+ | # start daemon | ||
+ | if [ -e "/ | ||
+ | then | ||
+ | su - ${AGENT_USER} -c "cd ${ORAHOME}; ./ | ||
+ | rm -rf / | ||
+ | else | ||
+ | mail -s " | ||
+ | fi | ||
+ | RETVAL=$? | ||
+ | echo | ||
+ | [ $RETVAL = 0 ] && touch / | ||
+ | return $RETVAL | ||
+ | } | ||
+ | stop () { | ||
+ | # stop daemon | ||
+ | echo -n $" | ||
+ | su - ${AGENT_USER} -c "cd ${ORAHOME}; | ||
+ | RETVAL=$? | ||
+ | if " | ||
+ | echo | ||
+ | [ $RETVAL = 0 ] && touch / | ||
+ | return $RETVAL | ||
+ | } | ||
+ | restart() { | ||
+ | stop | ||
+ | start | ||
+ | } | ||
+ | case $1 in | ||
+ | start) | ||
+ | start | ||
+ | ;; | ||
+ | stop) | ||
+ | stop | ||
+ | ;; | ||
+ | restart|reload) | ||
+ | restart | ||
+ | ;; | ||
+ | condrestart) | ||
+ | [ -f / | ||
+ | ;; | ||
+ | *) | ||
+ | echo $" | ||
+ | exit 1 | ||
+ | esac | ||
+ | exit $RETVAL | ||
+ | |||
+ | And your orastart and orastop scripts would have all of the startup procedures you would like to run in a custom fashion i.e. | ||
+ | |||
+ | orastart: | ||
+ | . / | ||
+ | lsnrctl start | ||
+ | # | ||
+ | mail -s "**** TEST databases started ***" _DBA@sysxperts.com < / | ||
+ | |||
+ | |||
+ | orastart_TEST: | ||
+ | . / | ||
+ | ############# | ||
+ | export ORACLE_SID=TEST | ||
+ | sqlplus '/ as sysdba' | ||
+ | startup | ||
+ | EOF | ||
+ | # | ||
+ | |||