Install Oracle 10g R2 under CentOS 6.3 (x86_32)

1. Hardware requirements

1. Memory & swap

Minimum: 1 GB of RAM
Recommended: 2 GB of RAM or more

Check memory
# grep MemTotal /proc/meminfo
# grep SwapTotal /proc/meminfo

2. Hard disk

Since CentOS has almost 4~5G after installation, plus the installation of Oracle, etc., please prepare at least 10G of hard disk space.

Check disk condition
# df -h

2. Software

System platform: CentOS 6.3(x32)

CentOS-6.3-i386-bin-DVD1.iso

Oracle version: Oracle 10g R2

10201_database_linux32.zip

Three, system installation attention

The desktop mode must be installed when the system is installed, otherwise Oracle cannot be installed. In addition, do not enable SELinux. Oracle does not recommend using SELinux, and the firewall of CentOS should also be temporarily closed to reduce the trouble during installation. To prevent garbled characters during Oracle installation, it is recommended to use English as the system language for Oracle installation.

The system commands described in this article, unless otherwise marked, are "#" for root authority, and "$" for oracle authority.

Fourth, the system preparation before installing Oracle

First of all, please log in with the root account to do some pre-setting operations.

1. Turn off the firewall and disable SELinux

# setup

vi /etc/selinux/config

Modify SELINUX=disabled, then restart.
If you don't want to reboot the system, use the command setenforce 0

2. Install dependency packages

Installation packages required by Oracle's official documentation:

Check if Oracle related packages are installed:

用yum方式安装所需的包:

# yum -y install binutils compat-libstdc++-33 compat-libstdc++-33.i686 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc.i686 glibc-common glibc-devel glibc-devel.i686 glibc-headers ksh libaio libaio.i686 libaio-devel libaio-devel.i686 libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel make sysstat

最后还需要安装libXp这个Library,这个一定要安装,否则安装Oracle时会出现java Exception。

# yum install libXp

3、创建Oracle用户与组

在这里只讨论单主机环境,不考虑RAC环境的配置。

执行以下指令以新增oracle安装时所需要的使用者与群组。

(1) 建立群组oinstall 
# groupadd oinstall

(2) 建立群组dba
# groupadd dba

(3) 新增使用者oracle并将其加入oinstall和dba群组
# useradd -m -g oinstall -G dba oracle

(4) 测试oracle账号是否建立完成
# id oracle

(5) 建立oracle的新密码
# passwd oracle

4、将oracle使用者加入到sudo群组中

# vi /etc/sudoers
找到root        ALL=(ALL)        ALL 这行,并且在底下再加入
oracle        ALL=(ALL)        ALL
输入wq!(由于这是一份只读文档所以需要再加上!)并且按下Enter

5、配置系统内核参数

# vi /etc/sysctl.conf

并输入以下内容:

kernel.shmall = 2097152                                 //表示系统一次可以使用的共享内存总量(以页为单位)。缺省值就是2097152,通常不需要修改
kernel.shmmax = 2147483648                        //定义了共享内存段的最大尺寸(以字节为单位)。缺省为32M,对于oracle来说,该缺省值太低了,通常将其设置为2G
kernel.shmmni = 4096                                    //用于设置系统范围内共享内存段的最大数量。该参数的默认值是 4096 。通常不需要更改
kernel.sem = 250 32000 100 128                    //表示设置的信号量
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=4194304                     //默认的接收窗口大小
net.core.rmem_max=4194304                        //接收窗口的最大大小
net.core.wmem_default=262144                      //默认的发送窗口大小
net.core.wmem_max=262144                         //发送窗口的最大大小

会有一些与目前的参数重复的,就修改成文件上提供的。

编辑完之后,储存,然后执行:

# sysctl –p

启用刚刚所做的变更。

6、编辑/etc/security/limits.conf

# vi /etc/security/limits.conf
加入以下四行
oracle  soft        nproc   2047
oracle  hard        nproc   16384
oracle  soft        nofile  1024
oracle  hard        nofile  65536

7、编辑/etc/pam.d/login

# vi /etc/pam.d/login
session required /lib/security/pam_limits.so
session required pam_limits.so

8、修改/etc/profile

# vi /etc/profile

将以下代码新增到profile档案中。

复制代码
if [ $USER = "oracle" ]; then
    if [ $SHELL = "/bin/ksh" ]; then
        ulimit -p 16384
        ulimit -n 65536
    else
        ulimit -u 16384 -n 65536
    fi
fi 
复制代码

9、修改Linux发行版本信息

由于Oracle 10g发行的时候,CentOS 6没有发行,所以Oracle 10g并没有对CentOS 6确认支持,需要修改文件让Oracle 10g支持CentOS 6。
我们需要手工修改Linux的发行注记,让Oracle 10g支持CentOS 6。
编辑/etc/redhat-release文件
# vi /etc/redhat-release
将其中的内容CentOS release 6.3 (Final)修改为redhat 4

10、创建Oracle安装文件夹以及数据存放文件夹

#mkdir /opt/oracle
#mkdir /opt/oracle/102
#chown -R oracle:dba /opt/oracle

11、配置Linux主机
检查/etc/hosts文件中是否有localhost的记录(指向127.0.0.1即可),若没有的话,在后面配置Oracle监听的时候会出现一些问题,导致无法启动监听,在此手工添加此记录即可。

第一阶段到此完毕,接下来,完成这些设定之后,请先注销root账号,并且以oracle账号再次登入系统。

12、配置oracle用户环境变量

$ cd /home/oracle
$ vi .bash_profile
修改并加入以下內容

ORACLE_BASE=/opt/oracle                      //上面创建的Oracle安装文件夹
ORACLE_HOME=$ORACLE_BASE/102
ORACLE_SID=orcl
LD_LIBRARY_PATH=$ORACLE_HOME/lib
PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin

export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH

保存后使用如下命令,使设置生效:

$ source /home/oracle/.bash_profile

五、安装Oracle,并进行相关设置

1、解压缩安装文件

将下载的10201_database_linux32.zip放至即将安装oracle的文件夹/opt/oracle
回到终端模式并且进入到oracle文件夹:

$ cd /opt/oracle

解压缩10201_database_linux32.zip

$ unzip 10201_database_linux32.zip

接着会看到一连串的解压缩动作。

解压缩完成会在同一个文件夹中看到database的文件夹,请进入到database文件夹中:

$ cd database

准备执行数据库安装,如果你的centos是中文环境,安装时会出现中文乱码,请下以下指令

$ export LANG=en_US

接着执行

$ ./runInstaller

如果无法看到安装界面,请使用root帐户执行如下命令后再运行安装程序:
# export DISPLAY=:0.0 
# xhost + 
$ ./runInstaller

开始执行安装程序。

由于相关的前置作业已经在之前做好了,在这个步骤只需要将UNIX DBA Group选择为dba以及输入SYS, SYSTEM等账号共享的database Password即可。然后选择Next即可。

同样的,将群组选择为dba群组,按Next

在这个步骤中,请点选Checking Network Configuration requirements为User Verified,接着按下Next

最后出现Install Summary画面,此时只要按下Install按钮,系统即开始安装。

安装过程...

数据库设置助理,可以在这边选取password management作密码的修改,如不需要修改,只需要按下ok按钮即可。

安装完成前,出现以下的设置脚本:

开启一个新的终端,su到root。

将要求执行的两段script依序执行。

/opt/oracle/oraInventory/orainstRoot.sh
/opt/oracle/102/root.sh

执行画面如上图。
执行完后,回到安装窗口按下OK完成所有的oracle安装。安装完成会出现以下画面。

此时,您可以以上述网址,作为测试,登入账号可以为sys或system
http://CentOS-Oracle:5560/isqlplus
http://CentOS-Oracle:5560/isqlplus/dba
http://CentOS-Oracle:1158/em

执行查询语句测试

以上画面都成功代表oracle已经正常安装了。

但由于在linux环境下oracle并不是以服务的形式安装,所以并不会在每次启动linux时,自动启动server,所以还需要作一些设定才能自动启动,将在下一份文件中提供。

 

CentOS 6.3(x86_64)下安装Oracle 10g R2

http://www.cnblogs.com/mchina/archive/2013/03/08/2934473.html 

Linux Oracle服务启动&停止脚本与开机自启动

http://www.cnblogs.com/mchina/archive/2012/11/27/2782993.html

 

我们永远相信,分享是一种美德 | We Believe, Great People Share Knowledge...

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326117197&siteId=291194637