Red Hat Enterprise Linux 5 安装oracle10g

1.1安装rpm包,安装oracle所依赖包有:

通过#rpm -qa 包名*  查询还有哪些包系统未被安装,将其安装。一般需要安装openmotif 、libXp、compat-db包。

# rpm –ivh 包名(包装RPM包)。

       创建oracle组和用户

创建用于安装和污染源oracle 10g软件的linux组和用户帐户。用户帐户将称为oracle,而组将称为oinstall和dba。以root用户身份执行以下命令。

# groupadd oinstall

# groupadd dba

# useradd –m –g oinstall –G dba oracle

#  passwd oracle(设置用户oracle密码)

例如:

# passwd oracle

Changing password for user oracle.

New Unix password:

Retype new password:

passwd:all authentication tokens updated successfully.

创建oracle安装目录

# mkdir –p /DBSoftware/app/oracle(创建oracle安装目录ORACLE_BASE)

# chown –R oracle:oinstall /DBSoftware(把文件夹授权给用户oracle)

1.3  配置linux内核参数

# vi  /etc/sysctl.conf

###############

kernel.sysrq=1

 kernel.msgmni=1024

 kernel.shmmax=2147483648

 kernel.shmmni=4906

 kernel.shmall=2097152

 kernel.sem=1024 64000 200 512

 fs.file-max=65536

 net.ipv4.ip_local_port_range=1024 65000

 net.ipv4.tcp_sack=0

 net.ipv4.tcp_timestamps=0

 net.ipv4.tcp_max_syn_backlog=8192

 net.ipv4.tcp_keepalive_time=120

 net.core.rmem_default=262144

 net.core.rmem_max=262144

 net.core.wmem_default=262144

 net.core.wmem_max=262144

 ##################

保存退出。

无需重启,执行以下命令使内核参数生效

#  /sbin/sysctl -p

以 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

1.4 为oracle用户设置shell限制

# vi /etc/security/limits.conf

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

加上以上字符串。

保存退出。

1.5 设置oracle环境变量

# vi /etc/profile

export DISPLAY=:0.0

保存退出。

# source /etc/profile(让修改的环境变量生效)

# su – oracle

# vi .bash_profile

export ORACLE_BASE=/DBSoftware/app/oracle

export ORACLE_SID=orcl

export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1

export PATH=$PATH:$ORACLE_HOME/bin

export LD_LIBARY_PATH=$ORACLE_HOME/lib

export NLS_LANG="Simplified Chinese_China".ZHS16GBK

export LANG=en_US(设置以英文显示)

export PATH

保存退出

1.6 修改hosts文件

# vi /etc/hosts

在其中加入以下字符串

IP_address   DB  localhost

保存退出

1.7修改redhat版本文件

 #vi /etc/redhat-release

把版本改为Red Hat Enterprise Linux Server release 4

1.8安装oracle 10g软件

解压oracle 10g安装文件:

首先把10201_database_linux32.zip放到文件夹/opt下,解压文件

# cd /opt

# unzip 10201_database_linux32.zip# cd database/

# chmod +x *.sh(授权.sh文件可执行)

# xhost local:oracle non-network connections local being added to access control list

# su – oracle

$cd /opt/database/

$ ./runInstaller

安装后测试:

$ sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on 星期五 6月 3 18:56:38 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

SQL> conn / as sysdba
Connected.

连接成功。

激活scott用户:

alter user scott account unlock;

User altered.

SQL> conn scott/tiger
ERROR:
ORA-28001: the password has expired


Changing password for scott
New password:
Retype new password:
Password changed
Connected.
SQL> conn scott/tiger
Connected.

posted on 2011-06-03 19:02  ljh22  阅读(347)  评论(0编辑  收藏  举报

导航