-
一、安装oracle前的准备
创建运行oracle的账号和用户组
切换到root
# su - root
创建三个组 oinstall dba oper
# groupadd 1000 oinstall #1000为指定id,可不指定默认分配
# groupadd 1001 dba
# groupadd 1002 oper
创建oracle用户,并加到之前的三个组里
# useradd -u 1000 -g oinstall -G dba,oper -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle
# passwd oracle
ps:-u 分配用户id -g 加入用户组 -G批量加入用户组 -d新用户的主目录 -s登录shell -c 注释
修改/home/oracle/.bash_profile文件,下面四项为必改其他可改可不改
ORACLE_BASH : 警告,日志等存放目录
ORACLE_HOME : 软件安装目录
ORACLE_SID : 实例名
PATH : 路径
# vi /home/oracle/.bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
export ORACLE_SID=test
export PATH=$ORACLE_HOME/bin:$PATH
为Oracle、网格用户创建必要的目录,并将授权更改为Oracle用户
# mkdir -p /oracle/app/db
# chown -R oracle:oinstall /oracle/app
# chmod -R 775 /oracle/app
# chown -R oracle:oinstall /oradata
# chmod -R 775 /oradata
# chmod -R 775 /orarch
# chown -R oracle:oinstall /orarch
修改用户限制配置文件/etc/security/limits.conf 添加下列代码
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft nofile 65536
oracle hard nofile 65536
将配置文件加入到登录验证模块,在/etc/pam.d/login添加以下代码
session required /lib/security/pam_limits.so
session required pam_limits.so
修改环境变量文件/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
修改内核参数 /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1073741824
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
net.ipv4.tcp_wmem = 262144 262144 262144
net.ipv4.tcp_rmem = 4194304 4194304 4194304
导入插件,执行以下代码
yum install -y binutils compat-libstdc++ elfutils-libelf elfutils-elf-devel elfutils-libelf-devel-static gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers kernel-headers ksh libaio libaio-devel libgcc libgomp libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel
yum -y install compat-db*
yum -y install compat-libstdc*
yum -y install elfutils-libelf*
yum -y install *unzip*
yum -y install compat-libcap1*
yum ?y install smartmontools
yum -y groupinstall "X Window System"
-
二 安装oracle
解压安装包,将压缩包放入之前创建的目录下执行
# unzip p13390677_112040_Linux-x86-64_1of7.zip
# unzip p13390677_112040_Linux-x86-64_2of7.zip
进入database目录下执行
# ./runInstaller
打开图形界面 报错
Checking Temp space: must be greater than 120 MB. Actual 74126 MB Passed
Checking swap space: must be greater than 150 MB. Actual 5100 MB Passed
Checking monitor: must be configured to display at least 256 colors
>>> Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set. Failed <<<<
这是因为一开会用root登录的原因,
解决方案:退出,重新用oracle登录
设置邮箱(非必选)
只安装软件
路径设置,安装之前已经配置
修复点击上方中间按钮,执行相应的命令