在Linux安装Oracle 11g r2
OS:Centos 5.2
DB:Oracle 11g r2
oracle安装路径:/home/oracle
安装记录,以备下次使用,资料来源官方文档、网络、安装截图
Oracle官方文档:http://www.oracle.com/pls/db112/homepage
博客:http://blog.csdn.net/westmaniac/article/details/6539487
1. 以root用户登录到Linux
2. 检查机器硬件要求
2.1 内存要求
查看机器内存大小命令
grep MemTotal /proc/meminfo
grep SwapTotal /proc/meminfo
df -h /tmp
df -h
binutils-2.17.50.0.6compat-libstdc++-33-3.2.3elfutils-libelf-0.125elfutils-libelf-devel-0.125elfutils-libelf-devel-static-0.125gcc-4.1.2gcc-c++-4.1.2glibc-2.5-24glibc-common-2.5glibc-devel-2.5glibc-headers-2.5kernel-headers-2.6.18ksh-20060214libaio-0.3.106libaio-devel-0.3.106 libgcc-4.1.2libgomp-4.1.2libstdc++-4.1.2 libstdc++-devel-4.1.2make-3.81numactl-devel-0.9.8.i386sysstat-7.0.2
rpm -q package_name
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle
cat >> /etc/sysctl.conf << EOF#for oraclefs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 2097152 kernel.shmmax = 536870912 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 net.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048586 EOF
sysctl -p
cat >> /etc/security/limits.conf << EOF#for oracleoracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 oracle soft stack 10240 EOF
mkdir -p /home/oracle/app/ chown -R oracle:oinstall /home/oracle/app/ chmod -R 775 /home/oracle/app/
cat >> /home/oracle/.bash_profile << EOF#for oracleumask 022 export ORACLE_BASE=/home/oracle/app export ORACLE_HOME=$ORACLE_BASE/oracle/product/11.2.0/db_1 export ORACLE_SID=orcl --Oracle实例名,可修改 export PATH=$PATH:HOME/bin:$ORACLE_HOME/bin EOF
cat >> /etc/pam.d/login << EOF#for oraclesession required /lib/security/pam_limits.so session required pam_limits.so EOF
cat >> /etc/profile << EOF#for oracleif [ $USER = "oracle" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi fiEOF
echo $DISPLAY
Could not execute auto check for display colors using command /usr/X11R6/bin/xdpyinfo. Check if the DISPLAY variable is set. Failed
#!/bin/bash# chkconfig: 2345 90 10export ORACLE_BASE=/home/oracle/app/export ORACLE_HOME=$ORACLE_BASE/oracle/product/11.2.0/db_1export ORACLE_SID=orclexport PATH=$PATH:$ORACLE_HOME/binORCL_OWN="oracle"# if the executables do not exist -- display errorif [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]then echo "Oracle startup: cannot start" exit 1fi# depending on parameter -- start, stop, restart# of the instance and listener or usage displaycase "$1" instart)# Oracle listener and instance startupecho -n "Starting Oracle: "su - $ORCL_OWN -c "$ORACLE_HOME/bin/dbstart"touch /var/lock/subsys/oradbecho "OK";;stop)# Oracle listener and instance shutdownecho -n "Shutdown Oracle: "su - $ORCL_OWN -c "$ORACLE_HOME/bin/dbshut"rm -f /var/lock/subsys/oradbecho "OK";;reload|restart)$0 stop$0 start;;*)echo "Usage: 'basename $0' start|stop|restart|reload"exit 1esacexit 0