RHEL6安装ORACLE 11g
安装RHEL6系统所必须选择的软件包:
- Base System > Base
- Base System > Client management tools
- Base System > Compatibility libraries
- Base System > Hardware monitoring utilities
- Base System > Large Systems Performance
- Base System > Network file system client
- Base System > Performance Tools
- Base System > Perl Support
- Servers > Server Platform
- Servers > System administration tools
- Desktops > Desktop
- Desktops > Desktop Platform
- Desktops > Fonts
- Desktops > General Purpose Desktop
- Desktops > Graphical Administration Tools
- Desktops > Input Methods
- Desktops > X Window System
- Development > Additional Development
- Development > Development Tools
-
Applications > Internet Browser
所需要准备的解压包以及软件包如下:
p10404530_112030_Linux-x86-64_1of7.zip
p10404530_112030_Linux-x86-64_2of7.zip
pdksh-5.2.14-30.x86_64.rpm
pdksh-5.2.14-37.el5_8.1.i386.rpm
rlwrap-0.42-1.el6.x86_64.rpm
![](https://img2020.cnblogs.com/blog/2163941/202009/2163941-20200923110109298-1484694574.png)
![](https://img2020.cnblogs.com/blog/2163941/202009/2163941-20200923110143752-550771547.png)
![](https://img2020.cnblogs.com/blog/2163941/202009/2163941-20200923110216633-242919066.png)
![](https://img2020.cnblogs.com/blog/2163941/202009/2163941-20200923110259913-1594918137.png)
![](https://img2020.cnblogs.com/blog/2163941/202009/2163941-20200923111431913-860728478.png)
![](https://img2020.cnblogs.com/blog/2163941/202009/2163941-20200923110359093-1825077371.png)
![](https://img2020.cnblogs.com/blog/2163941/202009/2163941-20200923110422212-1050443606.png)
![](https://img2020.cnblogs.com/blog/2163941/202009/2163941-20200923110432084-1238384649.png)
![](https://img2020.cnblogs.com/blog/2163941/202009/2163941-20200923110439527-867403018.png)
![](https://img2020.cnblogs.com/blog/2163941/202009/2163941-20200923110445923-684859296.png)
![](https://img2020.cnblogs.com/blog/2163941/202009/2163941-20200923110519156-906284824.png)
安装步骤:
unzip p10404530_112030_Linux-x86-64_1of7.zip
unzip p10404530_112030_Linux-x86-64_2of7.zip
vi /etc/hosts
添加:
192.168.6.20 racnode2
vi /etc/sysctl.conf
添加:
fs.suid_dumpable = 1 fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 2097152 kernel.shmmax = 2001405952 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
vi /etc/security/limits.conf
添加:
oracle soft nproc 16384 oracle hard nproc 16384 oracle soft nofile 4096 oracle hard nofile 65536 oracle soft stack 10240
mount /dev/sr0 /mnt
cd /mnt/Packages
rpm -Uvh ksh-*x86_64*
rpm -Uvh binutils-2*x86_64*
rpm -Uvh glibc-2*x86_64* nss-softokn-freebl-3*x86_64*
rpm -Uvh glibc-2*i686* nss-softokn-freebl-3*i686*
rpm -Uvh compat-libstdc++-33*x86_64*
rpm -Uvh glibc-common-2*x86_64*
rpm -Uvh glibc-devel-2*x86_64*
rpm -Uvh glibc-devel-2*i686*
rpm -Uvh glibc-headers-2*x86_64*
rpm -Uvh elfutils-libelf-0*x86_64*
rpm -Uvh elfutils-libelf-devel-0*x86_64*
rpm -Uvh gcc-4*x86_64*
rpm -Uvh gcc-c++-4*x86_64*
rpm -Uvh libaio-0*x86_64*
rpm -Uvh libaio-devel-0*x86_64*
rpm -Uvh libaio-0*i686*
rpm -Uvh libaio-devel-0*i686*
rpm -Uvh libgcc-4*x86_64*
rpm -Uvh libgcc-4*i686*
rpm -Uvh libstdc++-4*x86_64*
rpm -Uvh libstdc++-4*i686*
rpm -Uvh libstdc++-devel-4*x86_64*
rpm -Uvh make-3.81*x86_64*
rpm -Uvh numactl-devel-2*x86_64*
rpm -Uvh sysstat-9*x86_64*
rpm -Uvh compat-libstdc++-33*i686*
rpm -Uvh compat-libcap*
cd /
eject
groupadd -g 501 oinstall
groupadd -g 502 dba
groupadd -g 503 oper
groupadd -g 504 asmadmin
groupadd -g 506 asmdba
groupadd -g 505 asmoper
useradd -u 502 -g oinstall -G dba,asmdba,oper oracle
passwd oracle
vi /etc/security/limits.d/90-nproc.conf
修改:
# Change this
* soft nproc 1024
# To this
* - nproc 16384
vi /etc/sysconfig/selinux
###将selinux修改为disabled
setenforce 0
getenforce
service iptables stop
chkconfig iptables off
mkdir -p /u01/app/oracle/product/11.2.0/db_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01
xhost + 192.168.6.1
###192.168.6.1:想要把服务器图形界面显示到哪个主机上,就写哪个ip地址
###如果使用的是xmanager需要打开Passive,再执行xhost命令
oracle操作:
vi .bash_profile
添加:
# Oracle Settings TMP=/tmp; export TMP TMPDIR=$TMP; export TMPDIR ORACLE_HOSTNAME=racnode2; export ORACLE_HOSTNAME ORACLE_UNQNAME=ORCL; export ORACLE_UNQNAME ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME ORACLE_SID=ORCL; export ORACLE_SID PATH=/usr/sbin:$PATH; export PATH PATH=$ORACLE_HOME/bin:$PATH; export PATH LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
source .bash_profile
DISPLAY=192.168.6.1:0.0; export DISPLAY
/software/database/runInstaller
###此目录为解压oracle11g解压包的目录
![](https://img2020.cnblogs.com/blog/2163941/202009/2163941-20200923110109298-1484694574.png)
![](https://img2020.cnblogs.com/blog/2163941/202009/2163941-20200923110143752-550771547.png)
![](https://img2020.cnblogs.com/blog/2163941/202009/2163941-20200923110150347-1426018059.png)
![](https://img2020.cnblogs.com/blog/2163941/202009/2163941-20200923110216633-242919066.png)
![](https://img2020.cnblogs.com/blog/2163941/202009/2163941-20200923110253548-1505221956.png)
![](https://img2020.cnblogs.com/blog/2163941/202009/2163941-20200923110259913-1594918137.png)
![](https://img2020.cnblogs.com/blog/2163941/202009/2163941-20200923111431913-860728478.png)
![](https://img2020.cnblogs.com/blog/2163941/202009/2163941-20200923110359093-1825077371.png)
![](https://img2020.cnblogs.com/blog/2163941/202009/2163941-20200923110422212-1050443606.png)
![](https://img2020.cnblogs.com/blog/2163941/202009/2163941-20200923110432084-1238384649.png)
![](https://img2020.cnblogs.com/blog/2163941/202009/2163941-20200923110439527-867403018.png)
![](https://img2020.cnblogs.com/blog/2163941/202009/2163941-20200923110445923-684859296.png)
![](https://img2020.cnblogs.com/blog/2163941/202009/2163941-20200923110519156-906284824.png)
![](https://img2020.cnblogs.com/blog/2163941/202009/2163941-20200923110525506-1256170010.png)
安装数据库
[oracle@racnode2 database]$ dbca
测试登录:
[oracle@racnode2 database]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Sat Mar 7 00:53:43 2020
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> show user
USER is "SYS"
若想要远程连接数据库,就需要配置监听程序,如何配置监听请查看“Oracle创建监听程序”笔记。
安装rlwrap(sql语句可以↑↓查找历史语句)
[root@racnode2 software]# rpm -ivh rlwrap-0.42-1.el6.x86_64.rpm
[oracle@racnode2 ~]$ vi .bash_profile
添加 alias sqlplus='rlwrap sqlplus'
[oracle@racnode2 ~]$ source .bash_profile
添加开机自启oracle数据库
[root@racnode2 software]# vi /etc/oratab
修改 ORCL:/u01/app/oracle/product/11.2.0/db_1:Y
添加数据库连接提示符(效果如下图)
cd $ORACLE_HOME/sqlplus/admin
vi glogin.sql
添加:
set linesize 120; set pagesize 200; define _editor=vi set sqlprompt "_user'@'_connect_identifier> "
然后重新登录即可