RedHat 4 安装 Oracle 10g

配置RedHat AS 4


操作系统版本:Red Hat Enterprise Linux AS release 4 (Nahant)

       Kernel 2.6.21-4.EL on an i686


按照常规来安装操作系统,记得要安装开发工具(gcc等必要工具).



必要的硬件信息检查:


物理内存

512M(最小值)

# grep MemTotal /proc/meminfo


交换空间

1.0 GB或者2倍内存大小(最小值)

# grep SwapTotal /proc/meminfo


/tmp 空间

400 MB (最小值)

# df -k /tmp


软件所需空间

2.5 GB (最小值)

# df -k (空间越大越好,如果是正式系统,应该进行详尽的规划)


数据库文件

1.2 GB (最小值)

# df -k (空间越大越好,如果是正式系统,应该进行详尽的规划)


检查完如上各项之后, 应该修改核心参数.执行如下命令:


#vi /etc/sysctl.conf

#注释:#表示使用root用户操作,$表示使用oracle 用户进行操作.提示符后面的蓝色部分表示需要输入的命令,以下同.


在该文件末尾加入如下内容:


#-----------Begin from here--------------------------------------

kernel.shmall = 2097152

#kernel.shmmax = 2147483648


kernel.shmmax = 4294967295#liuzy suggested(根据实际情况变化)

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

fs.file-max = 65536

net.ipv4.ip_local_port_range = 1024 65000

#--------------End here--------------------------------------------


编辑完之后,保存,执行 # /sbin/sysctl -p 命令操作来使我们所做的变更生效.


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


关于这些核心参数的说明在Oracle的Oracle9i Installation Guide Release 2 (9.2.0.1.0) for UNIX Systems

中有很详细的说明.( http://download-west.oracle.com/docs/html/A96167_01/toc.htm )


然后,应该检查一下上面的操作是否正确:


# /sbin/sysctl -a | grep sem

# /sbin/sysctl -a | grep shm

# /sbin/sysctl -a | grep file-max

# /sbin/sysctl -a | grep ip_local_port_range



为Oracle用户设定Shell的限制


一般来说,出于性能上的考虑,还需要需要进行如下的设定,以便改进Oracle用户的有关 nofile(可打开的文件

描述符的最大数)和nproc(单个用户可用的最大进程数量)


# vi /etc/security/limits.conf

# 添加如下的行


* soft nproc 2047

* hard nproc 16384

* soft nofile 1024

* hard nofile 65536

也有一说是:暂时按照上一种

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536


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

session required /lib/security/pam_limits.so

编辑 /etc/profile 文件,添加如下部分:





if [ $USER = "oracle" ]; then

if [ $SHELL = "/bin/ksh" ]; then

ulimit -p 16384

ulimit -n 65536

else

ulimit -u 16384 -n 65536

fi

fi


之后,

#source /etc/profile

执行$ unlimit 验证一下.

检查并安装相关补丁


在这个版本的RHEL上安装Oracle,必须要有几个软件包. 确认以下 rpm包都已经安装:


make-3.79

binutils-2.11

openmotif-2.2.2-16

setarch-1.3-1

compat-db-4.0.14.5

compat-gcc-7.3-2.96.122

compat-gcc-c++-7.3-2.96.122

compat-libstdc++-7.3-2.96.122

compat-libstdc++-devel-7.3-2.96.122


# rpm -qa | grep compat

# 在我的机器上输出如下:

compat-gcc-c++-7.3-2.96.122

compat-libstdc++-7.3-2.96.122

compat-libstdc++-devel-7.3-2.96.122

compat-glibc-7.x-2.2.4.32.5

compat-db-4.0.14-5

compat-gcc-7.3-2.96.122


# rpm -qa | grep openmotif

openmotif-devel-2.2.2-16

openmotif-2.2.2-16


# rpm -qa | grep setarch

setarch-1.3-1


上面显示的内容是在笔者已经安装了具体的RPM包之后的结果.一般情况下,你的系统上的输出结果和这个不同.如果个

别包没有安装,把系统安装光盘mount上,找到具体的软件包(大多数在第三张光盘上),然后利用如下的命令来安装相应

的包:


# rpm -ivh compat.....rpm


要额外注意的是,这些软件包之间是有依赖性的,先后的顺序要找好.否则会报告不能安装的错误.


此外,最好验证一下 gcc和glibc的版本(要求是gcc-3.2.3-2 或者更高)


#gcc -v

#rpm -q glibc


注:如果验证不成功也没有关系(只是警告),照样可以继续安装


创建用户和相关的组


# /usr/sbin/groupadd oinstall

# /usr/sbin/groupadd dba

#/usr/sbin/useradd -g oinstall -G dba oracle

如果只是测试目的的话,不创建oinstall组也没什么. 不过还是规范一点比较好.如果oracle 用户和dba组等已经存在,作

适当的调整即可.


#mkdir -p /opt/app/oracle/product/10.1.0/db_1


检查并调整环境变量


登录为oracle用户


#passwd oracle


#111111


#111111

# su - oracle

$ cd

$ vi .bash_profile


#添加如下内容,你的具体值应该不会和这个完全相同.


export ORACLE_BASE=/opt/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/10.1.0/db_1

export ORACLE_SID=ORCL

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

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

export LC_CTYPE=en_US.UTF-8


然后执行

$ source .bash_profile

使环境变量生效. /opt/app/oracle 等目录应该建立好并做合适的授权.


$exit


#chown oracle.oinstall -R /opt/app/ #让oinstall 组的oracle用户对/opt/app下面拥有权限


注:如有必要修改/etc/redhat-release内容为 : Red Hat Enterprise Linux AS release 3 (Taroon)




开始安装10g


使用winscp拷贝ship.db.lnx32.cpio.gz到相应的目录下面比如:/


#gunzip ship.db.lnx32.cpio.gz


#cpio ?idcmv < ship.db.lnx32.cpio



$ sh /Disk1/runInstaller


如果不能出现安装画面,查看本文后面的FAQ。


出现提示并按照提示执行后:


Creating the Oracle inventory pointer file (/etc/oraInst.loc)


Changing groupname of /opt/app/oracle/oraInventory to oinstall.


非常值得称道的是,10g的安装相比以前的多了一个 Checking operating system certification 的步骤。特别实用。

安装文件会自动检测所需的条件。如果有不符合的地方,安装程序会报告给你.并会给出具体原因。大大减少了出错的可能.

下面是检查成功输出的内容 :


Checking operating system certification

Expected result: One of redhat-2.1,redhat-3,UnitedLinux-1.0

Actual Result: redhat-3

Check complete. The overall result of this check is: Passed

=======================================================================


Checking kernel parameters

Checking for VERSION=2.4.9.25; found VERSION=2.4.21. Passed

Checking for shmall=2097152; found shmall=2097152. Passed

Checking for shmseg=10; found shmseg=4096. Passed

Checking for semmsl=250; found semmsl=250. Passed

Checking for semmni=128; found semmni=128. Passed

Checking for filemax=65536; found filemax=65536. Passed

Checking for shmmni=4096; found shmmni=4096. Passed

Checking for semmns=32000; found semmns=32000. Passed

Checking for semopm=100; found semopm=100.Passed

Checking for shmmin=1; found shmmin=1. Passed

Checking for shmmax=2147483648; found shmmax=2147483648. Passed

Check complete. The overall result of this check is: Passed

=======================================================================


Checking recommended operating system packages

Checking for make-3.79; found make-3.79.1-17. Passed

Checking for binutils-2.11.90.0.8-12; found binutils-2.14.90.0.4-26. Passed

Checking for gcc-2.96; found gcc-3.2.3-20. Passed

Checking for openmotif-2.1.30-11; found openmotif-2.2.2-16. Passed

Check complete. The overall result of this check is: Passed

=======================================================================


Checking recommended glibc version

Expected result: 2.2.4.31.7

Actual Result: 2.3.2.95.3

Check complete. The overall result of this check is: Passed

=======================================================================


Validating ORACLE_BASE location (if set)

Check complete. The overall result of this check is: Passed

=======================================================================


其他的步骤比较清晰,不再赘述.

最后系统会提示你运行root.sh文件.按照提示做即可.


FAQ (在Linux平台安装Oracle比较常见)


1. 不能启动安装界面.运行runInstaller提示信息类似如下:


xlib:connection to "localhost:0.0" refused by server

xlib:client is not authorized to connect to server


Exception in thread "main" java.lang.InternalError:can't connect to x11 window server using "localhost:0.0"

at .......


解决办法: 设定你的DISPLAY环境参数.# export DISPLAY= your_IPaddress :0.0把your_IPaddress换成你的IP.或者

用root简单的执行一下# xhost + (要注意这样会有安全上的隐患)


2.安装界面显示很多"口口"样子的乱码


解决办法:查看locale输出

# locale

LANG=en_US.UTF-8

LC_CTYPE=zh_CN.GB18030

LC_NUMERIC="en_US.UTF-8"

LC_TIME="en_US.UTF-8"

LC_COLLATE="en_US.UTF-8"

LC_MONETARY="en_US.UTF-8"

LC_MESSAGES="en_US.UTF-8"

LC_PAPER="en_US.UTF-8"

LC_NAME="en_US.UTF-8"

LC_ADDRESS="en_US.UTF-8"

LC_TELEPHONE="en_US.UTF-8"

LC_MEASUREMENT="en_US.UTF-8"

LC_IDENTIFICATION="en_US.UTF-8"

LC_ALL=


执行#export LC_CTYPE=en_US.UTF-8 然后重新调用安装程序.


3. 用IE登录Linux服务器上的em出现乱码


 在Linux(Unix) 环境下成功安装了Oracle 10g,从windows下用IE浏览器登录 10g 的em, 按钮是"口口"这样的方框.


解决办法: 参考 http://www.dbanotes.net/Oracle/Oracle-10g-font.properties.htm 或者是参考这个 http://www.linuxsir.org/bbs/showthread.php?s=&threadid=98591 后者比较彻底,前者比较"Quick & Dirty ".


4.创建数据库的时候出现ORA-03113的错误


解决办法: 查看核心参数是否调整正确.参考http://www.dbanotes.net/Oracle/ORA-03113.htm


5. RedHat 9 / FC1等系统10g不支持如何安装?


解决办法:在10g不支持的Linux发行版上安装10g的解决方法


1). 运行runInstaller -ignoreSysPrereqs,这样会跳过检查


2). 摘自 http://www.puschitz.com/修改/etc/redhat-release文件:


#su - root

#cp /etc/redhat-release /etc/redhat-release.backup

#cat > /etc/redhat-release << EOF

Red Hat Enterprise Linux AS release 3 (Taroon)

EOF


安装完毕,执行如下操作:

#su - root

#cp /etc/redhat-release.backup /etc/redhat-release


3). http://www.dbanotes.net/Oracle/10G-Beta-Install-Bug.htm


同样的思路,我们可以修改Oracle 的install/oraparam.ini文件达到目的


6 如何关掉那些 ocssd.bin 进程?

解决办法:编辑/etc/inittab文件(做好备份)

注释掉这一行:

h1:3:respawn:/etc/init.d/init.cssd run >/dev/null 2>&1

参考信息

Werner Puschitz 的 10g 安装指南 http://www.puschitz.com/InstallingOracle10g.shtml

ITPUB论坛10g版块Kamus等的大作http://www.itpub.net/forumdisplay.php?s=&forumid=70

关于核心参数等信息请查找 Google http://www.google.com/

Oracle Database Quick Installation Guide 10 g Release 1 (10.1) for Linux x86

http://download-west.oracle.com/docs/html/B10813_01/toc.htm

Oracle Database Installation Guide 10 g Release 1 (10.1) for UNIX Systems

http://download-west.oracle.com/docs/html/B10811_02/toc.htm

DBAnotes.net 包括不少和Oracle有关的信息 http://www.dbanotes.net/

--------------------------------------------------------------------------------


启动

1.使用oracle账户登陆


2.lsnrctl start


3.sqlplus /nolog


4.conn / as sysdba


5.startup


排错(肯定会碰到问题)


1.根据提示 cp /opt/app/oracle/product/10.1.0/db_1/dbs/init.ora


/opt/app/oracle/product/10.1.0/db_1/dbs/initORCL.ora


2.清除initORCL.ora里面所有的内容


3.把这句话写入:SPFILE='/opt/app/oracle/product/10.1.0/db_1/dbs/spfileorcl.ora'
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值