Centos7安装及Oracle12c的安装

Centos7安装及Oracle12c的安装

一、装备工具

1.vmware(自行安装)

2.centos7

迅雷连接:http://mirrors.aliyun.com/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1908.iso

3.Oracle12c

https://pan.baidu.com/s/1UTpchjDujNXxjRToyEpqzg.提取码: 948n

4.FileZilla

https://pan.baidu.com/s/1JHkGmngck5carlnQDrIpuA .提取码:a2gu

二、Centos7安装(比较啰嗦)

1.点击下一步
安装步骤1
2.点击下一步安装步骤2
3.点击下一步
安装步骤3
4.选择相应的系统–点击下一步
安装步骤4
5.选择安装路径–点击下一步
安装步骤5
6.根据自己电脑线程给–点击下一步
安装步骤6
7.根据自己电脑内存–点击下一步
安装步骤7
8.根据自己喜好,NAT、桥接、共享都行,这里选共享NAT–点击下一步
安装步骤8
9.按照推荐的–点击下一步
安装步骤9
10.按照推荐的–点击下一步
安装步骤10
11.按照推荐的–点击下一步
安装步骤11
12.给200g的不要立即分配–点击下一步
安装步骤12
13.下一步
安装步骤13
14.点击自定义硬件
安装步骤14
15.选择cd—使用ISO映像文件(把下载好的IOS选中)
安装步骤15
安装步骤15_1
16.点击关闭即可–再点击完成
安装步骤16
17.开启虚拟机安装步骤17
18. 选择第一个 install centos 7
18
19. 在这里插入图片描述
20. 选择软件选择在这里插入图片描述

根据个人需求选择
兼容性程序库
开发工具
ftp服务器
安全性工具
智能卡支持
系统管理工具
选择完后点击完成
在这里插入图片描述

21.点击安装位置
在这里插入图片描述
21. 选中200g的盘符勾选我要配置分区然后点击完成
在这里插入图片描述
22. 手动分区在这里插入图片描述
23. 完成分区

/home – 20GB
/boot – 200MB
/tmp – 50GB
/ – 80GB
swap – 16GB
可自定义分配空间(只要符合最低安装要求即可)
安装需求
在这里插入图片描述
在这里插入图片描述
24.点击完成—点击接受更改
在这里插入图片描述

25.点击网络和主机名
在这里插入图片描述

打开网络开关(如果没有请检查相关服务有没有打开)
主机名改为localhost点击应用
完成
26.点击开始安装
在这里插入图片描述

27.设置root和创建用户

root密码位123456(过于简单需要点两次完成)
创建用户也一样
dong
密码123456
勾选为管理员

在这里插入图片描述在这里插入图片描述
28. 等待安装完成重启即可
29. 重启后允许许可证
在这里插入图片描述

三、准备Oracle12c安装环境

1.创建oinstall用户组及dba组

[dong@localhost ~]$ su root
密码:
[root@localhost dong]# groupadd oinstall
[root@localhost dong]# groupadd dba
[root@localhost dong]# useradd -g oinstall -g dba -m oracle
[root@localhost dong]# passwd oracle
更改用户 oracle 的密码 。
新的 密码:
无效的密码: 密码少于 8 个字符
重新输入新的 密码:
passwd:所有的身份验证令牌已经成功更新。
[root@localhost dong]# id oracle
uid=1001(oracle) gid=1002(dba)=1002(dba)

2.创建oracle数据库的安装目录

参考文档(可直接跳过)在这里插入图片描述
在这里插入图片描述

[root@localhost dong]# mkdir -p /data/oracle
[root@localhost dong]# mkdir -p /data/oraInventory
[root@localhost dong]# mkdir -p /data/database
[root@localhost dong]# cd /data
[root@localhost data]# chown -R oracle:oinstall /data/oraInventory
[root@localhost data]# chown -R oracle:oinstall /data/oracle
[root@localhost data]# chown -R oracle:oinstall /data/database/

3.修改OS系统标识
Oracle不支持CentOS系统安装
修改文件/etc/redhat-release

[root@localhost data]# cat /proc/version
Linux version 3.10.0-1062.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) #1 SMP Wed Aug 7 18:08:02 UTC 2019
[root@localhost data]# cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)
[root@localhost data]# vi /etc/redhat-release
[root@localhost data]# cat /etc/redhat-release
redhat-7

4.检查包
Packages for Oracle Linux 7 and Red Hat Enterprise Linux 7

binutils-2.23.52.0.1-12.el7.x86_64
compat-libcap1-1.10-3.el7.x86_64
compat-libstdc+±33-3.2.3-71.el7.i686
compat-libstdc+±33-3.2.3-71.el7.x86_64
gcc-4.8.2-3.el7.x86_64
gcc-c+±4.8.2-3.el7.x86_64
glibc-2.17-36.el7.i686
glibc-2.17-36.el7.x86_64
glibc-devel-2.17-36.el7.i686
glibc-devel-2.17-36.el7.x86_64
ksh
libaio-0.3.109-9.el7.i686
libaio-0.3.109-9.el7.x86_64
libaio-devel-0.3.109-9.el7.i686
libaio-devel-0.3.109-9.el7.x86_64
libgcc-4.8.2-3.el7.i686
libgcc-4.8.2-3.el7.x86_64
libstdc+±4.8.2-3.el7.i686
libstdc+±4.8.2-3.el7.x86_64
libstdc+±devel-4.8.2-3.el7.i686
libstdc+±devel-4.8.2-3.el7.x86_64
libXi-1.7.2-1.el7.i686
libXi-1.7.2-1.el7.x86_64
libXtst-1.2.2-1.el7.i686
libXtst-1.2.2-1.el7.x86_64
make-3.82-19.el7.x86_64
sysstat-10.1.5-1.el7.x86_64

一般都是安装好了的缺的话在安装后会有检查
用yum一个个安装吧
做个示范(基本都有安装,检查只会让你更新)
这一步可以跳过(按照上面的操作安装的系统基本都下载齐了差的在后面会补的)

[root@localhost data]# yum install binutils
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 binutils.x86_64.0.2.27-41.base.el7 将被 升级
---> 软件包 binutils.x86_64.0.2.27-41.base.el7_7.3 将被 更新
--> 解决依赖关系完成

依赖关系解决

================================================================================
 Package         架构          版本                        源              大小
================================================================================
正在更新:
 binutils        x86_64        2.27-41.base.el7_7.3        updates        5.9 M

事务概要
================================================================================
升级  1 软件包

总计:5.9 M
Is this ok [y/d/N]: y
Downloading packages:
警告:/var/cache/yum/x86_64/7/updates/packages/binutils-2.27-41.base.el7_7.3.x86_64.rpm:V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY
从 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 检索密钥
导入 GPG key 0xF4A80EB5:
 用户ID     : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
 指纹       : 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
 软件包     : centos-release-7-7.1908.0.el7.centos.x86_64 (@anaconda)
 来自       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
是否继续?[y/N]:y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在更新    : binutils-2.27-41.base.el7_7.3.x86_64                        1/2 
  清理        : binutils-2.27-41.base.el7.x86_64                            2/2 
  验证中      : binutils-2.27-41.base.el7_7.3.x86_64                        1/2 
  验证中      : binutils-2.27-41.base.el7.x86_64                            2/2 

更新完毕:
  binutils.x86_64 0:2.27-41.base.el7_7.3                                        

完毕!

5.关闭防火墙

sudo systemctl stop firewalld 临时关闭
sudo systemctl disable firewalld ,然后reboot 永久关闭
sudo systemctl status firewalld 查看防火墙状态。

[root@localhost data]# systemctl stop firewalld
[root@localhost data]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost data]# systemctl status  firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)

405 19:33:46 localhost systemd[1]: Starting firewalld - dynamic firewal.....
405 19:33:46 localhost systemd[1]: Started firewalld - dynamic firewall...n.
405 22:21:16 localhost systemd[1]: Stopping firewalld - dynamic firewal.....
405 22:21:17 localhost systemd[1]: Stopped firewalld - dynamic firewall...n.
Hint: Some lines were ellipsized, use -l to show in full.

6.关闭selinux(修改内容自已看)

[root@localhost data]# vi /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=enforcing     #此处修改为disabled
# SELINUXTYPE= can take one of three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

7.修改内核参数(图片仅供参考可跳过直接看代码)
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
太多了我就不一一展示了直接上

[root@localhost data]# vi /etc/sysctl.conf

# 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).
--------------添加内容----------------
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
--------------添加内容----------------
~                             

使配置参数生效(sysctl -p)

[root@localhost data]# sysctl -p
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

8.对orcale用户设置限制,提高软件运行性能
参考文档
在这里插入图片描述

[root@localhost data]# vi /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
oracle soft stack 10240#这两个不在参考里面但是安装会出错所以加进去了
oracle hard stack 10240#这两个不在参考里面但是安装会出错所以加进去了
------------------增加内容--------------------
# End of file

9.配置用户的环境变量(看文档意思是如果没设置就会按照Oracle默认的设置)

[root@localhost data]# vi /home/oracle/.bash_profile
# .bash_profile 

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin
--------------------增加内容-------------------
export PATH
export ORACLE_BASE=/data/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/db_1
export ORACLE_SID=orcl
export ORACLE_TERM=xterm
export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export LANG=C
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
--------------------增加内容-------------------
~                                

使配置立即生效

[root@localhost data]# source /home/oracle/.bash_profile

10.上传安装包
查看IP地址(192.168.1.3)我的是NAT

[root@localhost data]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.3  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::af5a:e9f4:ece5:a327  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:6b:77:49  txqueuelen 1000  (Ethernet)
        RX packets 299787  bytes 444756342 (424.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0

把下载的Oracle12c上传到/data/database
打开FileZilla(绿色版的解压就可以用了)
在这里插入图片描述
像这样
然后上传就行了(也可以用vmware上传的或者其他工具)
在这里插入图片描述
11.解压安装包
切换到Oracle用户直接在系统点就行了
在这里插入图片描述
选Oracle登陆(之前我设置的密码是123456)
在这里插入图片描述
会有点小问题就是os都是英文的了
但是问题不大
打开终端
还有个小问题就是无法复制了 = =

在这里插入图片描述
在这里插入图片描述

[root@localhost oracle]#cd /data/database
[root@localhost database]#unzip linuxx64_12201_database.zip 
[root@localhost database]# chown -R oracle:oinstall /data/database/database

正式安装oracle
跳转到database目录下

cd /data/database/database
su oracle #切换回Oracle用户
./runInstaller#开始安装

在这里插入图片描述
接下来就是跟windows下安装差不多了

四、开始安装Oracle12c

就不过多赘述了直接看图行事

1.取消那个勾点击下一步(弹框点yes)
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

密码规则是大小写等这里密码为(Oracle123)
在这里插入图片描述
在这里插入图片描述
检查
这里有个小插曲
你会发现到这里还是有问题还是有错误
在这里插入图片描述
不要慌,这里是12c的一个小bug,官方有给出解决办法
在这里插入图片描述
按照fix的操作后关掉安装客户端并且关机重启后再次安装就不会有问题了,而且这个问题将在下个版本解决
现在开始解决
在这里插入图片描述
点击这个,按照他说的做
在这里插入图片描述
打开一个终端
用root权限运行它的脚本(如下图)
脚本复制就行了,在上面有
在这里插入图片描述
运行后点击ok
再点击
在这里插入图片描述
你会发现刚才的问题解决了(感觉可以不用重启)(我错了,回来更新,要重启,虽然后面的问题不知道是不是这个原因)
下面还有两个问题是我没有升级所需的包所以报错了如果之前那些必须的包有一条一条检查更新就不会有这两个问题了
所以现在更新一下(像下面一样,缺什么装什么)
因为我这里只缺这两个包(包名在那个框里有写)
在这里插入图片描述
在这里插入图片描述
完成后再点这个
在这里插入图片描述
你就会发现跳到这个页面了
在这里插入图片描述
说明快要好了
点击install就ok啦!!!!!!中途好像会弹个什么框
在这里插入图片描述
按照它说的做就ok啦这步我就不做了

ins-20802错误

最后有个小插曲
ins-20802错误
输入三行命令
yum install libaio -y
/etc/init.d/network restart
service NetworkManager restart

yum install libaio -y
[oracle@localhost ~]$ su
Password: 
[root@localhost oracle]# /etc/init.d/net
netconsole  network     
[root@localhost oracle]# /etc/init.d/network restart
Restarting network (via systemctl):                        [  OK  ]
[root@localhost oracle]# service NetworkManager restart
Redirecting to /bin/systemctl restart NetworkManager.service
[root@localhost oracle]# 

然后点击这个Retry
在这里插入图片描述
最后安装成功
在这里插入图片描述

完结撒花★,°:.☆( ̄▽ ̄)/$:.°★
好像这些设置好了安装的时候就不会让我们设置了
不知道
没试过感兴趣的可以去试一下
那样可以的话好像简单点
https://blog.csdn.net/weixin_33929309/article/details/85954785
这是我找的过程中看到的一篇
接下来就是访问啦
记得一开始设置网络的主机地址的名字吗
我是localhost
还有要在数据库打开端口才能进oem
这篇就只讲安装了,下次再详细记录

参考文章

https://blog.csdn.net/shaun17/article/details/77962613

  • 3
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值