史上最详细最全的Linux上安装Oracle的教程 (2)

8)配置oracle用户的环境变量,首先,切换到新创建的oracle用户下,
输入:su – oracle ,然后直接在输入 : vi .bash_profile
按i编辑 .bash_profile,进入编辑模式,增加以下内容:

export ORACLE_BASE=http://www.likecs.com/home/oracle/app

export ORACLE_HOME=$ORACLE_BASE/oracle/product/11.2.0/dbhome_1

export ORACLE_SID=orcl

export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib

编辑完成后按Esc键,输入“:wq”存盘退出

ps:我的云服务器没有防火墙,如果你们有,可以关闭
--关闭防火墙 CentOS 7.2默认使用的是firewall作为防火墙

[humf@localhost /]$ su root
Password:
[root@localhost /]# systemctl status firewalld.service  #查看防火墙状态,运行中
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2016-04-07 18:54:29 PDT; 2h 20min ago
Main PID: 802 (firewalld)
CGroup: /system.slice/firewalld.service
└─802 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid


Apr 07 18:54:25 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
Apr 07 18:54:29 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
[root@localhost /]# systemctl stop firewalld.service  #关闭防火墙
[root@localhost /]# systemctl status firewalld.service  #再次查看防火墙状态,发现已关闭
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Thu 2016-04-07 21:15:34 PDT; 9s ago
Main PID: 802 (code=exited, status=0/SUCCESS)


Apr 07 18:54:25 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
Apr 07 18:54:29 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
Apr 07 21:15:33 localhost systemd[1]: Stopping firewalld - dynamic firewall daemon...
Apr 07 21:15:34 localhost systemd[1]: Stopped firewalld - dynamic firewall daemon.
[root@localhost /]# 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@localhost /]#

防火墙先禁用,搞好之后再配置,个人虚拟机,要毛线防火墙~~

6.关闭selinux(需重启生效)

[root@localhost /]# vi /etc/selinux/config
[root@localhost /]# cat /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 #此处修改为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


[root@localhost /]#


为啥要关闭selinux?因为selinux太高深,非专业人士搞不懂~~


二、正式Oracle的安装过程


1)当上述系统要求操作全部完成后,注销系统,在图形界面以Oracle用户登陆。


PS:对于不会用图形界面的这边教你怎么用Windows远程连接Oracle图形界面
   前提: 
2.1.1 CentOS已经安装桌面,如果无桌面,请执行 (yum不会的可以百度,这边不赘述了)
# yum -y groups install "GNOME Desktop"
# startx
2.1.2 配置源
<span> </span># yum install epel* -y
2.1.3 安装xrdp
<span><span> </span> </span># yum --enablerepo=epel -y install xrdp
2.1.4 启动xrdp并设置开机启动
<span> </span># systemctl start xrdp
# systemctl enable xrdp

2.1.5 打开Windows的远程工具输入服务器IP用Oracle账户登陆就行


首先将下载的Oracle安装包复制到linux中,用SSH其他ftp工具拷贝。
打开一个终端,运行unzip命令解压oracle安装文件,如:
输入命令:

unzip linux.x64_11gR2_database_1of2.zip

unzip linux.x64_11gR2_database_2of2.zip


解压完成后 cd 进入其解压后的目录database
输入命令:
cd database

使用ls命令可以查看解压后database所包含的文件,如下图:

2)执行安装,输入命令:./runInstaller

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zwywfj.html