分享

Rhel5.4_64 上安装oracle 10g_64(经过实测)--Linux爱好者-搜狐博客

 tcwl123 2010-12-06

特别说明:oracle 10g_64必须安装在64位的rhel上面,否则的话,对不起了操作系统重装

查询linux版本:

#uname –i

x84_64

则说明操作系统是64位的

否则可能出现一下错误:

Exception String: Error in invoking target install of makefile /orasys/oracle/product/9.2.0/plsql/lib/ins_plsql.mk

1.保证网络没有问题,特别是网卡设置.

设置网卡上的主机名

修改/etc/hosts文件,把127.0.0.1修改为网卡设置的(直实)ip地址,其后把多余的主机名去掉,只保留一个真实的主机名.

2.按照下面的方法将下列所以rpm都检查一遍,看是否安装

rpm –qa | grep libaio*

下列为rpm包:

libaio-0.3.103-3.i386.rpm

compat-db-4.1.25-9.x86_64.rpm

control-center-2.8.0-12.x86_64.rpm

gcc-3.4.3-22.1.x86_64.rpm

gcc-c++-3.4.3-22.1.x86_64.rpm

glibc-2.3.4-2.x86_64.rpm

glibc-common-2.3.4-2.x86_64.rpm

libstdc++-3.4.3-22.1.x86_64.rpm

libstdc++-devel-3.4.3-22.1.x86_64.rpm

make-3.80-5.x86_64.rpm

pdksh-5.2.14-30.x86_64.rpm

sysstat-5.0.5-1.x86_64.rpm

compat-libstdc++-33-3.2.3-47.3.x86_64.rpm

glibc-kernheaders-2.4-9.1.87.x86_64.rpm

glibc-headers-2.3.4-2.9.x86_64.rpm

libaio-0.3.103-3.x86_64.rpm

glibc-devel-2.3.4-2.9.x86_64.rpm

glibc-devel-2.3.4-2.9.i386.rpm

libXp-1.0.0-8.1.el5.i386.rpm

实际环境中,只要下列需要安装,rpm包在安装盘的server目录下

rpm -Uvh '/media/RHEL_5.4 x86_64 DVD/Server/pdksh-5.2.14-36.el5.x86_64.rpm'
rpm -Uvh '/media/RHEL_5.4 x86_64 DVD/Server/sysstat-7.0.2-3.el5.x86_64.rpm'
rpm -Uvh '/media/RHEL_5.4 x86_64 DVD/Server/glibc-headers-2.5-42.x86_64.rpm'
rpm -Uvh '/media/RHEL_5.4 x86_64 DVD/Server/kernel-headers-2.6.18-164.el5.x86_64.rpm'

rpm -Uvh '/media/RHEL_5.4 x86_64 DVD/Server/libXp-1.0.0-8.1.el5.i386.rpm'

以上工作没做好,可能在安装过程中出现一下错误:

(1)、Exception String:Error in invoking target’agent’of makefile

‘/home/oracle/oracle/product/10.2.0/db_1/sysman/lib/ins_sysman.mk,

See‘/home/oracle/oraInventory/logs/installActions2009-07-20_02-54-28PM.log’for details

(2)、makefile '/oracle/product/10.2.0/db_1/rdbms/lib/ins_rdbms.mk' 的目标 'all_no_orcl' 时出错。请参阅 '/oracle/oraInventory/logs/installActions2005-12-29_10-44-31AM.log',等等

   

3.以下修改内核参数等文件,已保证Oracle的预安装准备成功。执行如下:

vi /etc/sysctl.conf     行末添加以下内容

# 20091208 add content for oracle install

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

执行下述命令。导入刚才写入的参数。不执行,oracle在后面安装前的检测会报警。

sysctl -p

vi /etc/security/limits.conf 行末添加以下内容

# 20071212 add content for oracle install

soft nproc 2047

hard nproc 16384

soft nofile 1024

hard nofile 65536

vi /etc/pam.d/login 行末添加以下内容

# 20071212 add content for oracle install

session required pam_limits.so

vi /etc/selinux/config 确保以下内容

SELINUX=disabled

此处再确认一下吧。

4.创建oracle用户,和一些安装目录

groupadd dba

groupadd oinstall

useradd -g oinstall -G dba -m oracle

passwd oracle

mkdir -p /opt/oracle

chown -R oracle.oinstall /opt/oracle

将oracle的安装文件置于家目录,进行加压。

zcat 10201_database_linux_x86_64.cpio.gz | cpio -idmv

5.添加环境变量,定义SID等

su - oracle

vi .bash_profile

#--------------------------------------

# Set for Oracle10g Install;

#--------------------------------------

trap " " 0 1 2 3 5 9 15

trap clear 0

export TMP=/tmp

export TMPDIR=$TMP

export ORACLE_BASE=/opt/oracle

export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1

export ORACLE_SID=dsc

export ORACLE_TERM=xterm

export PATH=/usr/sbin:$PATH

export PATH=$ORACLE_HOME/bin:$PATH

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

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib64:/usr/lib64:/usr/local/lib64:/usr/X11R6/lib64/

export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

export LD_ASSUME_KERNEL=2.6.18

export NLS_LANG="AMERICAN_CHINA.ZHS16GBK"

LC_CTYPE=zh_CN.UTF8

LC_ALL=zh_CN.UTF8

LANG=zh_CN.UTF8

umask 022

#

执行环境设置

source ~/.bash_profile

6.因为oracle 的官方只支持到RHEL4为止,所以要修改版本说明,编辑文件 /etc/redhat-release 把Red Hat Enterprise Linux Server release 5 (Tikanga) 改成版本:

Red Hat Enterprise Linux AS release 4 (Nahant Update)

当然oracle安装完成后,要修改回来.

7.安装oracle

终端输入:xhost local:oracle non-network local connections being added to access control list

#export DISPLAY=:0.0

#xhost +

su - oracle

export LANG=en_US

./database/runInstaller

安装到最后时,一定要注意运行安装系统提示的那两个脚本。

8.启动oracle

安装后的调整dbstart

在运行$ORACLE_HOME/bin/dbstart时报错,

Failed to auto-start Oracle Net Listene using /ade/vikrkuma_new/oracle/bin/tnslsnr

解决方法:修改dbstart这个文件,找到ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle

su - oracle

vi `which dbstart`

ORACLE_HOME_LISTNER=$ORACLE_HOME

修改/etc/oratab文件

dsc:/datas/apps/oracle/product/10.2.0/db_1:Y

创建自启动脚本。

oracle 10g在自身的dbstart已经启动了lsnrctl,所以下面的脚本上注释掉了lsnrctl的启动

touch dbora

chmod 700 dbora

vi dbora

dbora内容如下

#!/bin/bash

#

# chkconfig: 2345 80 05

# description: Oracle 10g Server

# /etc/init.d/dbora

#

# Run-level Startup script for the Oracle Instance, Listener, and

# Web Interface

export ORACLE_BASE=/opt/oracle

export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1

export ORACLE_SID=dsc

export PATH=$PATH:$ORACLE_HOME/bin

ORA_OWNR="oracle"

# if the executables do not exist -- display error

if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]

then

     echo "Oracle startup: cannot start"

     exit 1

fi

# depending on parameter -- startup, shutdown, restart

# of the instance and listener or usage display

case "$1" in

start)

     # Oracle listener and instance startup

     echo -n "Starting Oracle: "

#       su $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl start"

     su $ORA_OWNR -c $ORACLE_HOME/bin/dbstart

     touch /var/lock/oracle

     su $ORA_OWNR -c "$ORACLE_HOME/bin/emctl start dbconsole"

     su $ORA_OWNR -c "$ORACLE_HOME/bin/isqlplusctl start"

     echo "OK"

     ;;

stop)

     # Oracle listener and instance shutdown

     echo -n "Shutdown Oracle: "

#        su $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop"

     su $ORA_OWNR -c $ORACLE_HOME/bin/dbshut

     rm -f /var/lock/oracle

     su $ORA_OWNR -c "$ORACLE_HOME/bin/emctl stop dbconsole"

     su $ORA_OWNR -c "$ORACLE_HOME/bin/isqlplusctl stop"

     echo "OK"

     ;;

reload|restart)

     $0 stop

     $0 start

     ;;

*)

     echo "Usage: `basename $0` start|stop|restart|reload"

     exit 1

esac

exit 0

加载到自动启动目录

cp dbora /etc/rc.d/init.d

chkconfig --add dbora

chkconfig --list | grep dbora


[root@localhost init.d]# /sbin/chkconfig --add dbora
[root@localhost init.d]# /sbin/chkconfig --list |grep dbora

dbora           0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭

一些服务介绍和补充

a:$ORACLE_HOME/bin/dbstart | dbshut

b:$ORACLE_HOME/bin/lsnrctl start | stop 监听器启动|关闭。

c:$ORACLE_HOME/bin/emctl start | stop dbconsole

访问 http://yourIP:1158/em

d:$ORACLE_HOME/bin/isqlplusctl start | stop

访问 http://yourIP:5560/isqlplus

安装完成之后,再执行两个脚本就可以了:

使用root用户来执行该脚本,分别执行/u01/app/oracle/oraInventory/orainstRoot.sh和/u01/app/oracle/product/10.2.0/db_1/root.sh

退出安装界面

切换到oracle用户进入SQL操作界面:

Sqlplus / as sysdba    (sqlplus / nolog)

SQL>

 

查看是否可以进入web界面管理oracle10g数据库

执行命令:emctl status dbconsole

启动web界面:emctl start dbconsole

停止web界面:emctl stop dbconsole

(默认安装完oracle之后就已经启动oracle 10g 的web的管理界面)

默认OEM地址http://yourIP:1158/em

默认isqlplus地址:http://yourIP:5560/isqlplus

SQL> connect sys/mzl as sysdba
已连接。
SQL> startup
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file ’/opt/oracle/app/oracle/product/10.1.0/Db_1/dbs/initoracle.ora’

这是因为在oracle9i和oracle10g中,

数据库默认将使用spfile启动数据库,如果spfile不存在,则就会出现上述错误。
解决方法:
将$ORACLE_BASE/admin /数据库名称/pfile目录下的init.ora.012009233838形式的文件copy到$ORACLE_HOME/dbs目录下 initoracle.ora即可。(注:initoracle.ora中的oracle为你的实例名 ORACLE_SID)
SQL> startup
ORACLE instance started.

Total System Global Area? 167772160 bytes
Fixed Size?????????????????? 778212 bytes
Variable Size????????????? 57679900 bytes
Database Buffers????????? 109051904 bytes
Redo Buffers???????????????? 262144 bytes  

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多