天天看点

centos5.4 安装配置oracle10g

准备环境:

首先自然是一个5.4的centos操作系统了

<a href="http://jueshitou.blog.51cto.com/attachment/200911/18/385947_12585640358oFn.png"></a>

把需要安装的oracle11g数据可上传到服务器,我这里使用的是UltraEdit中自带的sftp来传输的.(sftp的速度比ftp快很多,据说是经过压缩处理的,我没有验证过,不过感觉比FTP快很多!)我把安装文件上传到了/var/ftp/pub/目录下

<a href="http://jueshitou.blog.51cto.com/attachment/200911/18/385947_1258564051CicB.png"></a>

我单独添加了一块硬盘来作为oracle的安装分区,并且让/opt挂载,来安装oracle11G,所以格式化硬盘,写入fstab开机挂载.

[root@jadeshow ~]# mkfs -t ext3 /dev/hdb 

mke2fs 1.39 (29-May-2006) 

/dev/hdb is entire device, not just one partition!   //提示是一

//个设备,这里可以选择不管他,或者你划分一个区出来. 

Proceed anyway? (y,n) y 

Filesystem label= 

OS type: Linux 

Block size=4096 (log=2) 

Fragment size=4096 (log=2) 

1048576 inodes, 2097152 blocks 

104857 blocks (5.00%) reserved for the super user 

First data block=0 

Maximum filesystem blocks=2147483648 

64 block groups 

32768 blocks per group, 32768 fragments per group 

16384 inodes per group 

Superblock backups stored on blocks: 

        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Writing inode tables: done 

Creating journal (32768 blocks): 

done 

Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 24 mounts or 

180 days, whichever comes first.  Use tune2fs -c or -i to override.

<a href="http://jueshitou.blog.51cto.com/attachment/200911/18/385947_1258564067g4jF.png"></a>

<a href="http://jueshitou.blog.51cto.com/attachment/200911/18/385947_12585640767LmV.png"></a>

Vim /etc/sysctl.conf添加

kernel.shmmax = 2147483648

上面kernel.shmmax/kernel.sem等是典型的核心参数配置.您可能需要根据您的实际环境进行适当的变动

检查所作更改是否正确

[root@jadeshow oracle]# sysctl -a |grep sem

kernel.sem = 250        32000   100     128

[root@jadeshow oracle]# sysctl -a |grep shm

vm.hugetlb_shm_group = 0

kernel.shmmni = 4096

kernel.shmall = 268435456

[root@jadeshow oracle]# sysctl -a |grep file-max

fs.file-max = 65536

[root@jadeshow oracle]# sysctl -a |grep ip_local

net.ipv4.ip_local_port_range = 1024     65000

[root@jadeshow database]# vim /etc/selinux/config

# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

#       enforcing - SELinux security policy is enforced.

#       permissive - SELinux prints warnings instead of enforcing.

#       disabled - SELinux is fully disabled.

SELINUX=disabled       //关闭selinux

# SELINUXTYPE= type of policy in use. Possible values are:

#       targeted - Only targeted network daemons are protected.

#       strict - Full SELinux protection.

SELINUXTYPE=targeted

设定用户shell

一般来说,出于性能上的考虑,还需要需要进行如下的设定,以便改进Oracle用户的有关 nofile(可打开的文件描述符的最大数)和nproc(单个用户可用的最大进程数量)

[root@jadeshow oracle]# vim /etc/security/limits.conf

# 添加如下的行

*               soft    nproc   2047       //软限制

*               hard    nproc   16384   //硬限制

*               soft    nofile  1024       

*               hard    nofile  65536

添加如下的行到/etc/pam.d/login 文件:

session required     /lib/security/pam_limits.

<a href="http://jueshitou.blog.51cto.com/attachment/200911/18/385947_1258564085mY3j.png"></a>

软件要求:

binutils-2.17.50.0.6-2.el5,compat-libstdc++-33-3.2.3-61,elfutils-libelf-0.125-3.el5,elfutils-libelf-devel-0.125,gcc-4.1.1-52,gcc-c++-4.1.1-52,glibc-2.5-12,glibc-common-2.5-12,glibc-devel-2.5-12,glibc-headers-2.5-12,libaio-0.3.106,libaio-devel-0.3.106 ,libgcc-4.1.1-52,libstdc++-4.1.1 ,libstdc++-devel-4.1.1-52.e15,make-3.81-1.1,sysstat-7.0.0

此处建议使用yum来安装,依次使用yum install &lt;安装的软件&gt; 来安装.

设置oracle环境变量

<a href="http://jueshitou.blog.51cto.com/attachment/200911/18/385947_1258564092VkdY.png"></a>

用户管理

[

root@jadeshow /]# groupadd dba         //添加一个dba用户组 

[root@jadeshow /]# groupadd oinstall 

[root@jadeshow /]# useradd   -g oinstall -G dba oracle                                                 //添加一个用户oracle其主组属于oinstall 从组属于 dba

[root@jadeshow opt]# passwd oracle  //修改oracle用户的密码

[root@jadeshow opt]# mkdir -p /opt/oracle/install//创建oracle安装目录

[root@jadeshow opt]#chown -R oracle.dba /opt/oracle/ //修改目录所属组及所属用户

[root@jadeshow oracle]#cp /etc/sysconfig/i18n /opt/oracle/.i18n

配置用户环境:

[root@jadeshow ~]# vim  /home/oracle/.bash_profile

# .bash_profile

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

        . ~/.bashrc

fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH

export ORACLE_BASE=/opt/oracle/app

export ORACLE_HOME=$ORACLE_BASE/product/10.2.0.1

export ORACLE_SID=orcl

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

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib

解压数据库

[root@jadeshow pub]# unzip 10201_database_linux32.zip

启动图形界面  init 5

以oracle用户登录

到安装文件的目录下 执行

./runinstaller

(菜鸟写博,老鸟飞过。欢迎拍砖,深入交流!)

     本文转自 珏石头 51CTO博客,原文链接:http://blog.51cto.com/gavinshaw/229394,如需转载请自行联系原作者