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         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.56.61 hyltest

~

~

[[email protected] /]# vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0"

NM_CONTROLLED="yes"

ONBOOT="yes"

HWADDR=08:00:27:97:CF:CA

TYPE=Ethernet

BOOTPROTO=none

IPADDR=192.168.56.61

PREFIX=24

DEFROUTE=yes

IPV4_FAILURE_FATAL=yes

IPV6INIT=no

NAME="System eth0"

UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03

~

~

[[email protected] /]# vi /etc/sysconfig/network

NETWORKING=yes

HOSTNAME=hyltest

~

~

#vi serverstop.sh

--编写关闭服务脚本

chkconfig iptables off
chkconfig ip6tables off
chkconfig cups off
chkconfig firstboot off
chkconfig wpa_supplicant off
chkconfig postfix off
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
sed -i 's/^GSSAPIAuthentication yes$/GSSAPIAuthentication no/' /etc/ssh/sshd_config
sed -i 's/#UseDNS yes/UseDNS no/' /etc/ssh/sshd_config

#sh serverstop.sh

--执行关闭服务脚本

2. 安装包等

官方文档要求安装的包:

The following packages (or later versions) must be installed:

binutils-2.20.51.0.2-5.11.el6.i686

compat-libcap1-1.10-1.i686

compat-libstdc++-33-3.2.3-69.el6.i686

gcc-4.4.4-13.el6.i686

gcc-c++-4.4.4-13.el6.i686

glibc-2.12-1.7.el6.i686

glibc-devel-2.12-1.7.el6.i686

ksh

libgcc-4.4.4-13.el6.i686

libstdc++-4.4.4-13.el6.i686

libstdc++-devel-4.4.4-13.el6.i686

libaio-0.3.107-10.el6.i686

libaio-devel-0.3.107-10.el6.i686

make-3.81-19.el6.i686

sysstat-9.0.4-11.el6.i686

根据官方文档要求,上传相应的包,如下:

#vi rpm.sh

--编写安装rpm包脚本

rpm -ivh binutils-2.20.51.0.2-5.28.el6.x86_64.rpm
rpm -ivh binutils-devel-2.20.51.0.2-5.28.el6.i686.rpm
rpm -ivh binutils-devel-2.20.51.0.2-5.28.el6.x86_64.rpm
rpm -ivh compat-libcap1-1.10-1.i686.rpm
rpm -ivh compat-libcap1-1.10-1.x86_64.rpm
rpm -ivh compat-libstdc++-296-2.96-144.el6.i686.rpm
rpm -ivh compat-libstdc++-33-3.2.3-69.el6.i686.rpm
rpm -ivh compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm
rpm -ivh gcc-4.4.6-3.el6.x86_64.rpm
rpm -ivh gcc-c++-4.4.6-3.el6.x86_64.rpm
rpm -ivh glibc-2.12-1.47.el6.i686.rpm
rpm -ivh glibc-2.12-1.47.el6.x86_64.rpm
rpm -ivh glibc-devel-2.12-1.47.el6.i686.rpm
rpm -ivh glibc-devel-2.12-1.47.el6.x86_64.rpm
rpm -ivh ksh-20100621-12.el6.x86_64.rpm
rpm -ivh libaio-0.3.107-10.el6.i686.rpm
rpm -ivh libaio-0.3.107-10.el6.x86_64.rpm
rpm -ivh libaio-devel-0.3.107-10.el6.i686.rpm
rpm -ivh libaio-devel-0.3.107-10.el6.x86_64.rpm
rpm -ivh libgcc-4.4.6-3.el6.i686.rpm
rpm -ivh libgcc-4.4.6-3.el6.x86_64.rpm
rpm -ivh libstdc++-4.4.6-3.el6.i686.rpm
rpm -ivh libstdc++-4.4.6-3.el6.x86_64.rpm
rpm -ivh libstdc++-devel-4.4.6-3.el6.i686.rpm
rpm -ivh libstdc++-devel-4.4.6-3.el6.x86_64.rpm
rpm -ivh make-3.81-19.el6.x86_64.rpm
rpm -ivh sysstat-9.0.4-18.el6.x86_64.rpm

#sh rpm.sh

--执行安装rpm包脚本

配置yum

参考其它文章,访问地址如下:

http://blog.csdn.net/huangyanlong/article/details/38614971

#vi yum.sh

--编写yum安装脚本,脚本里使用yum安装的与rpm包单独安装的有重复的,但没关系遇到已安装过的包时会自动检查版本跳过安装

yum -y install autoconf
yum -y install automake
yum -y install binutils-devel
yum -y install bison
yum -y install cpp
yum -y install dos2unix
yum -y install ftp
yum -y install gcc
yum -y install gcc-c++
yum -y install lrzsz
yum -y install python-devel
yum -y install compat-db
yum -y install compat-db42
yum -y install compat-db43
yum -y install compat-gcc-34
yum -y install compat-gcc-34-c++
yum -y install compatlibstdc++-33
yum -y install glibc-*
yum -y install glibc-*.i686
yum -y install libXpm-*.i686
yum -y install libXp.so.6
yum -y install libXt.so.6
yum -y install libXtst.so.6
yum -y install libgcc_s.so.1
yum -y install ksh
yum -y install libXp
yum -y install libaio-devel
yum -y install numactl
yum -y install numactl-devel
yum -y install unixODBC
yum -y install unixODBC-devel

#sh yum.sh

--执行yum安装脚本

3. 添加用户、组、目录

[[email protected] /]# groupadd oinstall

--添加oinstall组

[[email protected] /]# groupadd dba

--添加dba组

[[email protected] /]# useradd -g oinstall -G dba oracle

--添加oracle用户,主组为oinstall,属组为dba

[[email protected] /]# passwd oracle

--为oracle用户创建密码

Changing password for user oracle.

New password:

BAD PASSWORD: it is based on a dictionary word

BAD PASSWORD: is too simple

Retype new password:

passwd: all authentication tokens updated successfully.

[[email protected] /]# id oracle

--查看oracle的id值

uid=501(oracle) gid=602(oinstall) groups=602(oinstall),603(dba)

[[email protected] /]# mkdir -p /u01/app/oracle

--创建oracle相关目录

[[email protected] /]# mkdir -p /u01/app/oraInventory

[[email protected] /]# chown -R oracle:oinstall /u01/app

--将目录归属于oracle及其相关组

[[email protected] /]# chmod -R 775 /u01/app

--赋予oracle对相关目录的访问权限

4. 配置内核参数等

[[email protected] /]# 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

~

[[email protected] /]# sysctl –p

--使修改的内核参数生效

net.ipv4.ip_forward = 0

net.ipv4.conf.default.rp_filter = 1

net.ipv4.conf.default.accept_source_route = 0

kernel.sysrq = 0

kernel.core_uses_pid = 1

net.ipv4.tcp_syncookies = 1

net.bridge.bridge-nf-call-ip6tables = 0

net.bridge.bridge-nf-call-iptables = 0

net.bridge.bridge-nf-call-arptables = 0

kernel.msgmnb = 65536

kernel.msgmax = 65536

kernel.shmmax = 68719476736

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

[[email protected] ~]$ vi .bash_profile

--修改oracle环境变量

ORACLE_BASE=/u01/app/oracle

ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1

ORACLE_SID=xcky

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

~

~

[[email protected] ~]# vi /etc/security/limits.conf

--修改系统限制

oracle              soft    nproc   2047

oracle              hard    nproc   16384

oracle              soft    nofile  1024

oracle              hard    nofile  65536

~

[[email protected] ~]# 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

5. 解压安装包

解压

例:解压.zip

# unzip p13390677_112040_Linux-x86-64_1of7.zip

# unzip p13390677_112040_Linux-x86-64_2of7.zip

6. 图形化安装oracle11g

使用X-manager远程调用图形化界面,如下图中指令:

操作如下:

[[email protected] ~]# xhost +

--开启图形化功能

access control disabled, clients can connect from any host

[[email protected] ~]# su - oracle

[[email protected] ~]$ cd /soft

[[email protected] soft]$ ls

database  rpm11  rpm11odbc  rpm.sh  serverstop.sh  yum.sh

[[email protected] soft]$ cd database

[[email protected] database]$ ls

install      response  runInstaller  stage

readme.html  rpm       sshsetup      welcome.html

[[email protected] database]$ ./runInstaller

--执行安装程序

Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 15998 MB    Passed

Checking swap space: must be greater than 150 MB.   Actual 4095 MB    Passed

Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2014-10-15_08-33-36PM. Please wait ...[[email protected] database]$ You can find the log of this install session at:

/u01/app/oraInventory/logs/installActions2014-10-15_08-33-36PM.log

进入到图形化后,按照提示逐步进行即可,参考过程如下:

[[email protected] ~]# /u01/app/oraInventory/orainstRoot.sh

Changing permissions of /u01/app/oraInventory.

Adding read,write permissions for group.

Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.

The execution of the script is complete.

[[email protected] ~]# /u01/app/oraInventory/orainstRoot.sh

Changing permissions of /u01/app/oraInventory.

Adding read,write permissions for group.

Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.

The execution of the script is complete.

[[email protected] ~]# /u01/app/oracle/product/11.2.0/db_1/root.sh

Performing root user operation for Oracle 11g

The following environment variables are set as:

ORACLE_OWNER= oracle

ORACLE_HOME=  /u01/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.

7. dbca建库

[[email protected] database]$ dbca

8. netca配置监听

[[email protected] database]$ netca

9. 配置开机实例自启动

[[email protected] ~]# 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 "/u01/app/oracle/product/11.2.0/db_1/bin/dbstart start"

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

~

~

~

~

[[email protected] ~]# vi /etc/oratab

# This file is used by ORACLE utilities.  It is created by root.sh

# and updated by either Database Configuration Assistant while creating

# a database or ASM Configuration Assistant while creating ASM instance.

# A colon, ‘:‘, is used as the field terminator.  A new line terminates

# the entry.  Lines beginning with a pound sign, ‘#‘, are comments.

#

# Entries are of the form:

#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:

#

# The first and second fields are the system identifier and home

# directory of the database respectively.  The third filed indicates

# to the dbstart utility that the database should , "Y", or should not,

# "N", be brought up at system boot time.

#

# Multiple entries with the same $ORACLE_SID are not allowed.

#

#

xcky:/u01/app/oracle/product/11.2.0/db_1:Y

~

"/etc/oratab" 23L, 784C written

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

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

时间: 2024-10-02 08:04:34

CentOS 6 上安装Oracle11g的相关文章

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 loca

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