ORACLE 11g Centos7安装详解 agent nmhs错误处理

37 篇文章 1 订阅
本文详细介绍了在CentOS 7环境中安装Oracle 11g数据库的步骤,包括用户创建、依赖包安装、系统配置优化,如关闭SELinux、修改内核参数、环境变量设置以及图形化安装过程。同时涵盖了防火墙配置和数据库测试等内容。
摘要由CSDN通过智能技术生成

ORACLE 11g Centos7安装详解

一、准备工作

(1)版本环境

Centos7 :CentOS Linux release 7.2.1511 (Core)
Oracle11g:
p13390677_112040_Linux-x86-64_1of7.zip
p13390677_112040_Linux-x86-64_2of7.zip

(2)关闭selinux

查看selinux状态:

getenforce

sestatus -v

临时关闭:

#setenforce 0
永久关闭:

vim /etc/selinux/config

设置SELINUX=disabled

二、创建用户及安装目录,安装依赖包

(1)创建用户

[root@oracledb ~] groupadd oinstall
[root@oracledb ~] groupadd dba
[root@oracledb ~] useradd -g oinstall -G dba -m oracle
[root@oracledb ~] passwd oracle

(2)创建安装目录,解压文件

[root@oracledb ~] mkdir -p /app/oracle
[root@oracledb ~] unzip  /app/ linux.x64_11gR2_database_1of2.zip
[root@oracledb ~] unzip  /app/ linux.x64_11gR2_database_2of2.zip
[root@oracledb ~] chown -R oracle:oinstall /app
[root@oracledb ~] chmod 755 -R /app

(3)目录规划说明

database 解压安装程序后自动生成的安装包目录
oracle 数据库安装目录
oraInventory 默认安装日志存放目录(安装后生成)

(4)安装依赖包

[root@oracledb ~] yum -y install binutils compat compat-libstdc gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libXi libXtst make sysstat unixODBC unixODBC-devel
[root@oracledb ~] yum -y install elfutils-libelf-devel
[root@oracledb ~] yum -y install compat-libstdc++-33-3.2.3

以上是所有的相关包!安装需要一点时间。

三、修改系统内核、参数设置

(1)将服务器名写入到hosts文件

[root@oracledb ~] echo '127.0.0.1 oracledb localhost localhost.localdomain' >> /etc/hosts
[root@oracledb ~] ping -c 3 oracledb
PING oracledb (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.030 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.043 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.041 ms
--- oracledb ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1999ms
rtt min/avg/max/mdev = 0.030/0.038/0.043/0.005 ms

(2)修改内核(/etc/sysctl.conf)

编辑加入参数后,需更新环境参数

[root@oracledb ~] vim /etc/sysctl.conf

[root@oracledb ~] sysctl -p

增加以下内容

fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
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

(3)修改系统限制参数

[root@oracledb ~] vim /etc/security/limits.conf

文件末增加如下内容

oracle soft nproc 131072
oracle hard nproc 131072
oracle soft nofile 131072
oracle hard nofile 131072
oracle soft core unlimited
oracle hard core unlimited
oracle soft memlock 50000000
oracle hard memlock 50000000

(4)修改用户登录认证

[root@oracledb ~] vim /etc/pam.d/login

文件末增加以下内容

session required /lib64/security/pam_limits.so
session required pam_limits.so

(5)设置oracle用户环境变量

[root@oracledb ~] vim /etc/profile

在文件末增加以下内容:

export ORACLE_HOME=/app/oracle/product/11.2.0/db_1
export ORACLE_SID=oracledb
if [ $USER = “oracle” ]; then
if [ $SHELL = “/bin/ksh” ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

设置oracle用户环境

[root@oracledb ~] vim /home/oracle/.bash_profile

增加如下内容,非常重要!!!
指定 ORACLE_HOME,ORACLE_SID , NLS_LANG关键参数

export ORACLE_BASE=/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=oracledb
export ORACLE_TERM=xterm
export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

四、图形化安装过程

(1)使用oracle用户登录桌面,打开终端运行安装程序

[root@oracledb ~] cd /app/database
[root@oracledb ~] ./runInstaller

(2)图形化界面安装说明
根据使用目的,选项仅供参考
默认通过oracle账号选择接手oracle更新,建议不选择,不用输入oracle账号。
在这里插入图片描述
选择不更新软件:
在这里插入图片描述
创建并配置数据库:
在这里插入图片描述
选择server模式
在这里插入图片描述
选择单实例模式:
在这里插入图片描述
选择自定义安装选项:
在这里插入图片描述
选择语言,英语即可:
在这里插入图片描述
选择标准企业版:
在这里插入图片描述
安装路径,确认即可:
在这里插入图片描述
安装日志路径,如果安装失败,再次安装,需要删除此目录。确认即可:
在这里插入图片描述
选择数据库模式,默认是在线交易,默认即可:
在这里插入图片描述
建议将 global database name 和SID设置一样:
在这里插入图片描述

自定义设置,内存大小:
在这里插入图片描述
自定义设置,字符编码,选择中文16GBK
在这里插入图片描述
自定义设置,测试用schema ,就是emp等一些测试数据,也选择:
在这里插入图片描述
选择用EM管理数据库:
在这里插入图片描述
备份模式,不自动备份,默认选项即可:
在这里插入图片描述
设置两个用户组,dba是已经默认选择,第二个是空白,需要选择为安装组oinstall:
在这里插入图片描述
安装环境检查,如果前面安装包都正常,那么最后应该只有这个包有一个警告,可以忽略:
在这里插入图片描述
最令人迷惑不爽的问题,下面的红框是一个窗口,显示一个小块!!
tab选择一下,按空格,可以出选择内容:
在这里插入图片描述
显示内容就是是否继续安装,忽略错误,选yes:
在这里插入图片描述
所有安装准备,检验工作完成,正式安装开始。。。
在这里插入图片描述
第二次迷惑现象出现!!!,又是一个提示框显示为小框
此处困惑我好一段时间,其实是一个报错信息,其实这个报错信息可以忽略,不影响安装和使用,在日志中关键内容如下:

Exception String: Error in invoking target ‘agent nmhs’ of makefile
‘/app/oracle/product/11.2.0/db_1/sysman/lib/ins_emagent.mk’.

在这里插入图片描述
正常显示从网上找了个图:

其实这个问题,花费了好多次重新安装,因为默认是abort,如果选中后按空格,直接就退出安装了。
经验是按tab 然后按右箭头(→)两次,盲选到continue按钮上,按空格选择。

继续进行安装,没有任何问题!!!

如果有人知道如何将这个小框调整为大窗口,不吝赐教!!!

此后就没有什么困难了。
提升em 用户和启动方法,ok即可:
在这里插入图片描述
安装环境提示,ok即可:
在这里插入图片描述
执行最终环境root脚本:
在这里插入图片描述
一定先不用按ok按钮,先执行两个sh文件
执行第二个文件有个提示,回车即可:

Enter the full pathname of the local bin directory: [/usr/local/bin]:

执行过程如下:

[root@localhost app]# cd /app/oraInventory/
[root@localhost oraInventory]# ll *.sh
-rwxrwx---. 1 oracle oinstall 1584 Sep 25 21:22 orainstRoot.sh
[root@localhost oraInventory]# ./orainstRoot.sh 
Changing permissions of /app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /app/oraInventory to oinstall.
The execution of the script is complete.
[root@localhost oraInventory]# cd /app/oracle/product/11.2.0/db_1/
[root@localhost db_1]# ll *.sh
-rwxr-x---. 1 oracle oinstall 470 Sep 25 21:21 root.sh
[root@localhost db_1]# ./root.sh
Performing root user operation for Oracle 11g 

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /app/oracle/product/11.2.0/db_1

Enter the full pathname of the local bin directory: [/usr/local/bin]: 
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
[root@localhost db_1]# 

最后安装总结,告知em的URL,按close按钮即可:
在这里插入图片描述
至此安装全部完成!!!

最后需要将oracle用的两个端口加入防火墙,重新载入配置:

firewall-cmd --zone=public --add-port=1521/tcp --permanent
firewall-cmd --zone=public --add-port=1158/tcp --permanent
firewall-cmd --reload

在客户端上配置好tnsname.ora ,用SQLplus测试一下连接。
在客户端上用浏览器访问em:

在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值