LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 3103|回复: 1

Debian Sarge上安装Oracle 10g

[复制链接]
发表于 2004-10-21 21:58:28 | 显示全部楼层 |阅读模式
首先说一下我的爱机配置情况:
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.linuxsir.cn/forum.php?mod=viewthread&tid=140617

三、安装后

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

  1. #!/bin/bash
  2. #
  3. # Run-level Startup script for the Oracle Instance and Listener
  4. #
  5. # chkconfig: 345 91 19
  6. # description: Startup/Shutdown Oracle listener and instance

  7. ORA_HOME="/opt/oracle/product/10.1.0/db_1"
  8. ORA_OWNR="oracle"

  9. # if the executables do not exist -- display error

  10. if [ ! -f $ORA_HOME/bin/dbstart -o ! -d $ORA_HOME ]
  11. then
  12.         echo "Oracle startup: cannot start"
  13.         exit 1
  14. fi

  15. # depending on parameter -- startup, shutdown, restart
  16. # of the instance and listener or usage display

  17. case "$1" in
  18.     start)
  19.         # Oracle listener and instance startup
  20.         echo -n "Starting Oracle: "
  21.         su - $ORA_OWNR -c "$ORA_HOME/bin/lsnrctl start"
  22.         su - $ORA_OWNR -c $ORA_HOME/bin/dbstart

  23.         #Optional : for isqlplus only
  24.         su - $ORA_OWNR -c "$ORA_HOME/bin/isqlplusctl start"
  25.         #Optional : for Enterprise Manager software only
  26.         su - $ORA_OWNR -c "$ORA_HOME/bin/emctl start dbconsole"


  27.         touch /var/lock/oracle
  28.         echo "OK"
  29.         ;;
  30.     stop)
  31.         # Oracle listener and instance shutdown
  32.         echo -n "Shutdown Oracle: "

  33.         #Optional : for isqlplus only
  34.         su - $ORA_OWNR -c "$ORA_HOME/bin/isqlplusctl stop"
  35.         #Optional : for Enterprise Manager software only
  36.         su - $ORA_OWNR -c "$ORA_HOME/bin/emctl stop dbconsole"


  37.         su - $ORA_OWNR -c "$ORA_HOME/bin/lsnrctl stop"
  38.         su - $ORA_OWNR -c $ORA_HOME/bin/dbshut
  39.         rm -f /var/lock/oracle
  40.         echo "OK"
  41.         ;;
  42.     reload|restart)
  43.         $0 stop
  44.         $0 start
  45.         ;;
  46.     *)
  47.         echo "Usage: $0 start|stop|restart|reload"
  48.         exit 1
  49. esac
  50. exit 0
复制代码

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

参考资料:
GNU/Linux Desktop Survival Guide,学习debian的最佳资料,其中有Oracle 10g安装章节
http://www.togaware.com/linux/survivor/survivor.shtml
http://www.togaware.com/linux/survivor/Oracle_10g.shtml

在 Linux x86 上安装 Oracle 数据库 10g
http://www.oracle.com/technology ... _10gdb_install.html

Oracle Linux Forum
http://forums.oracle.com/forums/forum.jsp?forum=135
发表于 2006-2-27 12:35:56 | 显示全部楼层
为什么我每次安装都是装到
Linking Oracle Net Required Support Files 10.2.0.1.0
这一步的时候就停止了
日志信息如下:
          mv ntcontab.o /opt/ora10/product/10.1.0/lib/ ;\

INFO:           /usr/bin/ar rv /opt/ora10/product/10.1.0/lib/libn10.a /opt/ora10/product/10.1.0/lib/ntcontab.o ; fi)

INFO: /bin/sed:-e ??? #1,?? 7:unterminated `s' command

INFO: /bin/sed:-e ??? #1,?? 7:unterminated `s' command

INFO: /bin/sed:-e ??? #1,?? 7:unterminated `s' command
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表