Centos7 图形化(GUI) 安装Oracle11g

本文详细介绍在Linux系统安装Oracle 11G数据库的步骤。先进行初始化参数配置,包括下载安装包、创建用户及组等;接着安装软件、监听;再创建数据库,配置自启动;最后提及安装中报错agent nmhs的解决办法,为数据库安装提供全面指导。

配置初始化参数

1、下载Oracle安装包

如果本地有11g的安装包,则直接上传到/usr/local/src目录下。

2、创建Oracle用户及组

使用root用户登录到ssh远程窗口

[root@localhost ~]# su root

创建oinstall用户组

[root@localhost ~]# groupadd oinstall

创建dba用户组

[root@localhost ~]# groupadd dba

创建oracle用户并将用户加入到oinstall组和dba组中

[root@localhost ~]# useradd -g oinstall -g dba -m oracle

配置oracle用户的登录密码

[root@localhost ~]# passwd oracle

查看oracle用户的组权限

[root@localhost ~]# id oracle

3、创建Oracle存储目录

创建Oracle的安装目录以及数据存储目录。生产环境中,需要找一个磁盘空间比较大的目录。

创建安装oracle数据库的目录

[root@localhost ~]# mkdir -p /home/oracle

创建oracle产品清单目录

[root@localhost ~]# mkdir -p /home/oraInventory

oracle会将数据库的版本、注册等信息写入到此文件中。

创建oracle安装包的目录

[root@localhost ~]# mkdir -p /home/database

将这些目录及子目录授权给刚刚创建的oracle用户

[root@localhost home]# chown -R oracle:oinstall /home/oracle
[root@localhost home]# chown -R oracle:oinstall /home/oraInventory
[root@localhost home]# chown -R oracle:oinstall /home/database

4、修改OS系统标识

oracle默认是不支持CentOS系统的,我们需要将配置文件中的系统系统改为redhat才能够正常安装(因为CentOS就是redhat的下游发行版,现在上游发行版了)。

编辑redhat-7文件

[root@localhost home]# vim /etc/redhat-release
redhat-7

5、安装依赖包

在外网环境(能够访问百度直接下载资源)中可以直接访问配置源中指定的链接下载,但是在内网环境(无法访问百度直接下载资源)中需要YUM源或者手动上传依赖包安装。
如果需要配置本地YUM源,可以参考:配置本地YUM源

安装oracle需要的依赖包

[root@localhost home]# yum install binutils* compat* gcc* glibc* ksh* libaio* libgcc* libstdc* libXi* libXtst* make* sysstat* elfutils*

6、开放firewalld端口和禁用selinux

如果你的环境能够关闭防火墙也可以直接关闭防火墙,我这里开放1521的端口。

检查firewalld防火墙的状态

[root@localhost home]# systemctl status firewalld.service

默认情况下是有启动的(active (running)),如果状态不是active (running),则firewalld防火墙异常。

永久开放firewalld的1521端口

[root@localhost home]# firewall-cmd --permanent --zone=public --add-port=1521/tcp

oracle的默认端口是1521,如果数据库的端口不是1521,则开放相应的端口。

重启firewalld

[root@localhost home]# systemctl restart firewalld

禁用selinux

[root@localhost home]# setenforce 0

此命令会立即禁用selinux,但服务器重启后还是会启用selinux。

禁止selinux开机启动

[root@localhost home]# vim /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
将此处SELINUX=enforcing改为SELINUX=disabled,表示禁用selinux策略。

7、配置内核参数

配置内核参数文件

[root@localhost home]# vim /etc/sysctl.conf
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.conf.all.rp_filter = 1
fs.file-max = 6815744
fs.aio-max-nr = 1048576
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni =
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值