1. 首页 > ITPUX技术网 > 正文

LINUX下安装Oracle10g

[font=gotham, helvetica, arial, sans-serif]Linux版本:RedHat Enterprise 5.4;Oracle10g版本:10.2.0.1.0
[font=&quot]一、安装前的准备工作
[font=&quot]1、安装软件
[font=&quot]Linux版本:RedHat Enterprise 5.4;Oracle10g版本:10.2.0.1.0
[font=&quot]2、验证您的安装
[font=&quot]如果完成了以上步骤,您应该具备 Oracle 10g 所需的所有程序包和更新。您可以执行以下步骤验证您的安装。
[font=&quot]所需内核版本:2.4.21-4.EL(这是 RHEL 3 的基本版本附带的内核版本。此内核或更新中提供的任何版本的内核均适用于 Oracle 10g)。
[font=&quot]通过运行以下命令检查内核版本:
[font=&quot]uname -r
[font=&quot]例如:
[font=&quot]# uname -r
[font=&quot]2.4.21-4.0.1.ELsmp (xxy实践结果:2.6.18-164.e15xen)
[font=&quot]其他所需程序包的版本(或更高版本):
[font=&quot]gcc-3.2.3-2
[font=&quot]make-3.79
[font=&quot]binutils-2.11
[font=&quot]openmotif-2.2.2-16
[font=&quot]setarch-1.3-1
[font=&quot]compat-gcc-7.3-2.96.122
[font=&quot]compat-gcc-c++-7.3-2.96.122
[font=&quot]compat-libstdc++-7.3-2.96.122
[font=&quot]compat-libstdc++-devel-7.3-2.96.122
[font=&quot]compat-db-4.0.14.5(Oracle 10g 数据库安装指南中将其列为是必需的,但此处并不需要)
[font=&quot]要查看系统上安装了这些程序包的哪些版本,以 root 用户身份运行以下命令:
[font=&quot]rpm -q gcc make binutils openmotif setarch compat-db compat-gcc compat-gcc-c++ compat-libstdc++ compat-libstdc++-devel
[font=&quot]例如:
[font=&quot]# rpm -q gcc make binutils openmotif setarch compat-db compat-gcc compat-gcc-c++ compat-libstdc++ compat-libstdc++-devel
[font=&quot]gcc-3.2.3-20
[font=&quot]make-3.79.1-17
[font=&quot]binutils-2.14.90.0.4-26
[font=&quot]openmotif-2.2.2-16
[font=&quot]setarch-1.3-1
[font=&quot]package compat-db is not installed
[font=&quot]compat-gcc-7.3-2.96.122
[font=&quot]compat-gcc-c++-7.3-2.96.122
[font=&quot]compat-libstdc++-7.3-2.96.122
[font=&quot]compat-libstdc++-devel-7.3-2.96.122
[font=&quot]实践结果:
[font=&quot]gcc-4.1.2-46.e15
[font=&quot]make-3.81-e.e15
[font=&quot]binutils-2.17.50.0.6-12.e15
[font=&quot]package openmotif is not installed
[font=&quot]setarch-2.0-1.1
[font=&quot]package compat-db is not installed
[font=&quot]package compat-gcc is not installed
[font=&quot]package compat-gcc-c++ is not installed
[font=&quot]package compat-libstdc++ is not installed
[font=&quot]package compat-libstdc++-devel is not installed
[font=&quot]请注意,尚未安装 compat-db 程序包。安装过程中可用的任何程序包组均不包含此程序包,因此必须在单独的步骤中安装。如果系统上缺少任何其他程序包版本,或版本比以上指定的版本旧(compat-db 除外),则可以从 Red Hat Network 下载并安装更新。
[font=&quot]进入RedHat安装光盘:cd /media/光盘驱动名/server
[font=&quot]命令:rpm –ivh 包名
[font=&quot]3、设置核心参数:
[font=&quot]在/etc/sysctl.conf文件中加入下列行:
[font=&quot]运行vi sysctl.conf 命令,打开文件
[font=&quot]运行 i命令,插入记录
[font=&quot]kernel.shmall = 2097152
[font=&quot]kernel.shmmax = 2147483648
[font=&quot]kernel.shmmni = 4096
[font=&quot]# semaphores: semmsl, semmns, semopm, semmni
[font=&quot]kernel.sem = 250 32000 100 128
[font=&quot]fs.file-max = 65536
[font=&quot]net.ipv4.ip_local_port_range = 1024 65000
[font=&quot]net.core.rmem_default=262144
[font=&quot]ne t.core.rmem_max=262144
[font=&quot]net.core.wmem_default=262144
[font=&quot]net.core.wmem_max=262144
[font=&quot]运行Esc命令,退出编辑状态
[font=&quot]运行:wq!或:wq命令,保存修改
[font=&quot]运行下列命令改变核心参数:/sbin/sysctl –p
[font=&quot]4、在/etc/security/limits.conf文件中加入下列行:
[font=&quot]注:命令与上面3一样
[font=&quot]* soft nproc 2047
[font=&quot]* hard nproc 16384
[font=&quot]* soft nofile 1024
[font=&quot]* hard nofile 65536
[font=&quot]5、在/etc/pam.d/login文件中加入下列行,如果里面没有的话:
[font=&quot]session required /lib/security/pam_limits.so
[font=&quot]6、创建用户和修改环境变量:
[font=&quot]# /usr/sbin/groupadd oinstall /创建组用户/
[font=&quot]# /usr/sbin/groupadd dba /创建组用户/
[font=&quot]# /usr/sbin/useradd -g oinstall -G dba oracle /创建用户,并设定用户组/
[font=&quot]# passwd oracle /设定oracle用户的密码/
[font=&quot]用oracle登陆进操作系统,编辑.bash_profile文件(.bash_profile文件为隐藏文件,其位置在/home/oracle/.bash_profile),由于linux默认的shell使用的是bash,故要编辑这个文件,如果你设定的使用csh,请编辑.login文件。
[font=&quot]在.bash_profile中添加如下内容:

[font=&quot]# Oracle Settings
[font=&quot]TMP=/tmp
[font=&quot]export TMP
[font=&quot]TMPDIR=$TMP
[font=&quot]export TMPDIR
[font=&quot]ORACLE_BASE=/oracle
[font=&quot]export ORACLE_BASE
[font=&quot]ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
[font=&quot]export ORACLE_HOME
[font=&quot]ORACLE_SID=siamp_linux_ordb
[font=&quot]export ORACLE_SID
[font=&quot]ORACLE_TERM=xterm
[font=&quot]export ORACLE_TERM
[font=&quot]PATH=/usr/sbin:$PATH
[font=&quot]export PATH
[font=&quot]PATH=$ORACLE_HOME/bin:$PATH
[font=&quot]export PATH
[font=&quot]LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
[font=&quot]export LD_LIBRARY_PATH
[font=&quot]CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;
[font=&quot]export CLASSPATH
[font=&quot]if [ $USER = “oracle” ]; then
[font=&quot]if [ $SHELL = “/bin/ksh” ]; then
[font=&quot]ulimit -p 16384
[font=&quot]ulimit -n 65536
[font=&quot]else
[font=&quot]ulimit -u 16384 -n 65536
[font=&quot]fi
[font=&quot]fi
[font=&quot]8、创建安装目录:
[font=&quot]最好在根上建立一个ORACLE文件夹,这个文件夹专门用来存放的安装文件。需要注意的是在安装ORACLE前,需要把这个文件夹的所有者修改成用户oracle,文件夹权限最好是修改成777,以免在安装过程中出现无权限的问题。操作如下:
[font=&quot]建立oracle安装目录
[font=&quot]――――――――――――――――――――――――――――――
[font=&quot]#mkdir -p /u01/app/oracle/product/10.2.0/db_1
[font=&quot]#chown -R oracle:install /u01/
[font=&quot]#chmod -R 775 /u01/app/oracle
[font=&quot]――――――――――――――――――――――
[font=&quot]chmod 777 /oracle
[font=&quot]chown -R oracle.oinstall /oracle
[font=&quot]9、修改redhat发行标识:
[font=&quot]由于oracle10g具有系统安装监测,当检测到的系统不符合安装配置规定的要求时,安装不能正常进行,故要更改操作系统的版本标识,这一操作不会影响任何系统问题,可以在安装结束后恢复为正常状态。操作如下:
[font=&quot]备份/etc/redhat-release文件为/etc/redhat-release.bak,以root权限打开/etc/redhat-release文件,将文件内容:Red Hat Enterprise Linux AS release 4 (Nahant) 修改为Red Hat Enterprise Linux AS release 3 (Taroon),用于满足oracle_database_10.2.0.1.0./install/oraparam.ini的检查要求。
[font=&quot]二、开始安装(做完上述配置后,建议重新启动系统,目的是让所有配置生效。)
[font=&quot]安装oracle,必须设置ip
[font=&quot]关闭启动网口
[font=&quot]ifdown eth0
[font=&quot]ifup eth0
[font=&quot]重启网卡
[font=&quot]service network start
[font=&quot]安装包
[font=&quot]rpm -ivh 包名

[font=&quot]切换用户
[font=&quot]su -user

[font=&quot]在root用户下
[font=&quot]xhost +

[font=&quot]su – oracle
[font=&quot]netca
[font=&quot]dbca
[font=&quot]图形界面显示乱码或不全的问题:设置为英文
[font=&quot]LANG=C
[font=&quot]export LANG

[font=&quot]以oracle用户登陆到系统,打开终端,进入到oracle_database_10.2.0.1.0目录,使用如下命令“./runInstaller”开始安装,截图如下:

[font=&quot]这里Home目录是刚才给oracle编辑profile时添加的

[font=&quot]在检查过程中如发现有一些软件包错误,则用rpm命令检查相关的软件包并安装,如果在虚拟机上安装RH4时选择完全安装,在这里检查则会全部通过。

[font=&quot]执行上图中的两个根本,其中root.sh为隐藏文件

[font=&quot]安装完成

[font=&quot]三、安装后配置
[font=&quot]编辑/etc/oratab文件设置每个实例的重启标志为“Y”:
[font=&quot]Demo1:/ oracle /app/oracle/product/10.2.0/db_1:Y
[font=&quot]四、安装检测
[font=&quot] 安装完成后,可以在oracle用户下,打开终端,运行dbca命令,后有一个向导出现,说明安装成功。

[font=&quot]最后按提示创建数据库即可
[font=&quot]错误信息:
[font=&quot]compat-libstdc++-33-3.2.3-47.3.i386.rpm

本文由风哥教程整理发布,仅用于学习测试使用,转载注明出处:http://www.fgedu.net.cn/10327.html

联系我们

在线咨询:点击这里给我发消息

微信号:itpux-com

工作日:9:30-18:30,节假日休息