此文档在centos7.6下实际操作
oracle相关安装文件:电梯直达 密码:b9bk
一、安装前准备
1、设置计算机名及关闭防火墙
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
[root@localhost ~]# hostnamectl set-hostname oracle #设置计算机名称 重新登录即可
[root@localhost ~]# systemctl stop firewalld.service #关闭防火墙
[root@localhost ~]# systemctl disable firewalld.service #禁止防火墙开机自启
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost ~]# systemctl status firewalld.service #查看防火墙状态
● 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)
6月 04 14:13:28 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
6月 04 14:14:39 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
8月 01 13:43:36 oracle systemd[1]: Stopping firewalld - dynamic firewall daemon...
8月 01 13:43:37 oracle systemd[1]: Stopped firewalld - dynamic firewall daemon.
[root@localhost ~]# vim /etc/hosts
...
172.16.77.208 oracle #添加对应内容 不添加的话在创建监听时可能会卡住
|
2、关闭selinux
1
2
|
[root@oracle ~]# setenforce 0 #临时关闭
[root@oracle ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config #永久关闭
|
3、创建所需要的目录及用户、用户组
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
[root@oracle ~]# mkdir /u01 #创建oralce安装目录
[root@oracle ~]# groupadd oinstall #创建oinstall组
[root@oracle ~]# groupadd dba #创建dbs组
[root@oracle ~]# useradd -g oinstall -G dba -m oracle 创建oracle用户并将oracle加入oinstall为主组、dba为附属组
[root@oracle ~]#
[root@oracle ~]# groups oracle #查看oracle所在的组
oracle : oinstall dba
[root@oracle ~]# passwd oracle #给oracle设置密码 不设置的话图形化界面无法登陆
更改用户 oracle 的密码 。
新的 密码:
无效的密码: 密码少于 8 个字符
重新输入新的 密码:
passwd:所有的身份验证令牌已经成功更新。
[root@oracle ~]#
|
4、将oracle安装包解压及设置目录权限
将前面需要的oracle安装包及一些安装文件上传至/u01/下,然后再进行以下操作
1
2
3
|
[root@oracle u01]# unzip p13390677_112040_Linux-x86-64_1of7.zip && unzip p13390677_112040_Linux-x86-64_2of7.zip #解压
[root@oracle u01]# chown -R oracle:oinstall /u01/ #设置目录所属用户和组
[root@oracle u01]# chmod 775 -R /u01/ #设置目录的读写权限
|
5、修改资源限制
1
2
3
4
5
6
7
|
[root@oracle ~]# vim /etc/security/limits.conf
...
#加入以下内容
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
|
6、修改oracle用户变量
1
2
3
4
5
6
7
8
9
10
11
12
|
[root@oracle ~]# su - oracle
上一次登录:四 8月 1 14:04:47 CST 2019:1 上
[oracle@oracle ~]$ vim .bash_profile
...
#加入以下内容
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=kutebl
export PATH=$ORACLE_HOME/bin:$PATH
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
[oracle@oracle ~]$ source .bash_profile
|
7、修改系统语言
如果系统是中文的安装oracle时的窗口会是乱码,需要设置成英文
注意:如果系统是中文版本执行此步骤,是英文的话跳过
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
[root@oracle ~]# locale #查看系统语言
LANG=zh_CN.UTF-8
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
LC_ALL=
[root@oracle ~]# localectl set-locale LANG=en_US.UTF-8 #将系统设置成英文
[root@oracle ~]# export LANG=en_US.UTF-8 #写入环境变量
[root@oracle ~]# locale #再次查看系统语言
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
[root@oracle ~]#
|
然后重新登录服务器桌面会出现下图,点击update Names即可

二、安装oracle
使用oracle登录服务器桌面安装
1
2
3
4
|
[root@oracle u01]# su - oracle
Last login: Thu Aug 1 14:21:41 CST 2019 on :1
[oracle@oracle ~]$ cd /u01/database/
[oracle@oracle database]$ ./runInstaller -jreLoc /etc/alternatives/jre_1.8.0
|

订阅邮件跳过不填










使用root账户执行对应的脚本
1
|
[root@oracle ~]# /tmp/CVU_11.2.0.4.0_oracle/runfixup.sh
|
出现下图:

按提示解决以上问题
- libaio-devel和elfutils-libelf-devel可以直接用yum安装
1
2
|
[root@oracle ~]$ yum install -y libaio-devel
[root@oracle ~]$ yum install -y elfutils-libelf-devel
|
- compat-libstdc++和pdksh前面已经上传到/u01/下了,直接使用rpm安装
1
2
|
[root@oracle u01]# rpm -ivh compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
[root@oracle u01]# rpm -ivh pdksh-5.2.14-37.el5_8.1.x86_64.rpm
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
[root@oracle u01]# dd if=/dev/zero of=/swapfile bs=1024 count=1048576
1048576+0 records in
1048576+0 records out
1073741824 bytes (1.1 GB) copied, 5.87728 s, 183 MB/s
[root@oracle u01]# mkswap /swapfile
Setting up swapspace version 1, size = 1048572 KiB
no label, UUID=e338be1a-852c-444c-8108-e56428828740
[root@oracle u01]# sudo chmod 600 /swapfile
[root@oracle u01]# swapon /swapfile
[root@oracle u01]# free -h
total used free shared buff/cache available
Mem: 31G 2.1G 19G 102M 9.4G 28G
Swap: 16G 0B 16G
[root@oracle u01]# vim /etc/fstab
...
/swapfile swap swap default 0 0
|
以上操作完成再点击Check Again看到如下图没有任何异常了 点击install

安装至86%时出现以下错误:

在makefile中添加链接libnnz11库的参数
1
2
3
4
5
|
[root@oracle u01]# vim /u01/app/oracle/product/11.2.0/dbhome_1/sysman/lib/ins_emagent.mk
...
$(SYSMANBIN)emdctl:
$(MK_EMAGENT_NMECTL) -lnnz11 #后加上-lnnz11
...
|
然后回到桌面点击retry

按提示执行相关脚本 安装完成
1
2
|
[root@oracle u01]# /u01/app/oraInventory/orainstRoot.sh
[root@oracle u01]# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
|

三、安装监听
在oracle用户下执行:
1
|
[oracle@oracle ~]$ netca
|
弹出窗口后一路默认就可以
四、创建数据库
在oracle用户下执行:
1
|
[oracle@oracle ~]$ dbca
|














测试
安装完成后监听和数据库都是启动状态,可以直接使用客户端连接

Author
dylan
LastMod
2019-08-09
License
如需转载请注明文章作者和出处。谢谢!