Skip to content

Instantly share code, notes, and snippets.

@iguoli
Last active August 21, 2017 00:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iguoli/bdbc2641468149c792abb4e48493d9f9 to your computer and use it in GitHub Desktop.
Save iguoli/bdbc2641468149c792abb4e48493d9f9 to your computer and use it in GitHub Desktop.
Oracle Installation

创建Oracle用户和组


groupadd oinstall
groupadd dba
useradd -m -g oinstall -G dba oracle(主组oinstall,其它组:dba)
passwd oracle

修改内核参数

sudo vim /etc/sysctl.conf

fs.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

sudo sysctl -p

修改用户限制

sudo vim /etc/security/limits.conf

oracle           soft    nproc   2047
oracle           hard    nproc   16384
oracle           soft    nofile  1024
oracle           hard    nofile  65536

修改用户配置文件

sudo vim /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

安装目录配置


mkdir -p /u01/oraInventory
chown -R oracle:oinstall /u01/
chmod -R 775 /u01/

添加环境变量

vim .bash_profile

export ORACLE_BASE=/u01 
export ORACLE_HOME=$ORACLE_BASE/oracle
export ORACLE_SID=oracleSid 
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment