2012年(17)
分类: Oracle
2012-11-11 15:01:18
在fedora9上安装Oracle11g
2010.08
一 包检查
[root@Linux7 oracle]# cat checkDeps.sh
#!/bin/sh
rpm -q binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc gcc-c++ libaio-devel libaio libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel |
二 内核参数
[root@Linux7 oracle]# more /etc/sysctl.conf
# Oracle 11g 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 net.core.rmem_default = 4194304 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 262144
|
[root@Linux7 oracle]# sysctl -p
三 创建用户和组
[root@Linux7 oracle]# groupadd oinstall
[root@Linux7 oracle]# groupadd dba
[root@Linux7 oracle]# useradd -g oinstall -G dba Oracle
[root@Linux7 oracle]# passwd Oracle
四 Oracle用户的限制参数
[root@Linux7 oracle]# more /etc/security/limits.conf
Oracle soft nproc 2047 Oracle hard nproc 16384 Oracle soft nofile 1024 Oracle hard nofile 65536 |
[root@Linux7 oracle]# more /etc/pam.d/login
session required /lib/security/pam_limits.so session required pam_limits.so |
[root@Linux7 oracle]# more /etc/profile
if [ $USER = "Oracle" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi fi |
五 创建安装所需目录
[root@Linux7 oracle]# mkdir -p /opt/ora1/app
[root@Linux7 oracle]# chown -R Oracle:oinstall /opt/ora1/app
[root@Linux7 oracle]# chmod -R 775 /opt/ora1/app
[root@Linux7 oracle]# mkdir /opt/ora1/tmp
[root@Linux7 oracle]# chmod a+wr /opt/ora1/tmp
六 设置Oracle用户环境
[Oracle@Linux7 ~]$ more ~/.bash_profile
umask 022 TMP=/opt/ora1/tmp TMPDIR=/opt/ora1/tmp export TMP TMPDIR# Get the aliases and functions
if [ -f ~/.bashrc ]; then . ~/.bashrc fi
# User specific environment and startup programs PATH=$PATH:$HOME/bin ORACLE_BASE=/opt/ora1/app/oracle ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1 ORA_CRS_HOME=$ORACLE_BASE/crs ORACLE_PATH==$ORACLE_BASE/common/Oracle/sql:.:$ORACLE_HOME/rdbms/admin ORACLE_SID=sjdb
PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:${PATH} PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin PATH=${PATH}:$ORACLE_BASE/common/Oracle/bin
ORACLE_TERM=xterm TNS_ADMIN=$ORACLE_HOME/network/admin ORA_NLS10=$ORACLE_HOME/nls/data LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib:$ORACLE_HOME/ora
cm/lib:$ORACLE_HOME/lib LIBPATH=$LIBPATH:$ORA_CRS_HOME/lib:$ORACLE_HOME/lib CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/jlib:$ORACLE_HOME/network/jlib:$ORACLE_HOME/JRE NLS_LANG=AMERICAN_AMERICA.ZHS16GBK LANG=AMERICAN_AMERICA.ZHS16GBK
export PATH ORACLE_BASE ORACLE_HOME ORA_CRS_HOME ORACLE_PATH ORACLE_SID ORACLE_TERM TNS_ADMIN ORA_NLS10 LD_LIBRARY_PATH LIBPATH CLASSPATH NLS_LANG LANG |
七 准备Oracle安装包
将oracle安装包拷贝到Oracle用户home目录。
[Oracle@Linux7 ~]$ unzip oracle_install_package.zip
会在home目录中生成一个database目录。
八 用Oracle用户运行runInstaller安装程序