Chinaunix首页 | 论坛 | 博客
  • 博客访问: 969958
  • 博文数量: 358
  • 博客积分: 8185
  • 博客等级: 中将
  • 技术积分: 3751
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-15 16:27
个人简介

The views and opinions expressed all for my own,only for study and test, not reflect the views of Any Company and its affiliates.

文章分类

全部博文(358)

文章存档

2012年(8)

2011年(18)

2010年(50)

2009年(218)

2008年(64)

我的朋友

分类: Oracle

2009-07-29 23:09:39

Oracle10gR2 CentOS5.3上的安装

利用软件:

VmwareXmanager, CentOS5.3, Oracle10gR2

 

安装前准备:

1,察看操作系统版本

[root@centos rpm]# cat /etc/issue

CentOS release 5.3 (Final)

Kernel \r on an \m

2,察看内核版本

[root@centos rpm]# uname -r

2.6.18-128.el5

3,察看已安装和未安装的包

[root@centos rpm]# rpm -q gcc make binutils openmotif setarch compat-db compat-gcc compat-

gcc-c++ compat-libstdc++ compatlibstdc+-devel control-center glibc libstdc++ libstdc++-dev

el sysstat

gcc-4.1.2-44.el5

make-3.81-3.el5

binutils-2.17.50.0.6-9.el5

package openmotif is not installed

setarch-2.0-1.1

package compat-db is not installed

package compat-gcc is not installed

package compat-gcc-c++ is not installed

package compat-libstdc++ is not installed

package compatlibstdc+-devel is not installed

control-center-2.16.0-16.el5

glibc-2.5-34

libstdc++-4.1.2-44.el5

libstdc++-devel-4.1.2-44.el5

package sysstat is not installed

[root@centos rpm]#

4,CentOS5的安装盘中找到未安装的包,上传到系统中,安装

源文件..\centos-5.3-i386-bin-dvd.iso\CentOS\

利用WinScp上传到系统上某个路径/root/uploadfile/rpm

[root@centos rpm]# pwd

/root/uploadfile/rpm

[root@centos rpm]# ls

compat-db-4.2.52-5.1.i386.rpm           compat-libstdc++-33-3.2.3-61.i386.rpm

compat-gcc-34-3.4.6-4.i386.rpm          openmotif22-2.2.3-18.i386.rpm

compat-gcc-34-c++-3.4.6-4.i386.rpm      openmotif-2.3.1-2.el5.i386.rpm

compat-gcc-34-g77-3.4.6-4.i386.rpm      openmotif-devel-2.3.1-2.el5.i386.rpm

compat-libstdc++-296-2.96-138.i386.rpm  sysstat-7.0.2-3.el5.i386.rpm

[root@centos rpm]#

5,安装上传的包

[root@centos rpm]# rpm -ivh *.rpm

warning: compat-db-4.2.52-5.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897

error: Failed dependencies:

        compat-libf2c-34 = 3.4.6-4 is needed by compat-gcc-34-g77-3.4.6-4.i386

        libg2c.so.0 is needed by compat-gcc-34-g77-3.4.6-4.i386

        libXp.so.6 is needed by openmotif22-2.2.3-18.i386

        libXp.so.6 is needed by openmotif-2.3.1-2.el5.i386

        libXext-devel is needed by openmotif-devel-2.3.1-2.el5.i386

        libXft-devel is needed by openmotif-devel-2.3.1-2.el5.i386

        libXmu-devel is needed by openmotif-devel-2.3.1-2.el5.i386

        libXp-devel is needed by openmotif-devel-2.3.1-2.el5.i386

        libXp.so.6 is needed by openmotif-devel-2.3.1-2.el5.i386

        libXt-devel is needed by openmotif-devel-2.3.1-2.el5.i386

        libjpeg-devel is needed by openmotif-devel-2.3.1-2.el5.i386

        libpng-devel is needed by openmotif-devel-2.3.1-2.el5.i386

[root@centos rpm]#

安装包有依赖的关系,把所依赖的包再上传一起安装。

经过多次试探后安装

root@centos rpm]# rpm -ivh *.rpm

warning: compat-gcc-34-3.4.6-4.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897

Preparing...                ########################################### [100%]

   1:libXp                  ########################################### [  4%]

   2:compat-gcc-34          ########################################### [  7%]

   3:openmotif              ########################################### [ 11%]

   4:compat-libf2c-34       ########################################### [ 15%]

   5:compat-gcc-34-g77      ########################################### [ 19%]

   6:compat-gcc-34-c++      ########################################### [ 22%]

   7:openmotif22            ########################################### [ 26%]

   8:compat-libstdc++-296   ########################################### [ 30%]

   9:libXau-devel           ########################################### [ 33%]

  10:freetype-devel         ########################################### [ 37%]

  11:fontconfig-devel       ########################################### [ 41%]

  12:libXp-devel            ########################################### [ 44%]

  13:xorg-x11-util-macros   ########################################### [ 48%]

  14:libpng-devel           ########################################### [ 52%]

  15:libjpeg-devel          ########################################### [ 56%]

  16:xorg-x11-proto-devel   ########################################### [ 59%]

  17:libX11-devel           ########################################### [ 63%]

  18:libXext-devel          ########################################### [ 67%]

  19:libXrender-devel       ########################################### [ 70%]

  20:libXft-devel           ########################################### [ 74%]

  21:libICE-devel           ########################################### [ 78%]

  22:libSM-devel            ########################################### [ 81%]

  23:mesa-libGL-devel       ########################################### [ 85%]

  24:libXdmcp-devel         ########################################### [ 89%]

  25:libXt-devel            ########################################### [ 93%]

  26:libXmu-devel           ########################################### [ 96%]

  27:openmotif-devel        ########################################### [100%]

[root@centos rpm]#

6,察看系统内存

[root@centos rpm]# grep MemTotal /proc/meminfo

MemTotal:      1035244 kB

[root@centos rpm]# grep SwapTotal /proc/meminfo

SwapTotal:     1052248 kB

所需最小 RAM 512MB,而所需最小交换空间为 1GB。对于 RAM 小于或等于 2GB 的系统,交换空间应为 RAM 数量的两倍;对于 RAM 大于 2GB 的系统,交换空间应为 RAM 数量的一到两倍。Oracle 10g 软件还需要 2.5GB 的可用磁盘空间,而数据库则另需 1.2GB 的可用磁盘空间。/tmp 目录至少需要 400MB 的可用空间。要检查系统上的可用磁盘空间,运行以下命令:

[root@centos rpm]# df -h

文件系统              容量  已用 可用 已用% 挂载点

/dev/sda1             6.8G  4.1G  2.4G  63% /

tmpfs                 506M     0  506M   0% /dev/shm

7,配置 Linux 内核参数

root 用户身份,修改/etc/sysctl.conf追加

Linux 内核非常出色。与大多数其他 *NIX 系统不同,Linux 允许在系统启动和运行时修改大多数内核参数。完成内核参数更改后不必重新启动系统。Oracle 数据库10g 需要以下所示的内核参数设置。其中给出的是最小值,因此如果您的系统使用的值较大,则不要更改它

[root@centos tmp]# id

uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel) context=root:system_r:unconfined_t:SystemLow-SystemHigh

[root@centos tmp]# vi /etc/sysctl.conf

追加

#use for oracle10g
#kernel.shmall = 2097152
#kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=262144
net.core.rmem_max=262144
net.core.wmem_default=262144
net.core.wmem_max=262144

 

[root@centos tmp]# /sbin/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

kernel.msgmnb = 65536

kernel.msgmax = 65536

kernel.shmmax = 4294967295

kernel.shmall = 268435456

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

fs.file-max = 65536

net.ipv4.ip_local_port_range = 1024 65000

net.core.rmem_default = 262144

net.core.rmem_max = 262144

net.core.wmem_default = 262144

net.core.wmem_max = 262144

[root@centos tmp]#

root 用户身份运行以下命令来验证您的设置

/sbin/sysctl -a | grep shm

/sbin/sysctl -a | grep sem

/sbin/sysctl -a | grep file-max

/sbin/sysctl -a | grep ip_local_port_range

8,为 oracle 用户设置 Shell 限制

/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

#vi /etc/pam.d/login  在其中添加下面的代码:
session required /lib/security/pam_limits.so

#vi /etc/selinux/config 确保以下内容
SELINUX=disabled

因为oracle 10g不支持centos,所以修改CentOS 5的版本
#vi /etc/redhat-release
redhat-4

另外在安装oracle数据库的时候要注意/etc/hosts/etc/sysconfig/network文件主机名的一致性,否则会在后面运行netcadbca可能出现错误提示

[root@centos tmp]# more /etc/hosts

# Do not remove the following line, or various programs

# that require network functionality will fail.

127.0.0.1               centos localhost.localdomain localhost

::1             localhost6.localdomain6 localhost6

[root@centos tmp]# more /etc/sysconfig/network

NETWORKING=yes

NETWORKING_IPV6=yes

HOSTNAME=centos

GATEWAY=192.168.0.1

[root@centos tmp]#

 

安装

1,  创建oracle用户帐户

[root@centos rpm]# /usr/sbin/groupadd oinstall

 [root@centos rpm]# /usr/sbin/groupadd dba

[root@centos rpm]# useradd -m -g oinstall -G dba oracle

 [root@centos rpm]# passwd oracle

Changing password for user oracle

New UNIX password:

BAD PASSWORD: it is based on a dictionary word

Retype new UNIX password:  oracle

passwd: all authentication tokens updated successfully.

[root@centos rpm]#

2创建目录

[root@centos rpm]# mkdir -p /u01/app/oracle

[root@centos rpm]# mkdir -p /u02/oradata

[root@centos rpm]# chown -R oracle:oinstall /u01/app/oracle /u02/oradata

[root@centos rpm]# chown -R 775 /u01/app/oracle /u02/oradata

 

3,修改./.bash_profile

[root@centos rpm]# id

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

追加

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/10.2.0.1

export ORACLE_SID=gaudi

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

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

#用于在window端启动Xmanager显示安装图形界面

DISPLAY=192.168.0.1:0;export DISPLAY

 

4,检查下环境变量是否设对了

-bash-3.2$ id

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

-bash-3.2$ env | grep ORA

ORACLE_SID=gaudi

ORACLE_BASE=/u01/app/oracle

ORACLE_HOME=/u01/app/oracle/product/10.2.0.1

-bash-3.2$ env | grep DIS

DISPLAY=192.168.0.1:0 

-bash-3.2$

 

5,拷贝软件

[root@centos rpm]#

mv /root/10201_database_linux32.zip /u01/
unzip /u01/10201_database_linux32.zip

总计 639M

drwxr-xr-x 3 oracle oinstall 4.0K 05-30 08:06 10201_database_linux32

drwxr-xr-x 5 oracle oinstall 4.0K 07-27 23:41 ..

-rwxrwxrwx 1 root   root     638M 07-27 23:41 10201_database_linux32.zip

drwxr-xr-x 3 oracle oinstall 4.0K 07-27 23:44 .

 

6,Windows中启动Xmanager

Xmanager – Passive

 

7,安装

-bash-3.2$ export LANG=en_US  /设置临时环境变量,解决oracle图形界面显示乱码的问题

-bash-3.2$ ./runInstaller

 

8,error

Oui-10033

chown -R oracle:oinstall /u01/

 

参考文档:

安装文档

http://liulin888.blog.163.com/blog/static/2744218120094351458535/

http://blog.ylike.net/?p=43

Vmware Workstation增加硬盘空间

 

阅读(2682) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~