安装环境
centos7 4核4g 磁盘50g
会用到的工具
- xshell(用来连接centos7)
- xftp(传输oracle压缩包的,下载下来有两个,可以先解压到一个包里,一块压缩上传)
- xming(安装oracle需要图形化界面,所以会用到xming)
xming在安装后需要进行如下操作
XMing的配置:打开XLaunch,记住Display Number,现在这里是0,后面配置及XShell中会用到。
后面的都直接点下一步即可:--> Start no client -->Clipbard-->完成。
这时还要设置IP允许,如果不设IP允许,将会被Xming拒绝而打不开:首先打开Xming安装文件夹找到 X*.hosts 文件(*号为上面Display Number 数字),如本例就是找到X0.hosts文件,打开并在localhost下面一行,添加Linux服务器的IP地址。
安装前准备
oracle安装包(自行下载)
将selinux设置为enforcing模式
#查看SELinux状态
[root@localhost ~]# sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: enforcing
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 31
# 如果不是 enforcing 模式,则运行以下命令并重启即可生效。
sed -i 's/SELINUX.*/SELINUX=enforcing/' /etc/selinux/config
真实生产环境下需要开启防火墙,如果只是单纯的实验测试,可以跳过防火墙配置
systemctl start firewalld #启动防火墙
systemctl status firewalld #查看防火墙状态
更新centos 7的yum源为国内源,如果已更新,请跳过
# 备份并删除现有源
cat /etc/yum.repos.d/* > /etc/yum.repos.d/repo.bak
rm -rf /etc/yum.repos.d/*.repo
# 配置阿里源(2选1)
wget http://mirrors.aliyun.com/repo/Centos-7.repo -O /etc/yum.repos.d/CentOS-aliyun.repo
# 配置网易163源(2选1)
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo -O /etc/yum.repos.d/CentOS-163.repo
# 最后使源生效
yum clean all && yum makecache
把centos系统更新至最新
yum update -y
安装步骤
为oracle数据库创建所需的操作用户及群组
groupadd oinstall #创建用户组oinstall
groupadd dba #创建dba用户组
useradd -g oinstall -G dba oracle #把oracle加入oinstall用户组和dba用户组
passwd oracle #设置密码
groups oracle #查看用户所属的组
在/etc/sysctl.conf加入下列内核参数
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1987162112
kernel.shmmni = 4096
kernel.sem = 250 32000 10