1、准备工作
1.1、虚拟机准备
#配置静态IP
#因为我这里的虚拟机网络模式是桥接模式,所以在配置的时候,一定要注意虚拟机的IP网段要你和主机保持#一致
#主机的IP可以通过运行命令:ipconfig /all 进行查询
[root@linux-oracle1 ~]# vim /etc/sysconfig/network-scripts/ifcfg-enp0s3
TYPE="Ethernet"
BOOTPROTO="static"
DEFROUTE="yes"
PEERDNS="yes"
PEERROUTES="yes"
IPADDR="192.168.100.88"
GATEWAY="192.168.100.1"
NETMASK="255.255.255.0"
DNS1="202.96.128.86"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="enp0s3"
UUID="41947f86-52f0-41d7-b5e1-767a77373e9e"
DEVICE="enp0s3"
ONBOOT="yes"
#以上是我的虚拟机配置,可以参考。GATEWAY、NETMASK及DNS1(为了能上网)这些和主机的默认网关、子#网掩码和DNS保持一次,只是IPADDR和主机做区分,例如我的主机IP为192.168.100.80,虚拟机的IP我这#里设置了192.168.100.88
#重启网络,让配置生效
[root@linux-oracle1 ~]# service network restart
Restarting network (via systemctl): [ 确定 ]
#这里静态IP就配置完成了!
#配置主机名
[root@Linux-init ~]# hostnamectl set-hostname 主机名
例如:hostnamectl set-hostname Linux-oracle1
退出后重新登录,就可以看到主机名已经生效
#配置hosts
[root@linux-oracle1 ~]# vim /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.100.88 Linux-oracle1
#把虚拟机IP和主机名的映射关系写在配置文件最后一行
复制
1.2、系统环境准备
#关闭Selinux
[root@linux-oracle1 ~]# 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改成disabled
#关闭防火墙
[root@linux-oracle1 ~]# systemctl stop firewalld.service
[root@linux-oracle1 ~]# systemctl disable firewalld.service
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
#优化系统内核
[root@linux-oracle1 ~]# vim /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).
net.ipv4.ip_local_port_range= 9000 65500
fs.file-max = 6815744
kernel.shmall = 10523004
kernel.shmmax = 6465333657
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default=262144
net.core.wmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_max=1048576
fs.aio-max-nr = 1048576
[root@linux-oracle1 ~]# sysctl -p
net.ipv4.ip_local_port_range = 9000 65500
fs.file-max = 6815744
kernel.shmall = 10523004
kernel.shmmax = 6465333657
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
复制
2、安装数据库
#安装依赖
[root@linux-oracle1 ~]# yum -y install gcc gcc-c++ make binutilscompat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-commonglibc-devel libaio libaio-devel libgcclibstdc++ libstdc++-devel unixODBC unixODBC-devel
#创建用户和组
[root@linux-oracle1 ~]# groupadd -g 200 oinstall
[root@linux-oracle1 ~]# groupadd -g 201 dba
[root@linux-oracle1 ~]# useradd -u 440 -g oinstall -G dba oracle
[root@linux-oracle1 ~]# passwd oracle
更改用户 oracle 的密码 。
新的 密码:
无效的密码:密码包含用户名在某些地方
重新输入新的 密码:
passwd:所有的身份验证令牌已经成功更新。
#修改系统资源限制
[root@linux-oracle1 ~]# vim /etc/security/limits.conf #末尾添加如下
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
[root@linux-oracle1 ~]# vim /etc/pam.d/login
session required pam_namespace.so #在该行下面添加
session required pam_limits.so
#创建安装目录及设置权限
[root@linux-oracle1 ~]# mkdir /opt/oracle/app/ -p
[root@linux-oracle1 ~]# mkdir /opt/oracle/oradata/
[root@linux-oracle1 ~]# chmod 755 /opt/oracle/
[root@linux-oracle1 ~]# chmod 775 /opt/oracle/app/
[root@linux-oracle1 ~]# chown oracle.oinstall -R /opt/oracle/
#切换到Oracle用户,通过rz命令将安装介质上传到服务器。也可以通过其他软件(例如:winscp、sftp等)
#如果没有rz命令可以用root用户通过yum -y install lrzsz命令来安装
[root@linux-oracle1 ~]# su - oracle
[oracle@linux-oracle1 ~]$ cd /opt/oracle/
[oracle@linux-oracle1 oracle]$ rz
[oracle@linux-oracle1 oracle]$ ll
总用量 2487200
drwxrwxr-x. 2 oracle oinstall 6 1月 19 09:55 app
drwxr-xr-x. 2 oracle oinstall 6 1月 19 09:55 oradata
-rw-r--r--. 1 oracle oinstall 1395582860 10月 10 2016 p13390677_112040_Linux-x86-64_1of7.zip
-rw-r--r--. 1 oracle oinstall 1151304589 10月 10 2016 p13390677_112040_Linux-x86-64_2of7.zip
#解压
[oracle@linux-oracle1 oracle]$ unzip p13390677_112040_Linux-x86-64_1of7.zip
[oracle@linux-oracle1 oracle]$ unzip p13390677_112040_Linux-x86-64_2of7.zip
[oracle@linux-oracle1 oracle]$ ll
总用量 2487200
drwxrwxr-x. 2 oracle oinstall 6 1月 19 09:55 app
drwxr-xr-x. 7 oracle oinstall 136 8月 27 2013 database
drwxr-xr-x. 2 oracle oinstall 6 1月 19 09:55 oradata
-rw-r--r--. 1 oracle oinstall 1395582860 10月 10 2016 p13390677_112040_Linux-x86-64_1of7.zip
-rw-r--r--. 1 oracle oinstall 1151304589 10月 10 2016 p13390677_112040_Linux-x86-64_2of7.zip
#我们可以看到当前目录下生成了一个叫database的目录
#设置oracle环境变量,oracle用户下执行
[oracle@linux-oracle1 ~]$ vi ~/.bash_profile #末尾添加如下内容:
export ORACLE_BASE=/opt/oracle/app
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_PID=orcl
export ORACLE_SID=orcl
[oracle@linux-oracle1 ~]$ source ~/.bash_profile #立即生效
#掉图形界面开始安装
#安装xhost
[root@linux-oracle1 ~]# yum whatprovides "*/xhost"
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirror.bit.edu.cn
extras/7/x86_64/filelists_db | 207 kB 00:00:00
updates/7/x86_64/filelists_db | 3.5 MB 00:00:02
xorg-x11-server-utils-7.7-20.el7.x86_64 : X.Org X11 X server utilities
源 :base
匹配来源:
文件名 :/usr/bin/xhost
[root@linux-oracle1 ~]# yum install xorg-x11-server-utils-7.7-20.el7.x86_64 #安装的包名根据上一步执行结果不同而不同
#此时我们发现执行xhost + 命令还是有报错。如下:
[root@linux-oracle1 ~]# export DISPLAY=linux-oracle1:1
[root@linux-oracle1 ~]# xhost +
xhost: unable to open display "linux-oracle1:1"
#我可以通过安装vnc服务来解决
[root@linux-oracle1 ~]# yum install tigervnc-server
#启动vnc服务
[root@linux-oracle1 ~]# vncserver
You will require a password to access your desktops.
Password:
Verify:
Would you like to enter a view-only password (y/n)? y
Password:
Verify:
xauth: file /root/.Xauthority does not exist
New 'linux-oracle1:1 (root)' desktop is linux-oracle1:1
Creating default startup script /root/.vnc/xstartup
Creating default config /root/.vnc/config
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/linux-oracle1:1.log
#再次执行xhost +
[root@linux-oracle1 ~]# export DISPLAY=linux-oracle1:1
[root@linux-oracle1 ~]# xhost +
access control disabled, clients can connect from any host
#此时我们看到的输出结果就正常了。
#为了方便Xmanager调用图形界面。我们需要安装xterm
[root@linux-oracle1 ~]# yum install xterm
复制
#通过Xmanager工具调用图形界面安装Oracle,打开套件中的Xstart,如下图所示:
#在上图所在的页面再次执行xhost +
[root@linux-oracle1 ~]# export DISPLAY=linux-oracle1:1
[root@linux-oracle1 ~]# xhost +
access control disabled, clients can connect from any host
复制
命令执行后的效果如下图:
此时,我们看到调出来的图形界面是乱码,如下图:
3、开始图形界面安装
复制
文章转载自WorkLifeRecords,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
相关阅读
【纯干货】Oracle 19C RU 19.27 发布,如何快速升级和安装?
Lucifer三思而后行
786次阅读
2025-04-18 14:18:38
Oracle RAC 一键安装翻车?手把手教你如何排错!
Lucifer三思而后行
664次阅读
2025-04-15 17:24:06
Oracle数据库一键巡检并生成HTML结果,免费脚本速来下载!
陈举超
592次阅读
2025-04-20 10:07:02
【ORACLE】你以为的真的是你以为的么?--ORA-38104: Columns referenced in the ON Clause cannot be updated
DarkAthena
548次阅读
2025-04-22 00:13:51
【活动】分享你的压箱底干货文档,三篇解锁进阶奖励!
墨天轮编辑部
532次阅读
2025-04-17 17:02:24
【ORACLE】记录一些ORACLE的merge into语句的BUG
DarkAthena
510次阅读
2025-04-22 00:20:37
一页概览:Oracle GoldenGate
甲骨文云技术
497次阅读
2025-04-30 12:17:56
火焰图--分析复杂SQL执行计划的利器
听见风的声音
471次阅读
2025-04-17 09:30:30
OR+DBLINK的关联SQL优化思路
布衣
382次阅读
2025-05-05 19:28:36
3月“墨力原创作者计划”获奖名单公布
墨天轮编辑部
382次阅读
2025-04-15 14:48:05