CentOS 5 上安装Oracle11g

原创作品,出自 “深蓝的blog” 博客,欢迎转载,转载时请务必注明以下出处,否则追究版权法律责任。

深蓝的blog:http://blog.csdn.net/huangyanlong/article/details/40180867

1. 域名解析设置及网络配置

# vi /etc/hosts

127.0.0.1         localhost.localdomain localhost

::1               localhost6.localdomain6 localhost6

192.168.56.103    hyl

# vi /etc/sysconfig/network-scripts/ifcfg-eth0

--修改网卡配置

--若在安装系统时设置,此处可不进行修改

# Intel Corporation 82540EM Gigabit Ethernet Controller

DEVICE=eth0

BOOTPROTO=static

IPADDR=192.168.56.103

NETMASK=255.255.255.0

HWADDR=08:00:27:29:DB:B2

ONBOOT=yes

~

# service network restart

--重启网卡使其生效

# vi /etc/sysconfig/network

NETWORKING=yes

NETWORKING_IPV6=no

HOSTNAME=hyl

~

2. 安装包

根据官方文档准备rpm包,上传至服务器

需要的包如下所示:

执行脚本实现:

#vi CentOS5.6-11g-script.sh

--脚本实现两种功能

--功能1:安装rpm包并记录日志,安装后删除相关包

--功能2:检查安装的rpm包并记录日志

rpm -ivh binutils-2.17.50.0.6-14.el5.x86_64.rpm >> rpm.log 2>&1
rpm -ivh binutils-devel-2.17.50.0.6-14.el5.i386.rpm >> rpm.log 2>&1
rpm -ivh binutils-devel-2.17.50.0.6-14.el5.x86_64.rpm >> rpm.log 2>&1
rpm -ivh compat-libstdc++-33-3.2.3-61.i386.rpm >> rpm.log 2>&1
rpm -ivh compat-libstdc++-33-3.2.3-61.x86_64.rpm >> rpm.log 2>&1
rpm -ivh elfutils-libelf-0.137-3.el5.i386.rpm >> rpm.log 2>&1
rpm -ivh elfutils-libelf-0.137-3.el5.x86_64.rpm >> rpm.log 2>&1
rpm -ivh elfutils-libelf-devel-0.137-3.el5.i386.rpm >> rpm.log 2>&1
rpm -ivh elfutils-libelf-devel-0.137-3.el5.x86_64.rpm >> rpm.log 2>&1
rpm -ivh elfutils-libelf-devel-static-0.137-3.el5.i386.rpm >> rpm.log 2>&1
rpm -ivh elfutils-libelf-devel-static-0.137-3.el5.x86_64.rpm >> rpm.log 2>&1
rpm -ivh gcc-4.1.2-50.el5.x86_64.rpm >> rpm.log 2>&1
rpm -ivh gcc-c++-4.1.2-50.el5.x86_64.rpm >> rpm.log 2>&1
rpm -ivh glibc-2.5-58.i686.rpm >> rpm.log 2>&1
rpm -ivh glibc-2.5-58.x86_64.rpm >> rpm.log 2>&1
rpm -ivh glibc-common-2.5-58.x86_64.rpm >> rpm.log 2>&1
rpm -ivh glibc-devel-2.5-58.i386.rpm >> rpm.log 2>&1
rpm -ivh glibc-devel-2.5-58.x86_64.rpm >> rpm.log 2>&1
rpm -ivh glibc-headers-2.5-58.x86_64.rpm >> rpm.log 2>&1
rpm -ivh libaio-0.3.106-5.i386.rpm >> rpm.log 2>&1
rpm -ivh libaio-0.3.106-5.x86_64.rpm >> rpm.log 2>&1
rpm -ivh libaio-devel-0.3.106-5.i386.rpm >> rpm.log 2>&1
rpm -ivh libaio-devel-0.3.106-5.x86_64.rpm >> rpm.log 2>&1
rpm -ivh libao-0.8.6-7.i386.rpm >> rpm.log 2>&1
rpm -ivh libao-0.8.6-7.x86_64.rpm >> rpm.log 2>&1
rpm -ivh libgcc-4.1.2-50.el5.i386.rpm >> rpm.log 2>&1
rpm -ivh libgcc-4.1.2-50.el5.x86_64.rpm >> rpm.log 2>&1
rpm -ivh libstdc++-4.1.2-50.el5.i386.rpm >> rpm.log 2>&1
rpm -ivh libstdc++-4.1.2-50.el5.x86_64.rpm >> rpm.log 2>&1
rpm -ivh libstdc++-devel-4.1.2-50.el5.i386.rpm >> rpm.log 2>&1
rpm -ivh libstdc++-devel-4.1.2-50.el5.x86_64.rpm >> rpm.log 2>&1
rpm -ivh make-3.81-3.el5.x86_64.rpm >> rpm.log 2>&1
rpm -ivh numactl-0.9.8-11.el5.i386.rpm >> rpm.log 2>&1
rpm -ivh numactl-0.9.8-11.el5.x86_64.rpm >> rpm.log 2>&1
rpm -ivh pdksh-5.2.14-36.el5.x86_64.rpm >> rpm.log 2>&1
rpm -ivh sysstat-7.0.2-3.el5_5.1.x86_64.rpm >> rpm.log 2>&1
rm -rf binutils-2.17.50.0.6-14.el5.x86_64.rpm
rm -rf binutils-devel-2.17.50.0.6-14.el5.i386.rpm
rm -rf binutils-devel-2.17.50.0.6-14.el5.x86_64.rpm
rm -rf compat-libstdc++-33-3.2.3-61.i386.rpm
rm -rf compat-libstdc++-33-3.2.3-61.x86_64.rpm
rm -rf elfutils-libelf-0.137-3.el5.i386.rpm
rm -rf elfutils-libelf-0.137-3.el5.x86_64.rpm
rm -rf elfutils-libelf-devel-0.137-3.el5.i386.rpm
rm -rf elfutils-libelf-devel-0.137-3.el5.x86_64.rpm
rm -rf elfutils-libelf-devel-static-0.137-3.el5.i386.rpm
rm -rf elfutils-libelf-devel-static-0.137-3.el5.x86_64.rpm
rm -rf gcc-4.1.2-50.el5.x86_64.rpm
rm -rf gcc-c++-4.1.2-50.el5.x86_64.rpm
rm -rf glibc-2.5-58.i686.rpm
rm -rf glibc-2.5-58.x86_64.rpm
rm -rf glibc-common-2.5-58.x86_64.rpm
rm -rf glibc-devel-2.5-58.i386.rpm
rm -rf glibc-devel-2.5-58.x86_64.rpm
rm -rf glibc-headers-2.5-58.x86_64.rpm
rm -rf libaio-0.3.106-5.i386.rpm
rm -rf libaio-0.3.106-5.x86_64.rpm
rm -rf libaio-devel-0.3.106-5.i386.rpm
rm -rf libaio-devel-0.3.106-5.x86_64.rpm
rm -rf libao-0.8.6-7.i386.rpm
rm -rf libao-0.8.6-7.x86_64.rpm
rm -rf libgcc-4.1.2-50.el5.i386.rpm
rm -rf libgcc-4.1.2-50.el5.x86_64.rpm
rm -rf libstdc++-4.1.2-50.el5.i386.rpm
rm -rf libstdc++-4.1.2-50.el5.x86_64.rpm
rm -rf libstdc++-devel-4.1.2-50.el5.i386.rpm
rm -rf libstdc++-devel-4.1.2-50.el5.x86_64.rpm
rm -rf make-3.81-3.el5.x86_64.rpm
rm -rf numactl-0.9.8-11.el5.i386.rpm
rm -rf numactl-0.9.8-11.el5.x86_64.rpm
rm -rf pdksh-5.2.14-36.el5.x86_64.rpm
rm -rf sysstat-7.0.2-3.el5_5.1.x86_64.rpm
rpm -qa|grep binutils >> queryrpm.log 2>&1
rpm -qa|grep compat-libstdc >> queryrpm.log 2>&1
rpm -qa|grep elfutils >> queryrpm.log 2>&1
rpm -qa|grep gcc >> queryrpm.log 2>&1
rpm -qa|grep glibc >> queryrpm.log 2>&1
rpm -qa|grep kernel >> queryrpm.log 2>&1
rpm -qa|grep ksh >> queryrpm.log 2>&1
rpm -qa|grep libaio >> queryrpm.log 2>&1
rpm -qa|grep libgcc >> queryrpm.log 2>&1
rpm -qa|grep libgomp >> queryrpm.log 2>&1
rpm -qa|grep libstdc++- >> queryrpm.log 2>&1
rpm -qa|grep make >> queryrpm.log 2>&1
rpm -qa|grep sysstat >> queryrpm.log 2>&1

3. 创建用户、组、目录

# groupadd oinstall

# groupadd dba

# useradd -g oinstall -G dba oracle

# passwd oracle

Changing password for user oracle.

New UNIX password:oracle

BAD PASSWORD: it is based on a dictionary word

Retype new UNIX password:oracle

passwd: all authentication tokens updated successfully.

# id oracle

uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba)

# mkdir -p /home/u01/app/oracle

# mkdir -p /home/u01/app/oraInventory

# chown -R oracle:oinstall /home/u01/app

# chmod -R 775 /home/u01/app

4. 配置内核参数、修改环境变量

# vi /etc/sysctl.conf

添加:

kernel.shmall = 4294967296

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

fs.file-max = 65536

net.ipv4.ip_local_port_range = 1024 65500

net.core.rmem_default = 4194304

net.core.wmem_default = 262144

net.core.rmem_max = 4194304

net.core.wmem_max = 262144

~

# sysctl -p

--使内核参数生效

# su - oracle

$ vi .bash_profile

--修改oracle用户的环境配置文件

--执行:su - oracle切换到oracle用户环境,然后编辑
.bash_profile文件,更改PATH的配置,同时在环境变量中增加NLS_LANG的配置

ORACLE_BASE=/home/u01/app/oracle

ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1

ORACLE_SID=hyl

PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib

export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH LD_LIBRARY_PATH

5. 设置shell限制

--添加以下参数

# vi /etc/security/limits.conf

oracle              soft    nproc   2047

oracle              hard    nproc   16384

oracle              soft    nofile  1024

oracle              hard    nofile  65536

# vi /etc/pam.d/login

--添加以下参数

session    required     /lib/security/pam_limits.so

session    required     pam_limits.so

# 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/profile文件中修改以下内容

ulimit –s –c 0 >/dev/null 2> &1 修改为

ulimit –s –c unlimited >/dev/null 2> &1

6. 解压安装包

例:解压.zip

# unzip p13390677_112040_Linux-x86-64_1of7.zip

# unzip p13390677_112040_Linux-x86-64_2of7.zip

7. 图形化安装oracle、dbca建库、netca配置监听

(略)

说明:由于图形化安装非常简单,可以尝试自己摸索安装练习,或参阅我的其它文章,链接地址如下:

CentOS5.6下安装Oracle10G软件 【保留报错经验】

dbca 建库、配置监听、导入数据(CentOS5.6+Oracle10G)

8. 配置开机启动实例

# vi /etc/rc.d/rc.local

--添加开机启动实例、监听语句

#!/bin/sh

#

# This script will be executed *after* all the other init scripts.

# You can put your own initialization stuff in here if you don‘t

# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

su - oracle -c "/home/u01/app/oracle/product/11.2.0/db_1/bin/dbstart start"

su - oracle -c "/home/u01/app/oracle/product/11.2.0/db_1/bin/lsnrctl start"

~

~

~

# vi /etc/oratab   --修改开机启动,将值由N设为Y

hyl:/home/u01/app/oracle/product/11.2.0/db_1:Y

原创作品,出自 “深蓝的blog” 博客,欢迎转载,转载时请务必注明以下出处,否则追究版权法律责任。

深蓝的blog:http://blog.csdn.net/huangyanlong/article/details/40180867

时间: 2024-10-14 09:38:11

CentOS 5 上安装Oracle11g的相关文章

CentOS 6 上安装Oracle11g

原创作品,出自 "深蓝的blog" 博客,欢迎转载,转载时请务必注明以下出处,否则追究版权法律责任. 深蓝的blog:http://blog.csdn.net/huangyanlong/article/details/40181661 1. 主机配置 [[email protected] /]# vi /etc/hosts 127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1

RedHat Enterprise Linux 6.5上安装Oracle11g详解

RedHat 6.5下安装Oracle11g(64bit) 软件环境:RedHat 6.5 Oracle11g_64bit 环境描述:由于公司需求,客户提供了6台云主机,有三台式linux系统,其中需要在内网的一台机器上安装Oracle11g数据库,但是这台服务器连不上公网,其他两台可以上公网. 安装前需要解决的问题: 1.首先是安装数据库那台服务器不能上公网,只好通过另外两台ssh远程登陆到数据库服务器上. 2.安装Oracle的软件环境时,不能使用yum安装(由于安装红帽系统时,未注册不能够

最小化安装的64位CentOS6.5上安装Oracle11g R2

安装环境: 操作系统:CentOS6.5 x86_64 安装步骤: 一.按照官方文档安装依赖包,主要包如下: binutils-2.20.51.0.2-5.11.el6 (x86_64) compat-libcap1-1.10-1 (x86_64) compat-libstdc++-33-3.2.3-69.el6 (x86_64) compat-libstdc++-33-3.2.3-69.el6.i686 gcc-4.4.4-13.el6 (x86_64) gcc-c++-4.4.4-13.el

CentOS 7上安装Zabbix Server 3.0 图文详解

转载自 http://www.linuxidc.com/Linux/2016-09/135204.htm CentOS 7上安装Zabbix Server 3.0 图文详解 1.查看系统信息. cat /etc/RedHat-releaseCentOS Linux release 7.0.1406 (Core) uname -a Linux VM_96_155_centos3.10.0-123.el7.x86_64 #1 SMP Mon Jun 30 12:09:22 UTC 2014 x86_

在CentOS 7上安装phpMyAdmin

原文 在CentOS 7上安装phpMyAdmin phpMyAdmin是一款以PHP为基础,基于Web的MySQL/MariaDB数据库管理工具.虽然已经存在着一些诸如Adminer的轻量级数据库管理工具, 但是phpMyAdmin还是更加广泛应用于网站管理员之中来进行各种MySQL/MariaDB的管理任务.它支持几乎所有MySQL数据库/表的相关操作,比如浏览.创建.复制.删除.重命名.更改,还有MySQL用户/权限管理和数据库导入/导出.以下就是如何在CentOS 6或7上安装phpMy

在CentOS 6上安装Apache和PHP

本文演示如何在CentOS 6上安装Apache和PHP.CentOS 6自带的是Apache 2.2.3和PHP 5.1.6,您可以使用默认的CentOS包管理器进行安装yum.使用yum(而不是使用源代码进行安装)的优点在于您可以获得任何安全更新(分发时),并且依赖关系被自动处理. 安装Apache 运行以下命令: sudo yum install httpd mod_ssl 因为服务器在安装Apache时不会自动启动,所以必须手动启动它. sudo /usr/sbin/apachectl

Linux Centos 系统上安装BT客户端 Transmission

Linux Centos 系统上安装BT客户端 Transmission Transmission是一种BitTorrent客户端,特点是一个跨平台的后端和其上的简洁的用户界面,以MIT许可证和GNU通用公共许可证双许可证授权,因此是一款自由软件,还被众多linux发行版,包括Ubuntu.Mandriva.Mint.Fedora.Puppy.openSUSE 选作默认BT下载工具:Imageshack的服务使用其技术. 上面已经提到了很多种Linux系统都内置了这软件,可是使用最广的Cento

[openfair]解决在centos x64 上安装openfire出现的错误

在centos x64 上安装openfire,运行  /etc/init.d/openfire start后发现服务器没法开启,查看log日志: nohup: failed to run command `/opt/openfire/jre/bin/java': No such file or directory 很奇怪,我是在centos上安装了java,openfire自带的jre就没法使用了,在论坛上搜索到下面的解决办法: http://community.igniterealtime.

在CentOS 7上安装Jenkins

在CentOS 7上安装Jenkins 安装 添加yum repos,然后安装 sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/RedHat/jenkins.repo sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.keysudo yum install jenkins 如果没有java的话要安装java sudo yum ins