CentOS 6.6 搭建oracle11g r2环境过程以及遇到的报错解决方案

it2025-04-23  15

CentOS 6.6 搭建oracle11g r2环境过程以及遇到的报错解决方案

文章目录

CentOS 6.6 搭建oracle11g r2环境过程以及遇到的报错解决方案一、安装前centos环境准备报错1: 二、安装报错2:报错3:报错4: 三、配置


一、安装前centos环境准备

1、全程安装过程在Xshell上进行,方便上传文件 还需要Xmanager软件,实现在XShell中显示远程服务器的图形界面 #yum install -y lrzsz

2、交换内存swap建议:内存为1GB-2GB时建议swap大小为内存大小的1.5倍;内存为2GB-16GB时建议swap大小为内存的大小;内存超过16GB时swap保持16GB。这里是虚拟机交换内存就设为4GB,swap分区的内存也为4G。 #cat /proc/swaps 检查硬盘分区: #df -l

3、关闭服务 编辑SELinux配置文件 vim /etc/selinux/config,将SELINUX的值设为 disabled,如下: SELINUX=disabled; 修改该文件可使重启系统后不启动SELinux。关闭当前已开启的SELinux使用如下命令: #setenforce 0 4、安装依赖组件包 4.1需要 X window 等图形界面 #yum -y groupinstall “Desktop” “X Window System”

4.2安装以下组件 #yum -y install binutils compat-libstdc+±33 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc gcc-c++ libaio-devel libaio libgcc libstdc++ libstdc+±devel make sysstat unixODBC unixODBC-devel pdksh numactl-devel glibc-headers --setopt=protected_multilib=false

#rpm -ivh pdksh-5.2.14-37.el5_8.1.x86_64.rpm --force --nodeps (自己下载安装包,该程序包未被纳入CentOS的安装盘中)

5、调整内核参数 #vi /etc/sysctl.conf

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 = 1048576 fs.aio-max-nr = 1048576

让内核参数生效: #sysctl –p

报错1:

执行报错如下:

error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key error: "net.bridge.bridge-nf-call-iptables" is an unknown key error: "net.bridge.bridge-nf-call-arptables" is an unknown key

执行下面的命令,再执行就不报错了 #modprobe bridge 修改limits.conf #vi /etc/security/limits.conf

#oracle settings oracle soft nproc 16384 oracle hard nproc 16384 oracle soft nofile 65536 oracle hard nofile 65536

修改配置文件/etc/pam.d/login #vi /etc/pam.d/login

#添加以下内容: session required /lib/security/pam_limits.so session required pam_limits.so

修改配置文件/etc/profile #vi /etc/profile

#添加以下内容: if [ $USER = "oracle" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi fi

修改配置文件/etc/csh.login #vi /etc/csh.login

#添加以下内容: if ( $USER == "oracle" ) then limit maxproc 16384 limit deors 65536 endif

6、创建Oracle用户

groupadd oinstall groupadd dba useradd -g oinstall -G dba oracle passwd oracle 1234@qweR mkdir -p /oracleData/oracle mkdir -p /oracleData/oralnventory mkdir -p /oracleData/software chown -R oracle:oinstall /oracleData/oracle chown -R oracle:oinstall /oracleData/software chown -R oracle:oinstall /oracleData/oralnventory

设置用户环境变量 #su - oracle $ vi .bash_profile

#添加以下内容: ORACLE_SID=orcl; export ORACLE_SID ORACLE_BASE=/oracleData/oracle; export ORACLE_BASE ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin; export PATH

保存退出后执行如下命令使以上设置立即生效: $ source /home/oracle/.bash_profile

二、安装

安装包下载链接: https://www.oracle.com/database/technologies/oracle-database-software-downloads.html zLinux的安装版本只适用于IBM硬件架构,而我们个人计算机的CPU一般都是Intel的CPU,如果要在Intel的CPU上安装Oracle要下载这个版本,就是我上面给的下载链接中的11.2.0.1.0的版本Linux x84-64是要下载这个版本的Oracle才能安装在Intel的硬件架构上。

1、将安装包上传到/oracleData/software文件下,并解压 #unzip linux.x64_11gR2_database_1of2.zip #unzip linux. x64_11gR2_database_2of2.zip

2、在root用户下的/oracleData/software/database目录下执行 (xhost命令是X服务器的访问控制工具,用来控制那些X客户端能够在X服务器上显示。) #xhost + #xhost + localhost

3、在oracle用户下进行运行安装

===================================================

报错2:

发现错误:

% xhost + To test that the DISPLAY environment variable is set correctly, run a X11 based program that comes with the native operating system such as 'xclock': % <full path to xclock.. see below> If you are not able to run xclock successfully, please refer to your PC-X Server or OS vendor for further assistance. Typical path for xclock: /usr/X11R6/bin/xclock

解决方案: 重启centos虚拟机 继续运行安装:


报错3:

发现错误:

at javax.swing.UIManager.setLookAndFeel(UIManager.java:480) at oracle.install.commons.util.Application.startup(Application.java:758) at oracle.install.commons.flow.FlowApplication.startup(FlowApplication.java:164) at oracle.install.commons.flow.FlowApplication.startup(FlowApplication.java:181) at oracle.install.commons.base.driver.common.Installer.startup(Installer.java:265) at oracle.install.ivw.db.driver.DBInstaller.startup(DBInstaller.java:114)

解决方案: 在Xshell终端直接用oracle用户登录,而不是用“su – oracle”切换用户命令

===================================================

4、进入Oracle图形安装界面

===================================================

报错4:

发现错误:

[INS-06101] IP address of localhost could not be determined 解决方案: 添加主机名和IP的映射关系 1)修改/etc/sysconfig/network 文件

2)使用hostname 命令修改主机名,该修改重启会失效,但在第一步我们已经修改过。所以失效也没关系

3)修改hosts 文件 #vi /etc/hosts

=================================================== 只是用来学习的就选择desktop 重新选一下目录即可 在root用户下运行以下两个脚本(第二条命令中途直接敲回车) 安装完成: 验证:

三、配置

Centos系统关机,启动后有关Oracle的服务不会自启动,所以需要自己写一个开机脚本 1、在/etc/init.d/目录下添加新建脚本文件

#!/bin/bash #desciption:Oracle auto start-stop script.#chkconfig:345 66 66 # #Set ORA_HOME TO to be equivalent to the $ORACLE_HOME #from which you wish to execute dbstart and dbshut; #设置你自己的 oracle 安装路径。 #Set ORA_OWNER to the user id of the owner of the #Oracle database in ORA_HOME. export ORA_BASE=/oracleData/oracle export ORA_HOME=/oracleData/oracle/product/11.2.0/db_1; export ORACLE_USER=oracle #判断 dbstart 文件 case $1 in start) su - "$ORACLE_USER"<<EOO lsnrctl start sqlplus /nolog<<EOS connect / as sysdba startup EOS emctl start dbconsole EOO touch /var/lock/subsys/$scriptname ;; stop) su - "$ORACLE_USER"<<EOO lsnrctl stop sqlplus /nolog<<EOS connect / as sysdba shutdown immediate EOS emctl stop dbconsole EOO rm -f /var/lock/subsys/scriptname ;; *) echo "Usage: $0 {start|stop}" ;; esac

2、修改脚本文件权限,创建软链接,使Oracle服务可以自启动 #chmod 750 /etc/init.d/oracle #ln -s /etc/init.d/oracle /etc/rc1.d/K61oracle #ln -s /etc/init.d/oracle /etc/rc3.d/S61oracle #chkconfig --level 345 oracle on #chkconfig --add oracle

重启centos系统,查看已启动进程

注:以上涉及到的软件如果需要的话可以留言

参考链接: https://blog.51cto.com/967243153/2085300 http://blog.sina.com.cn/s/blog_97b4973a0102wjaa.html

最新回复(0)