CentOS5.5安装ORACLE10GR2

来源:互联网 发布:岂凡网络年终奖 编辑:程序博客网 时间:2024/04/30 09:45

1:关闭yum
rm /var/run/yum.pid
-------------------------------------------------------------------------------------------------------------
2:检查必须的rpm包
rpm -q binutils-2.17.50.0.6-6.el5 /
compat-db-4.2.52-5.1 /
compat-libstdc++-33-3.2.3-61 /
rpm-build-4.4.2.3-18.el5 /
control-center-2.16.0-16.el5 /
gcc-4.1.2-42.el5 /
gcc-c++-4.1.2-42.el5 /
glibc-2.5-24 /
glibc-common-2.5-24 /
libgnome-2.16.0-6.el5 /
libstdc++-4.1.2-42.el5 /
libstdc++-devel-4.1.2-42.el5 /
make-3.81-3.el5 /
ksh-20060214-1.7 /
sysstat-7.0.2-1.el5 /
gnome-screensaver-2.16.1-8.el5 /
setarch-2.0-1.1 /
libXp-1.0.0-8.1.el5

检查结果如下,如果没有安装则安装相关rpm包
package binutils-2.17.50.0.6-6.el5 is not installed
package compat-db-4.2.52-5.1 is not installed
package compat-libstdc++-33-3.2.3-61 is not installed
package rpm-build-4.4.2.3-18.el5 is not installed
control-center-2.16.0-16.el5
------------------------------------------------------------
package gcc-4.1.2-42.el5 is not installed
package gcc-c++-4.1.2-42.el5 is not installed
package glibc-2.5-24 is not installed
package glibc-common-2.5-24 is not installed

yum install gcc-c++
则:
gcc-4.1.2-42.el5 /
gcc-c++-4.1.2-42.el5 /
glibc-2.5-24 /
glibc-common-2.5-24 /都已安装好
------------------------------------------------------------
libgnome-2.16.0-6.el5
package libstdc++-4.1.2-42.el5 is not installed
package libstdc++-devel-4.1.2-42.el5 is not installed
make-3.81-3.el5
package ksh-20060214-1.7 is not installed
package sysstat-7.0.2-1.el5 is not installed
gnome-screensaver-2.16.1-8.el5
setarch-2.0-1.1
package libXp-1.0.0-8.1.el5 is not installed
-------------------------------------------------------------------------------------------------------------
3:修改主机名
主机名修改文件有/etc/hosts 、/etc/sysconfig/network 、hostname 要改的名字(改完要重启不然无发生效)
vim /etc/hosts

92.168.10.10 localhost.oracle oracle
127.0.0.1 localhost.localdomain localhost
-------------------------------------------------------------------------------------------------------------
4:修改系统内核参数,增加以下内容
vim /etc/sysctl.conf

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 = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144

再运行sysctl -p应用以上参数
/sbin/sysctl -p
-------------------------------------------------------------------------------------------------------------
5:修改/etc/security/limits.conf,增加如下内容
vim /etc/security/limits.conf

oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
-------------------------------------------------------------------------------------------------------------
6:修改/etc/pam.d/login文件,增加如下内容
vim /etc/pam.d/login

session required /lib/security/pam_limits.so
session required pam_limits.so
-------------------------------------------------------------------------------------------------------------
7:修改vi /etc/profile文件,增加如下内容
vim /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
-------------------------------------------------------------------------------------------------------------
8:用户设置与配置
添加oinstall和dba用户组
groupadd -g 501 oinstall
groupadd -g 502 dba

添加oracle用户
useradd -g oinstall -G dba -u 501 -d /oracle oracle

修改/oracle权限
chown -R oracle:oinstall /oracle

使用oracle用户登录,修改.profile文件。
# su – oracle
$ pwd
/oracle
$ vim .bash_profile
加入以下内容
# !/usr/bin/bash
umask 022
ORACLE_BASE=/oracle
export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/oracle/product/10.2.0/db_1
export ORACLE_HOME
ORACLE_SID=manager
export ORACLE_SID
PATH=$PATH:$ORACLE_HOME/bin
export PATH
   
创建相应的目录
$ pwd
/oracle
$ mkdir app
$ mkdir data
-------------------------------------------------------------------------------------------------------------
9:修改Centos5.2发行标识
由于oracle10g具有系统安装监测,当检测到的系统不符合安装配置规定的要求时,安装不能正常进行,故要更改操作系统的版本标识,
这一操作不会影响任何系统问题,可以在安装结束后恢复为正常状态;操作如下:
备份/etc/redhat-release文件为/etc/redhat-release.bak
cp /etc/redhat-release /etc/redhat-release.bak
以root权限修改/etc/redhat-release文件
将文件的内容
修改为redhat-4,用于满足/home/database/install/oraparam.ini的检查要求
也可以修改/home/database/install/oraparam.in的检查条件与系统的/etc/redhat-release文件内容保持一致
或者安装的时候,带上参数,即【runInstaller –ignoreSysPrereqs】则可跳过系统版本检查。
 
做完上述配置后,建议重新启动系统,目的是让所有配置生效
-------------------------------------------------------------------------------------------------------------
final:准备安装oracle
(1)从oracle官网上下载Oracle10g for linux版本。将其上传到服务器,并解压。修改其所有者和执行权限。
(2)在解压后的目录database中,执行runInstaller命令即可进行安装。
以oracle用户登录,如果是远程登录则需修改DISPLAY参数为你本机的IP。
运行./runInstaller -ignoreSysPrereqs 进行安装。
$ ./runInstaller -ignoreSysPrereqs
这里需要ignoreSysPrereqs选项,因为如果执行系统版本检查,CentOS是不被支持的,安装会自动停止。
由于使用了ignoreSysPrereqs选项安装过程中的一些检查将不通过或不执行。可以不用理睬(因为该安装的软件包均已安装,内核参数均已修改)。
安装过程采用默认安装即可,最后会提示用户以root身份执行两个脚本


passwd 用户名
问题原因:oracle字符集的問題,它就沒這種字符,所以显示乱码
解决方法:解决方法有两种,一种是安装字符集,第二种简单的就是使用英文安装,怎么才能使用英文安装呢?执行如下命令之后在安装软件即可解决:
oracle$export LANG=en_US
oracle$export LC_ALL=en_US
oracle$export LANGUAGE=en_US


在CenotOS 5.3中文环境下安装Oracle 10g R2时,进入图形化界面后,发现中文乱码。
在网上搜索后,发现是由于Linux上没有安装Oracle安装时使用的字体库造成的。
从以下网站下载字体库
http://download.csdn.net/source/1073202
然后在Linux下执行以下命令,把字体库安装到相应位置即可
mkdir -p /usr/share/fonts/zh_CN/TrueType
cp zysong.ttf /usr/share/fonts/zh_CN/TrueType/
这样在安装的时候。Oracle就会提示中文了,而不再是中文乱码了。 ......


以下配置脚本需要以root身份执行
/oracle/oralnventory/orainstRoot.sh
/oracle/oracleproduct/10.2.0/db_1/root.sh


iSQL*Plus URL:
http://localhost.oracle:5560/isqlplus

iSQL*Plus DBA URL:
http://localhost.oracle:5560/isqlplus/dba

Database Control URL:
http://localhost.oracle:1158/em



netca and /etc/hosts

with 3 comments

When I first re-installed my laptop with Fedora 8, I naturally set about installing Oracle 10g. However at the end of the dbca process, the launching of netca failed. Trying to run netca manually yielded this fun error:

[oracle ~]$ netca

Oracle Net Services Configuration:
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  SIGSEGV (0xb) at pc=0x004f0ab3, pid=19917, tid=3086797008
#
# Java VM: Java HotSpot(TM) Client VM (1.4.2_14-b05 mixed mode)
# Problematic frame:
# C  [libc.so.6+0x6fab3]  index+0x63
#
# An error report file with more information is saved as hs_err_pid19917.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#
/u01/app/oracle/product/10.2.0/db_1/bin/netca: line 190: 19917 Aborted
$JRE -mx64m $SRVM_PROPERTY_DEFS -Dsun.java2d.font.DisableAlgorithmicStyles=true -classpath $CLASSPATH oracle.net.ca.NetCA $*
Well that was no good. I saw some threads with similar subject matter on the OTN forums and followed up. However time passed and then for seemingly no reason at all the next week, netca was working fine. Then a kind gentleman replied asking what my hostname was set to. BAM!

That’s when it dawned on me that the hostname that I had set for this laptop was not in any DNS service available at the time. It was set up in my office in Green Bay, but I wasn’t connected to that in Schaumburg. From home last night I disconnected from the VPN and removed my localhost entry for my hostname. Bingo, netca fails. Re-add the localhost entry, netca works.

I had originally added my hostname to the localhost line in /etc/hosts because gnome-terminal would take forever and day launching without DNS resolution of the hostname, waiting for the lookup to timeout. Apparently this same kind of thing is going on just to launch netca, although it just crashes.

Here is the entry in my /etc/hosts, for example:

127.0.0.1               localhost.localdomain   localhost       foo.example.com foo


bin/lsnrctl start
sqlplus /nolog
>sql conn system/asdfjkl as sysdba
>sql start