环境准备
安装包:
CentOS-7-x86_64-DVD linux.x64_11gR2_database_1of2.zip linux.x64_11gR2_database_2of2.zip本教程是在VMware下安装的,注意设置内存的时候,不要设置动态内存。
安装Oracle前准备
创建运行oracle数据库的系统用户和用户组
[jonathan@localhost ~]$ su root #切换到rootPassword:[root@localhost]# groupadd oinstall #创建用户组oinstall[root@localhost]# groupadd dba #创建用户组dba[root@localhost]# useradd -g oinstall -g dba -m oracle #创建oracle用户,并加入到oinstall和dba用户组[root@localhost]# passwd oracle #设置用户oracle的登陆密码,不设置密码,在CentOS的图形登陆界面没法登陆Changing password for user oracle.New password: # 密码BAD PASSWORD: The password is shorter than 8 charactersRetype new password: # 确认密码passwd: all authentication tokens updated successfully.[root@localhost]# id oracle # 查看新建的oracle用户uid=1001(oracle) gid=1002(dba) groups=1002(dba)
创建oracle数据库安装目录
[jonathan@localhost ~]$ su rootPassword:[root@localhost]# mkdir -p /data/oracle #oracle数据库安装目录[root@localhost]# mkdir -p /data/oraInventory #oracle数据库配置文件目录[root@localhost]# mkdir -p /data/database #oracle数据库软件包解压目录[root@localhost]# cd /data[root@localhost data]# ls #创建完毕检查一下(强迫症)database oracle oraInventory[root@localhost data]# chown -R oracle:oinstall /data/oracle #设置目录所有者为oinstall用户组的oracle用户[root@localhost data]# chown -R oracle:oinstall /data/oraInventory[root@localhost data]# chown -R oracle:oinstall /data/database[root@localhost data]#
修改OS系统标识
Oracle默认不支持CentOS系统安装,Oracle Database 11g Release 2 的 OS要求参考:link
修改文件 /etc/RedHat-release
[root@localhost data]# cat /proc/versionLinux version 3.10.0-327.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) ) #1 SMP Thu Nov 19 22:10:57 UTC 2015[root@localhost data]# cat /etc/redhat-release CentOS Linux release 7.1.1503 (Core)[root@localhost data]# vi /etc/redhat-release[root@localhost data]# cat /etc/redhat-releaseredhat-7[root@localhost data]#
安装oracle数据库所需要的软件包
Oracle Database Package Requirements for Linux x86-64 如下:(参考:https://docs.oracle.com/cd/E11882_01/install.112/e47689/pre_install.htm#BABCFJFG)
复制代码 代码如下:
yum install gcc* gcc-* gcc-c++-* glibc-devel-* glibc-headers-* compat-libstdc* libstdc* elfutils-libelf-devel* libaio-devel* sysstat* unixODBC-* pdksh-*
根据具体情况去安装,上面只是提供了一个大概的内容,不是很全
关闭防火墙
CentOS 7.2默认使用的是firewall作为防火墙
[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 --nopidApr 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 /]#
新闻热点
疑难解答
图片精选