Oracle 10.2在RHEL AS5上的安装和建库

一、安装准备
1.
硬件信息获取
(1)
查看CPU信息
[root@ahwss-bb2 /]# grep “model name” /proc/cpuinfo
model name
: Intel(R) Xeon(R) CPU
E5420
@ 2.50GHz

model name
: Intel(R) Xeon(R) CPU
E5420
@ 2.50GHz

model name
: Intel(R) Xeon(R) CPU
E5420
@ 2.50GHz

model name
: Intel(R) Xeon(R) CPU
E5420
@ 2.50GHz

(2)
查看内存信息
[root@ahwss-bb2 ~]# grep MemTotal /proc/meminfo
MemTotal:
4014080 kB

[root@ahwss-bb2 ~]# grep SwapTotal /proc/meminfo
SwapTotal:
8388456 kB

[root@ahwss-bb2 ~]# free

total
used
free
shared
buffers
cached

Mem:
4014080
3415420
598660
0
221396
2630452

-/+ buffers/cache:
563572
3450508

Swap:
8388456
112
8388344

(3)
查看文件系统信息
[root@ahwss-bb2 ~]# df -h
Filesystem
Size
Used Avail Use% Mounted on

/dev/cciss/c0d0p9
2.0G
261M
1.6G
14% /

/dev/cciss/c0d0p10
51G
5.0G
43G
11% /app


因为安装oracle软件要求oracle主目录至少有1.26G空间,/tmp目录至少有108M空间。
2.
系统信息获取
(1)
查看内核版本
[root@ahwss-bb2 ~]# uname -a
Linux ahwss-bb2 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:42:21 EST 2007 i686 i686 i386 GNU/Linux
[root@ahwss-bb2 ~]# more /etc/redhat-release
Red Hat Enterprise Linux Server release 5 (Tikanga)
[root@ahwss-bb2 ~]# more /proc/version
Linux version 2.6.18-8.el5xen (brewbuilder@ls20-bc2-14.build.redhat.com) (gcc version 4.1.1 20070105 (Red Hat 4.1.1-52)) #1 SMP Fri Jan 26 14:42:21 EST 2007
(2)
查看操作系统位数:如果根目录下有lib64目录,说明系统是64位的
[root@ahwss-bb2 /]# ls / | grep lib
lib
根目录下无lib64目录,说明此系统是32位的。
[root@ahwss-bb2 /]# getconf LONG_BIT
32
说明是32位的操作系统
(3)
查看gcc版本
[root@ahwss-bb2 /]# gcc –version
gcc (GCC) 4.1.1 20070105 (Red Hat 4.1.1-52)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

根据以上信息,需安装oracle 10.2.0.1 for linux x86 32位的安装包。安装包在http://www.oracle.com/technology/software/products/database/oracle10g/htdocs/10201linuxsoft.html页面上下载。
二、参数设置
1Hosts文件
/etc/hosts 文件中包含一个完整合法的服务器名
134.64.24.146
ahwss-bb2
ahwss-bb2

127.0.0.1
ahwss-bb2
ahwss-bb2

2.设置内核参数
(1)/etc/sysctl.conf中添加以下行:
#kernel.shmall = 2097152
#kernel.shmmax = 2147483648
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
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
运行下面的命令应用以上OS参数
[root@ahwss-bb2 ~]# /sbin/sysctl -p
(2)添加以下行到/ect/security/limits.conf文件中
*
soft
nproc

2047

*
hard
nproc
16384

*
soft
nofile 1024

*
hard
nofile 65536

注:如果不修改这些参数,在切换到oracle用户的时候(su – oracle),将会报ulimit错。
(3)如果/etc/pam.d/login文件中没有以下行,则添加以下内容:
session
required
/lib/security/pam_limits.so

(4)修改/etc/selinux/config文件来关闭linux防火墙,确保SELINUX设置如下:
SELINUX=disabled

(5)版本信息
因为默认RHEL AS5不支持oracle 10.2,0.1,所以要修改一些参数。编辑/etc/redhat-release文件,将现在的版本信息(Red Hat Enterprise Linux Server release 5 (Tikanga),替换为(Red Hat Enterprise Linux Server release 4 (Tikanga),这样才可以通过oracle的安装条件检查。
注:网上说到另外一种方法如下:
通过修改安装文件oraparam.ini,添加redhat-5(二者选一即可)
# vi /10201_database_linux32/database/install/oraparam.ini
### #[Certified Versions]

再添加
[Linux-redhat-5.0-optional]TEMP_SPACE=80
SWAP_SPACE=150
MIN_DISPLAY_COLORS=256
按这种方法修改后,不能通过oracle的安装条件检查。

(6)用户环境变量
oracle用户登陆,在.bash_profile文件尾添加以下行:
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR


ORACLE_BASE=/app/oracle10/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_SID=oracle10; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbinPATH; export PATH
PATH=$ORACLE_HOME/binPATH; export PATH


LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JREORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH


if [ $USER = “oracle” ]; then

if [ $SHELL = “/bin/ksh” ]; then


ulimit -p 16384


ulimit -n 65536


else


ulimit -u 16384 -n 65536


fi

fi

三、打系统补丁,建组、用户、目录
1.打系统补丁
(1)检查系统补丁
确定以下补丁已经打上了:
[root@ahwss-bb2 ~]# rpm – qa make gcc glibc compat-db compat-gcc compat-gcc-c++ compat-libstdc++ compat-libstdc++-devel libXp openmotif21 setarch
compat-libstdc++-7.3-2.96.128
libXp-1.0.0-8.1.el5
make-3.81-1.1
gcc-4.1.1-52.el5
compat-db-4.2.52-5.1
compat-gcc-c++-7.3-2.96.128
setarch-2.0-1.1
compat-libstdc++-devel-7.3-2.96.128
openmotif21-2.1.30-8
glibc-2.5-12
compat-gcc-7.3-2.96.128
(2)打补丁
以下是我打补丁的过程:

rpm -Uvh PATCH_NAME.rpm 安装补丁包。
[root@ahwss-bb2 app]# rpm -Uvh compat-db-4.2.52-5.1.i386.rpm
warning: compat-db-4.2.52-5.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing…

########################################### [100%]


1:compat-db

########################################### [100%]


[root@ahwss-bb2 app]# rpm -Uvh compat-gcc-7.3-2.96.128.i386.rpm
warning: compat-gcc-7.3-2.96.128.i386.rpm: Header V3 DSA signature: NOKEY, key ID db42a60e
Preparing…


########################################### [100%]


1:compat-gcc

########################################### [100%]

[root@ahwss-bb2 app]# rpm -Uvh compat-gcc-c++-7.3-2.96.128.i386.rpm
warning: compat-gcc-c++-7.3-2.96.128.i386.rpm: Header V3 DSA signature: NOKEY, key ID db42a60e
error: Failed dependencies:

compat-libstdc++ = 7.3 is needed by compat-gcc-c++-7.3-2.96.128.i386


compat-libstdc++-devel = 7.3 is needed by compat-gcc-c++-7.3-2.96.128.i386

此处提示软件包依赖关系。
[root@ahwss-bb2 app]# rpm -Uvh compat-libstdc++-7.3-2.96.128.i386.rpm
warning: compat-libstdc++-7.3-2.96.128.i386.rpm: Header V3 DSA signature: NOKEY, key ID db42a60e
Preparing…
########################################### [100%]


file /usr/lib/libstdc++-3-libc6.2-2-2.10.0.so from install ofcompat-libstdc++-7.3-2.96.128 conflicts with file from packagecompat-libstdc++-296-2.96-138

[root@ahwss-bb2 app]# rpm -Uvh
compat-libstdc++-devel-7.3-2.96.128.i386.rpm

warning: compat-libstdc++-devel-7.3-2.96.128.i386.rpm: Header V3 DSA signature: NOKEY, key ID db42a60e
error: Failed dependencies:

compat-libstdc++ = 7.3-2.96.128 is needed by compat-libstdc++-devel-7.3-2.96.128.i386

此处提示软件包依赖关系。

由于系统中已经存在旧版本的补丁包,故加–force选项,进行强制安装。
[root@ahwss-bb2 app]# rpm -Uvh compat-libstdc++-7.3-2.96.128.i386.rpm –force
warning: compat-libstdc++-7.3-2.96.128.i386.rpm: Header V3 DSA signature: NOKEY, key ID db42a60e
Preparing…
########################################### [100%]


1:compat-libstdc++
########################################### [100%]

2.建组、用户、目录
(1)建组
groupadd oinstall
groupadd dba
groupadd oper
(2)建用户
useradd -g oinstall -G dba oracle
passwd oracle
(3)oracle目录
mkdir -p /app/oracle10/app/oracle/product/10.2.0/db_1
chown -R oracle:install /app/oracle10
chmod -R 775 /app/oracle10/app/oracle
四、安装oracle软件
0.执行命令、
vncviewer连接134.64.24.146,执行如下命令:
[root@ahwss-bb2 ~]#startx
[root@ahwss-bb2 ~]#xhost +
[root@ahwss-bb2 ~]#who
[root@ahwss-bb2 ~]#su – oracle
[oracle@ahwss-bb2 ~]$export DISPLAY=134.64.24.146:1.0
[oracle@ahwss-bb2 ~]$xclock
(
此处要确认看到时钟)

[oracle@ahwss-bb2 ~]$export LC_CTYPE=c.iso88591

(
设置字符码,如果字符不一样,则会出现乱码)

[oracle@ahwss-bb2 ~]$cd ../database
[oracle@ahwss-bb2 ~]$./runInstaller

Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *