RHEL5.6安装Oracle11g
如果未安装完全会显示XXX is not installed,这个时候可以通过挂在RHEL5.4的光盘或镜像,在Server文件夹里寻找相应的RPM包安装。
1.在安装oracle之前,用命令检查必需的RPM软件包有没有安装
[oracle@localhost 11g]$ rpm -q elfutils-libelfelfutils-libelf-develgccgcc-c++ glibcglibc-common kernel-headers kshlibaiolibaio-devellibgcclibgomplibstdc++ numactl-develsysstatunixODBCunixODBC-devel
binutils-2.17.50.0.6-14.el5
packagecompat-libstdc++-33 is not installed elfutils-libelf-0.137-3.el5
packageelfutils-libelf-devel is not installed gcc-4.1.2-50.el5 gcc-c++-4.1.2-50.el5 glibc-2.5-58 glibc-2.5-58
glibc-common-2.5-58 glibc-devel-2.5-58 glibc-headers-2.5-58
kernel-headers-2.6.18-238.el5 ksh-20100202-1.el5_5.1 libaio-0.3.106-5 libaio-0.3.106-5
packagelibaio-devel is not installed libgcc-4.1.2-50.el5 libgcc-4.1.2-50.el5 libgomp-4.4.4-13.el5 libgomp-4.4.4-13.el5 libstdc++-4.1.2-50.el5 libstdc++-4.1.2-50.el5
libstdc++-devel-4.1.2-50.el5 make-3.81-3.el5
packagenumactl-devel is not installed packagesysstat is not installed packageunixODBC is not installed
packageunixODBC-devel is not installed
binutilscompat-libstdc++-33 glibc-develglibc-headers libstdc++-devel make 2. 安装相关依赖包
[root@localhost ~]# yum -y install unixODBC.x86_64 [root@localhost ~]# yum list | grepunixODBC*
[root@localhost ~]# yum -y install unixODBC-devel.x86_64 [root@localhost ~]# yum list | grepsysstat* [root@localhost ~]# yum -y install sysstat*
[root@localhost ~]# yum list | grepnumactl-devel
[root@localhost ~]# yum -y install numactl-devel.x86_64 [root@localhost ~]# yum list | greplibaio-devel*
[root@localhost ~]# yum -y install libaio-devel.x86_64 [root@localhost ~]# yum list | grepcompat-libstdc++-33*
[root@localhost ~]# yum -y install compat-libstdc++-33.x86_64 [root@localhost ~]# yum -y install elfutils-libelf-devel*
3. 建立oracle系统用户和安装目录
#创建一个主组oracle和一个副组dba [root@localhost ~]# groupaddoinstall [root@localhost ~]# groupadddba #创建oracle安装文件夹
[root@localhost ~]# mkdir -p /oracle
#添加一个oracle用户,根目录是 /oracle,主的组是oinstall副的组是dba [root@localhost ~]# useradd -g oinstall -G dba -d /oracle oracle #拷贝包含环境变量的文件到安装目录下,这个之后会用到 [root@localhost ~]# cp /etc/skel/.bash_profile /oracle [root@localhost ~]# cp /etc/skel/.bashrc /oracle
[root@localhost ~]# cp /etc/skel/.bash_logout /oracle #为oracle用户设置密码 oracle [root@localhost ~]# passwd oracle #设置安装目录用户权限
[root@localhost ~]# chown -R oracle:oinstall /oracle #检查 nobody 是否存在 [root@localhost ~]# id nobody
#缺省存在的,会显示nobody的uid、gid和groups,默认都是99。如果不存在可以输入以下命令
[root@localhost ~]# /usr/sbin/useradd -g nobody
3. 修改内核参数
#在sysctl.conf这个文件中加入以下内容,我加在文件的末尾 [root@localhost ~]# vi /etc/sysctl.conf
fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 2097152 kernel.shmmax = 536870912 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
4.设置oracle用户的shell limit
#在limits.conf中加入以下内容,同样放在末尾,如图所示 [root@localhost ~]# vi /etc/security/limits.conf oracle soft nproc 2047 oracle hard nproc16384 oracle soft nofile1024
oracle hard nofile 65536
#增加下面的内容到文件 /etc/pam.d/login 中,使shell limit生效 [root@localhost ~]# vi /etc/pam.d/login session required pam_limits.so
5.设置oracle 用户环境变量 #首先切换到oracle用户下 [root@localhost ~]#su – oracle
[oracle@localhost ~]$ vim .bash_profile
#在隐藏的.bash_profile文件中,将原有的环境变量删除,加入以下环境变量,注意自己的根目录位置
ORACLE_BASE=/oracle
ORACLE_HOME=$ORACLE_BASE/oracle ORACLE_SID=DATA
PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH
6. 将oracle安装包解压后上传到linux中,准备开始安装
#oracle11g201_linux.x64官方的安装包分两个文件,解压缩后会有一个database文件夹,把这个文件夹拷过去就可以了。
[oracle@localhost 11g]$ unzip oracle11g201_linux.x64_database_1of2.zip
#切换到root用户在usr目录下创建oracle_install [root@localhost ~]# mkdir /usr/oracle_install
#具体过程不再描述。复制完成后,改变oracle用户访问安装包的权限 [root@localhost ~]# chown -R oracle:oinstall /usr/oracle_install/
这里注意一下,如果是用root用户通过su切换到oracle用户的话,在“检查监视器”这一项可能无法通过,会显示以下警告
检查监视器: 监视器配置至少必须显示 256 种颜色
>>>无法使用命令 /usr/bin/xdpyinfo自动检查显示器颜色。请检查是否设置了 DISPLAY 变量。未通过<<<<
未通过某些要求检查。必须先满足这些要求, 然后才能继续安装,那时将重新检查这些要求。 是否继续? (y/n) [n] y
因此注销或重启后用oracle用户登录最为保险。
#必须要是图形界面安装才不会出现如下错误
#注销root用户,改用oracle用户登录,来到database文件夹下,开始安装 [oracle@localhost database]$ ./runInstaller
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB. Actual 12584 MB Passed Checking swap space: must be greater than 150 MB. Actual 2015 MB Passed Checking monitor: must be configured to display at least 256 colors
>>> Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set. Failed <<<<
Some requirement checks failed. You must fulfill these requirements before
continuing with the installation,
Continue? (y/n) [n] y
>>> Ignoring required pre-requisite failures. Continuing...
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2015-12-18_01-21-35PM. Please wait ...
Invalid source path '../stage/Components/oracle.jdk/1.5.0.17.0/1/DataFiles' specified for unzip. Unzip command failed. Please check oraparam.ini and specify a valid source path. : No such file or directory
[oracle@localhost database]$ DISPLAY=192.168.168.128:0.0 [oracle@localhost database]$ export DISPLAY
#图形化界面安装
[oracle@localhost database]$ ./runInstaller
7. 安装过程
这时候不出意外的话会弹出oracle 11g的图形安装界面,现在根据图形界面的提示一步一步安装吧