IT猫扑网:您身边最放心的安全下载站! 最新更新| 软件分类| 专题汇总| 手机版

您当前所在位置:IT猫扑网 > 数据库 > Oracle > Debian Sarge 上安装 Oracle 10g

Debian Sarge 上安装 Oracle 10g

时间:2015-06-28 00:00 来源:IT猫扑网|http://www.itmop.com/ 作者:网管联盟 我要评论(0)

介绍一下我在Debian Sarge上安装oracle 10g的过程。

首先说一下我的爱机配置情况:

AMD Duron 1.1G
RAM 512MB(Hy sdram 256*2)
Maxtor Diomand Plus 80G+40G

通过Oracle 官方认证的系统,只有redhat-2.1,redhat-3,UnitedLinux-1.0,并不包括对debian支持,所以在debian上安装Oracle会多出一些额外的步骤。

一、安装前的准备

1.硬件要求

Oracle建议内存为512MB或以上,至少1G交换分区,并且需要400MB的临时目录空间。
使用以下的命令查看你的内存和交换分区大小:

# grep MemTotal /proc/meminfo
# grep SwapTotal /proc/meminfo

你可以使用以下方法添加临时交换分区:

su - root
dd if=/dev/zero of=tmpswap bs=1k count=900000
chmod 600 tmpswap
mkswap tmpswap
swapon tmpswap

可以通过以下命令查看临时空间大小:

#df /tmp

可以自己新建临时目录,安装完后再删除

#su - root
#mkdir /opt/tmp
#chown root.root /opt/tmp/
# chmod 1777 /opt/tmp
# echo TEMP
# export TEMP=/opt/tmp
# export TEMPDIR=/opt/tmp

对硬盘空间大小的限制,建议预留3G空间,我按照标准安装,硬盘消耗接近1.9G。

2.系统参数调整

修改/etc/sysctl.conf,添加

kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000

执行
#/sbin/sysctl -p

设置shell限制,在/etc/security/limits.conf添加
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

修改login设置,修改 /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

3、安装设置

确保你已经安装了下列软件

make
binutils
libc6-dev
libmotif3
rpm
awk

确保你的系统中有以下组和用户,方法:

#grep dba /etc/group
#grep oinstall /etc/group
#grep nobody /etc/group

#id oracle
#id nobody

切换到root,添加oralce帐户

#su - root
#groupadd dba # group of users to be granted SYSDBA system privilege
#groupadd oinstall # group owner of Oracle files
#useradd -c &Oracle software owner& -g oinstall -G dba -d /opt/oracle oracle
#passwd oracle
输入oracle密码

debian中需要额外的添加nobody用户组:
#groupadd nobody
系统nogroup组中已经有nobody用户,把nobody用户添加到新建的nobody组中,
#usermod -G nobody nobody

建立oracle目录
#su root
#mkdir /opt/oracle
#chown -R oralce.oinstall /opt/oracle

debian需要额外的做以下操作:
# ln -s /usr/bin/awk /bin/awk
# ln -s /usr/bin/rpm /bin/rpm
# ln -s /usr/bin/basename /bin/basename
# ln -s /etc /etc/rc.d

模拟redhat-3进行安装,新建一个文件/etc/redhat-release,写入以下内容:
Red Hat Enterprise Linux AS release 3 (Taroon)

二、开始安装

你可以从http://mirrors.cn99.com上下载oracle 10g,按以下方法进行解压:

$ gunzip ship.db.cpio.gz
$ cpio -idmv < ship.db.cpio

这样会生成一个Disk1目录,进入Disk1目录。
切换到oracle用户,设置环境变量:

$ xhost +
$ su - oralce
$ export ORACLE_BASE=/opt/oracle
$ export ORACLE_SID=oralin#你可以自己命名sid

确保此时环境中没有ORACLE_HOME 和TNS_ADMIN
$ unset ORACLE_HOME
$ unset TNS_ADMIN

可以将这些写进.bash_profile
export ORACLE_BASE=/opt/oracle
export ORACLE_SID=oralin
unset ORACLE_HOME
unset TNS_ADMIN

umask 022

执行
$ ./runInstaller
我选择标准安装,安装大约30多分钟。安装过程截图,参见 http://www.gbunix.com/bbs/ftopic1226.html

三、安装后

1.Oracle 管理工具
Ultra Search URL:
http://debian:5620/ultrasearch

Ultra Search 管理工具 URL:
http://debian:5620/ultrasearch/admin

iSQL*Plus URL:
http://debian:5560/isqlplus

Enteprise Manager 10g Database Control URL:
http://debian:5500/em

2.oracle启动脚本/etc/init.d/oracle

#!/bin/bash
#
# Run-level Startup script for the Oracle Instance and Listener
#
# chkconfig: 345 91 19
# description: Startup/Shutdown Oracle listener and instance

ORA_HOME=&/opt/oracle/product/10.1.0/db_1&
ORA_OWNR=&oracle&

# if the executables do not exist -- display error

if [ ! -f $ORA_HOME/bin/dbstart -o ! -d $ORA_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 &$ORA_HOME/bin/lsnrctl start&
su - $ORA_OWNR -c $ORA_HOME/bin/dbstart

#Optional : for isqlplus only
su - $ORA_OWNR -c &$ORA_HOME/bin/isqlplusctl start&
#Optional : for Enterprise Manager software only
su - $ORA_OWNR -c &$ORA_HOME/bin/emctl start dbconsole&


touch /var/lock/oracle
echo &OK&
;;
stop)
# Oracle listener and instance shutdown
echo -n &Shutdown Oracle: &

#Optional : for isqlplus only
su - $ORA_OWNR -c &$ORA_HOME/bin/isqlplusctl stop&
#Optional : for Enterprise Manager software only
su - $ORA_OWNR -c &$ORA_HOME/bin/emctl stop dbconsole&


su - $ORA_OWNR -c &$ORA_HOME/bin/lsnrctl stop&
su - $ORA_OWNR -c $ORA_HOME/bin/dbshut
rm -f /var/lock/oracle
echo &OK&
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo &Usage: $0 start|stop|restart|reload&
exit 1
esac
exit 0

可以通过/etc/init.d/oracle start来启动oracle.

关键词标签:安装,Oracle,oracle,s

相关阅读 误删Oracle数据库实例的控制文件 为UNIX服务器设置Oracle全文检索 Oracle数据库如何查找删除重复的SQL语句 Oracle导入导出数据库的语法 oracle数据库安装预环境一键处理脚本 oracle常用DBA命令

文章评论
发表评论

热门文章 误删Oracle数据库实例的控制文件 误删Oracle数据库实例的控制文件 利用Oracle分区表来减少磁盘I/O冲突 利用Oracle分区表来减少磁盘I/O冲突 Oracle数据库优化之数据库磁盘I/O Oracle数据库优化之数据库磁盘I/O 讲解Oracle复制技术的分布式系统同步应用 讲解Oracle复制技术的分布式系统同步应用 刷新Oracle缓存 刷新Oracle缓存 oracle 8080与TOMCAT默认端口冲突 oracle 8080与TOMCAT默认端口冲突

相关下载

人气排行 oracle中使用SQL语句修改字段类型-oracle修改SQL语句案例 Oracle中使用alter table来增加,删除,修改列的语法 ORACLE SQL 判断字符串是否为数字的语句 ORACLE和SQL语法区别归纳(1) oracle grant 授权语句 ORACLE修改IP地址后如何能够使用 如何加速Oracle大批量数据处理 Oracle删除表的几种方法 Oracle 10g创建表空间和用户并指定权限 Oracle连接数太多报错-ORA-12516错误 Oracle字符串截取 连接Oracle数据库的Hibernate配置文件