Oracle安装(一)

Linux下Oracle安装(一)

在Linux中安装Oracle主要有以下几步

安装Oracle依赖包
1
# yum -y install 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 pdksh ksh libaio.i686 glibc.i686 compat-libstdc++-33.i686 libaio-devel.i686 libgcc.i686 libstdc++.i686 unixODBC.i686 unixODBC-devel.i686
创建Oracle对应目录并设置权限
1
2
# mkdir -p /oracle/app/oracle && chown -R oracle:oinstall /oracle/app/oracle
# mkdir -p /oracle/app/oraInventory && chown -R oracle:oinstall /oracle/app/oraInventory
安装图形界面
1
2
3
4
5
6
# yum install xhost
# yum grouplist
# yum groupinstall "X Window System"
# yum groupinstall Desktop
# yum install xterm
# yum install xclock
设置图形界面显示位置

export DISPLAY=客户端IP:0.0

创建Oracle系统用户
1
2
3
4
# groupadd oinstall 
# groupadd dba
# useradd -g oinstall -G dba oracle
# passwd oracle
修改系统内核(可选)

vi /etc/sysctl.conf

新增内容如下:
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.aio-max-nr = 1048576
fs.file-max = 6815744
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

配置文件限制(可选)

vi /etc/security/limits.conf

内容如下:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

配置Oracle环境变量
1
2
# su oracle
# vi .bash_profile

bash_profile内容修改如下:
export ORACLE_BASE=/oracle/app/oracle #ORACLE基础目录
export ORACLE_HOME=/oracle/app/oracle/product/11.2.0/dbhome_1 #ORACLE安装目录
export ORACLE_SID=CCMP #SID
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_TERM=xterm
export TNS_ADMIN=$ORACLE_HOME/network/admin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/oracm/lib:$ORACLE_HOME/lib
export CLASSPATH=$CLASSPATH:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/jlib:$ORACLE_HOME/network/lib
export LANG=en_US.gbk
export NLS_LANG=american_america.ZHS16GBK
export EDITOR=vi
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH

使用Xshell/MobaXterm来显示界面