免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3281 | 回复: 1
打印 上一主题 下一主题

Debian lenny/etch 安装Oracle 9i (简要)指南 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-04-01 16:49 |只看该作者 |倒序浏览
Debian lenny/etch 安装Oracle 9i (简要)指南

       2009-04-01
       by kenny.luo (at) ebalu (dot) net

本(简要)指南基于X86系列,以debian 5.0为模板。 虚拟环境(ESXi 3.5)


前言:

由于项目需要,不得不在安装Oracle 9i 而不是10g .

内容:

1.基本条件.
安装debian 5.0 base-system, 然后安装gnome-desktop-environment. (KDE 也测试通过)

2.准备工作
  1)调整系统内核参数.
   根据ORACLE 官网的教程进行调整:
   <http://www.oracle.com/technology/pub/articles/smiley_10gdb_install.html>;

#############################################
cat >> /etc/sysctl.conf <<EOF
        kernel.shmall = 2097152
        kernel.shmmax = 536870912
        kernel.shmmni = 4096
        kernel.sem = 250 32000 100 128
        fs.file-max = 65536 #debian 5.0 在ESXi下默认101858 当然是大点好阿
        net.ipv4.ip_local_port_range = 1024 65000
        net.core.rmem_default=262144
        net.core.wmem_default=262144
        net.core.rmem_max=262144
        net.core.wmem_max=262144
        EOF

        /sbin/sysctl -p #让其立即生效
##############################################

   2)添加用户和组
##############################################
        /usr/sbin/groupadd oinstall
        /usr/sbin/groupadd dba
        /usr/sbin/useradd -m -g oinstall -G dba oracle

    passwd oracle  ##为用户oracle 设置密码
    然后修改/etc/passwd 中oracle 使用bash  默认的使用sh.

##############################################

        3)设置环境变量
    添加以下内容到oracle的.bashrc中
##############################################
        export LC_ALL=en_US.UTF-8
        export ORACLE_BASE=/u01/app/oracle
        export ORACLE_HOME=$ORACLE_BASE/OEM #我们设置放置的位置。
        export ORACLE_TERM=xterm #此处可修改为gnome-terminal 或其他你喜好的终端
        export ORACLE_SID=test  #修改此处为你要设置的SID
        export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
        export PATH=$PATHORACLE_HOME/bin
        export CLASSPATH=$ORACLE_HOME/JREORACLE_HOME/jlibORACLE_HOME/rdbms/jlibORACLE_HOME/network/jlib
        #export LD_PRELOAD=/usr/lib/libcwait.so
##############################################
   4)下载Oracle 9i for linux 的安装盘.
      保存于文件夹属性为oracleinstall 的文件夹下。
      例如: /home/oracle/
3. 解决安装过程中可能出现的问题.
        1) 安装编译环境. gcc make 等
        Oracle 9i 基于 gcc 2.95 需要
    安装gcc-2.95 和 g++-2.95
        把默认的gcc 的链接修改为 到gcc-2.95的链接
        添加etch 的源,update.   
##############################################
        aptitude install gcc-2.95 g++-2.95
        ln -s /usr/bin/gcc-2.95 /usr/bin/gcc
##############################################
                 
        2) 链接文件找不到的错误
        然后创建 /usr/lib/libstdc++-libc6.1-1.so.2 -> libstdc++-libc6.2-2.so.3 的链接
        否则出现1.error while loading shared libraries:
        libstdc++-libc6.1-1.so.2: cannot open shared object file: No such file or directory
##############################################
        ln -s /usr/lib/libstdc++-libc6.2-2.so.3  /usr/lib/libstdc++-libc6.1-1.so.2
##############################################
        3)libdb1-compat 这个是必须的否则会在安装过程中出错
##############################################
        aptitude install libdb1-compat
##############################################
        4)在vmware中安装的时候注意:把hostname 加到 /etc/hosts 中,不要用dhcp,否则出现个
                Parameter "nodeinfo" = NO_VALUE 错误 (vmware server 1.x)
        5)Unable to load native library: /tmp/OraInstallxxxx/jre/lib/i386/libjava.so: symbol __libc_wait, version GLIBC_2.0 not defined in                         file libc.so.6 with link time reference
##############################################
        取消/home/oracle/.bashrc中
        #export LD_PRELOAD=/usr/lib/libcwait.so
    处的"#"号
    把附件中的libcwait.so.zip 解压然后 把libcwait.so文件拷贝到"/usr/lib/"中
##############################################

4 安装
   以用户oracle 的身份登录桌面.
   进入放置Oracle 9i 的安装盘进行安装。
   安装路径放在我们预先设置好的/u01/app/oracle/OEM 处即$ORACLE_HOME
5 创建数据库

  我们用dbca 来创建数据库。
  首先解决建库过程中出现的错误。

        1. rm $ORACLE_HOME/JRE (此JRE目录是1.1.8 的符号链接)
        2. ln -s $ORACLE_BASE/jre/1.3.1 $ORACLE_HOME/JRE
        3. cd $ORACLE_BASE/jre/1.3.1/bin
        4. ln -s java jre
        5. cd i386/native_threads/
        6.ln -s java jre
  
  期间会需要给root权限给 root.sh 当你留空升级组的时候.
  设置你的数据库名称,SID 我们设置为test.(合前面的SID相吻合)
  忽略ORA-29807 ORA-01430 错误。
  解决方法见:http://blog.csdn.net/grant85612/archive/2008/03/14/2182882.aspx

  
        访问数据库:
        开个终端, sqlplus "sys/system as sysdba" 现在你已经能访问你的数据库了。
    根据$ORACLE_HOME/network/admin/sample 中的范例设置你的监听端口等等。

        Web 方式:
    启用web方式 $ORACLE_HOME/Apache/Apcache/bin/./apachectl start
        $ORACLE_HOME/Apache/Apache/bin/http
        http://hpserv01:7777/isqlplus
        http://hpserv01:7777/isqlplusdba
        首先需要初始化用户密码:
        $ cd $ORACLE_HOME/sqlplus/admin
        $ORACLE_HOME/Apache/Apache/bin/htpasswd iplusdba.pw oracle

6.这次关于RAW 方面的没有测试, 已经在ESXi 3.5 上做了软的 Raw .
先在把上次的 Etch 中添加raw 的一些东西贴出来,(未加整理)

创建裸设备
首先确保有raw加载
lsmod |grep raw
如果无者加入: modprobe raw
然后
=============================================================================
建立文件/etc/rawconfig,内容如下
# This file and interface are deprecated.
# Applications needing raw device access should open regular
# block devices with O_DIRECT.
# raw device bindings
# format:  <rawdev> <major> <minor>
#          <rawdev> <blockdev>
# example: /dev/raw/raw1 /dev/sda1
#          /dev/raw/raw2 8 5
#/dev/raw/raw1 /dev/sdb1  #去掉"#" 修改成的需要的设备
/dev/.static/dev/raw/raw1 /dev/sdb1
#/dev/raw/raw2 /dev/sdb2
#/dev/raw/raw3 /dev/sdb3
#/dev/raw/raw4 /dev/sdb4
=============================================================================
建立文件/etc/init.d/rawdevices,内容如下:
#!/bin/bash
#
# rawdevices       This shell script assignes rawdevices to block devices
#
# chkconfig: 345 56 44
# description: This scripts assignes raw devices to block devices \
#              (such as hard drive partitions). This is for the use \
#              of applications such as Oracle. You can set up the \
#              raw device to block device mapping by editing \
#              the file /etc/sysconfig/rawdevices. Note that the use \
#              of raw devices is deprecated, and applications should \
#              open regular block devices with O_DIRECT instead.
#
# config: /etc/sysconfig/rawdevices

[ -f /sbin/raw ] || exit 0
[ -f /etc/rawconfig ] || exit 0
# Exit if the file just has the default comments.
LC_ALL=C /bin/egrep -q -v "^ *#" /etc/rawconfig 2>/dev/null || exit 0



function assign_raw()
{
   LC_ALL=C egrep -v '^ *#' /etc/rawconfig |
   while read RAW BLOCK; do
     if [ -n "$RAW" -a -n "$BLOCK" ]; then
         rawdirname=${RAW%/*}
         if [ "$rawdirname" = "/dev" -a -d /dev/raw ]; then
           echo $"  Please correct your /etc/rawconfig:"
           echo $"     rawdevices are now located in the directory /dev/raw/ "
           echo $"  If the command 'raw' still refers to /dev/raw as a file."
           echo $"   you'll have to upgrade your util-linux package"
           exit 0
         fi
         if [ "$rawdirname" = "/dev/raw" -a -f /dev/raw ]; then
           echo $"  Please correct your /etc/rawconfig:"
           echo $"     rawdevices are now located in the directory /dev/raw/ "
           echo $"  If the command 'raw' still refers to /dev/raw as a file."
           echo $"   you'll have to upgrade your util-linux package"
           exit 0
         fi

       echo "           $RAW  -->   $BLOCK";
       raw $RAW $BLOCK
     fi
   done
}

# See how we were called.
case "$1" in
  start)
        # Assign devices
        echo $"Assigning devices: "
        assign_raw
        echo $"done"
        ;;
  stop)
        # No action to be taken here
        ;;

  status)
        ID=`id -u`
        if [ $ID -eq 0 ]; then
          raw -qa
        else
          echo $"You need to be root to use this command ! "
        fi
        ;;

  restart|reload)
        $0 start
        ;;

  *)
        echo $"Usage: $0 {start|stop|status|restart}"
        exit 1
esac

exit 0
================================================================================
出现以下错误的解决方法
Cannot open raw device '/dev/rawctl' (No such file or directory)
mknod /dev/rawctl c 162 0
cd /dev
.MAKEDEV raw
位置在这里/dev/.static/dev/raw/raw1 别弄错了
开机自动加载raw模块
编辑/etc/modules
添加raw

结语:
    掌握是一个过程。

libcwait.so.zip

7.26 KB, 下载次数: 52

论坛徽章:
0
2 [报告]
发表于 2009-04-01 18:18 |只看该作者
补充:
出现该错误:
/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory

安装 libxp6 即可解决~
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP