Linux CentOS安装Oracle11g数据库

Linux(Redhat系)安装Oracle数据库

为CentOS7(大部分Redhat系统通用)安装Oracle11g
为服务器添加阿里云镜像:
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
生成安装路径及创建用户并划分权限:
$ groupadd oinstall
$ groupadd dba
$ useradd -g oinstall -g dba -m oracle
$ mkdir -p /data/oracle
$ mkdir -p /data/oraInventory
$ mkdir -p /data/database
$ chown -R oracle:oinstall /data/oracle
$ chown -R oracle:oinstall /data/oraInventory
$ chown -R oracle:oinstall /data/database
关闭firewalld(由于数据库一般部署在内部服务器,关闭firewalld会减去很多策略冲突问题):
$ systemctl stop firewalld.service
$ systemctl disable firewalld.service
安装依赖包(此处直接放入脚本文件直接运行):
#!/bin/bash
yum install -y binutils.x86_64
yum install -y compat-libcap1.x86_64
yum install -y compat-libcap1.i686
yum install -y gcc.x86_64
yum install -y gcc-c++.x86_64
yum install -y glibc.x86_64
yum install -y glibc.i686
yum install -y glibc-devel.x86_64
yum install -y glibc-devel.i686
yum install -y ksh.x86_64
yum install -y libaio.i686
yum install -y libaio.x86_64
yum install -y libaio-devel.i686
yum install -y libaio-devel.x86_64
yum install -y libgcc.x86_64
yum install -y libgcc.i686
yum install -y libstdc++.x86_64
yum install -y libstdc++.i686
yum install -y libstdc++-devel.i686
yum install -y libstdc++-devel.x86_64
yum install -y libXi.i686
yum install -y libXi.x86_64
yum install -y libXtst.i686
yum install -y libXtst.x86_64
yum install -y libXtst-devel.i686
yum install -y libXtst-devel.x86_64
yum install -y make.x86_64
yum install -y sysstat.x86_64
/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 
/etc/redhat-release文件中,将文件内容调成如下(Oracle对于系统型号有限制):
redhat-7
/etc/sysctl.conf文件中,修改系统参数以调整Oracle安装后的资源运用:
# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
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 #共享内存的总量,8G内存设置:2097152*4k/1024/1024
kernel.shmmax=2147483648 #最大共享内存的段大小
kernel.shmmni=4096 #整个系统共享内存端的最大数
kernel.sem=250 32000 100 128
net.ipv4.ip_local_port_range=9000 65500 #可使用的IPv4端口范围
net.core.rmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048576
调整文件/etc/security/limits.conf
# /etc/security/limits.conf
#
#This file sets the resource limits for the users logged in via PAM.
#It does not affect resource limits of the system services.
#
#Also note that configuration files in /etc/security/limits.d directory,
#which are read in alphabetical order, override the settings in this
#file in case the domain is the same or more specific.
#That means for example that setting a limit for wildcard domain here
#can be overriden with a wildcard setting in a config file in the
#subdirectory, but a user specific setting here can be overriden only
#with a user specific setting in the subdirectory.
#
#Each line describes a limit for a user in the form:
#
#<domain>        <type>  <item>  <value>
#
#Where:
#<domain> can be:
#        - a user name
#        - a group name, with @group syntax
#        - the wildcard *, for default entry
#        - the wildcard %, can be also used with %group syntax,
#                 for maxlogin limit
#
#<type> can have the two values:
#        - "soft" for enforcing the soft limits
#        - "hard" for enforcing hard limits
#
#<item> can be one of the following:
#        - core - limits the core file size (KB)
#        - data - max data size (KB)
#        - fsize - maximum filesize (KB)
#        - memlock - max locked-in-memory address space (KB)
#        - nofile - max number of open file descriptors
#        - rss - max resident set size (KB)
#        - stack - max stack size (KB)
#        - cpu - max CPU time (MIN)
#        - nproc - max number of processes
#        - as - address space limit (KB)
#        - maxlogins - max number of logins for this user
#        - maxsyslogins - max number of logins on the system
#        - priority - the priority to run user process with
#        - locks - max number of file locks the user can hold
#        - sigpending - max number of pending signals
#        - msgqueue - max memory used by POSIX message queues (bytes)
#        - nice - max nice priority allowed to raise to values: [-20, 19]
#        - rtprio - max realtime priority
#
#<domain>      <type>  <item>         <value>
#

#*               soft    core            0
#*               hard    rss             10000
#@student        hard    nproc           20
#@faculty        soft    nproc           20
#@faculty        hard    nproc           50
#ftp             hard    nproc           0
#@student        -       maxlogins       4
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
# End of file
调整环境变量,在/home/oracle/.bash_profile文件下面添加参数:
export PATH
export ORACLE_BASE=/data/oracle #oracle数据库安装目录
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1 #oracle数据库路径
export ORACLE_SID=orcl #oracle启动数据库实例名
export ORACLE_TERM=xterm #xterm窗口模式安装
export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH #添加系统环境变量
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib #添加系统环境变量
export LANG=C #防止安装过程出现乱码
使环境变量生效:
$ source /home/oracle/.bash_profile
安装付权:
$ chown -R oracle:oinstall /data/database/database
$ cd /data/database/database
$ ./runInstaller
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

盛者无名

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值