免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: w3wu
打印 上一主题 下一主题

[VMware] VMware下安装EMC Autostart for Linux Oracle双机指导文档(原创的哦) [复制链接]

论坛徽章:
0
31 [报告]
发表于 2008-04-08 22:44 |只看该作者
[root@cls2 bin]# cat /ora/app/oracle/product/9.2/bin/dbstart
:
#
# $Header: dbstart.sh.pp 03-apr-2001.13:38:21 jboyce Exp $ dbstart.sh.pp Copyr (c) 1991 Oracle
#

###################################
#
# usage: dbstart
#
# This script is used to start ORACLE from /etc/rc(.local).
# It should ONLY be executed as part of the system boot procedure.
#
#####################################

ORATAB=/etc/oratab

trap 'exit' 1 2 3
case $ORACLE_TRACE in
    T) set -x ;;
esac
   
# Set path if path not set (if called from /etc/rc)
case $PATH in
    "" PATH=/bin:/usr/bin:/etc
        export PATH ;;
esac
# Save LD_LIBRARY_PATH
SAVE_LLP=$LD_LIBRARY_PATH

#
# Loop for every entry in oratab file and and try to start
# that ORACLE
#

cat $ORATAB | while read LINE
do
    case $LINE in
        \#*)                ;;        #comment-line in oratab
        *)
#       Proceed only if third field is 'Y'.
        if [ "`echo $LINE | awk -F: '{print $3}' -`" = "Y" ] ; then
            ORACLE_SID=`echo $LINE | awk -F: '{print $1}' -`
            if [ "$ORACLE_SID" = '*' ] ; then
                ORACLE_SID=""
            fi
#           Called programs use same database ID
            export ORACLE_SID
            ORACLE_HOME=`echo $LINE | awk -F: '{print $2}' -`
#           Called scripts use same home directory
            export ORACLE_HOME
#           Put $ORACLE_HOME/bin into PATH and export.
            PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/etc ; export PATH
#           add for bug # 652997
            LD_LIBRARY_PATH=${SAVE_LLP}{ORACLE_HOME}/lib ; export LD_LIBRARY_PATH
            PFILE=${ORACLE_HOME}/dbs/init${ORACLE_SID}.ora

#            See if it is a V6 or V7 database
            VERSION=undef
            if [ -f $ORACLE_HOME/bin/sqldba ] ; then
                SQLDBA=sqldba
                VERSION=`$ORACLE_HOME/bin/sqldba command=exit | awk '
                    /SQL\*DBA: (Release|Version)/ {split($3, V, "." ;
                    print V[1]}'`
                case $VERSION in
                    "6" ;;
                    *) VERSION="internal" ;;
                esac
            else
                if [ -f $ORACLE_HOME/bin/svrmgrl ] ; then
                    SQLDBA=svrmgrl
                    VERSION="internal"
                else
                    SQLDBA="sqlplus /nolog"
                fi
            fi

            STATUS=1
            if [ -f $ORACLE_HOME/dbs/sgadef${ORACLE_SID}.dbf ] ; then
                STATUS="-1"
            fi
            if [ -f $ORACLE_HOME/dbs/sgadef${ORACLE_SID}.ora ] ; then
                STATUS="-1"
            fi
            pmon=`ps -ef | egrep pmon_$ORACLE_SID  | grep -v grep`
            if [ "$pmon" != "" ];
            then
                STATUS="-1"
                echo "Database \"${ORACLE_SID}\" already started."
            fi

            if test $STATUS -eq -1 ; then
                echo ""
                echo "Database \"${ORACLE_SID}\" possibly left running when system went down (system crash?)."
                echo "Notify Database Administrator."
                case $VERSION in
                    "6"  sqldba "command=shutdown abort" ;;
                    "internal"  $SQLDBA $args <<EOF
connect internal
shutdown abort
EOF
                        ;;
                    *)  $SQLDBA $args <<EOF
connect /as sysdba
shutdown abort
EOF
                        ;;
                esac
                if test $? -eq 0 ; then
                    STATUS=1
                else
                    echo "Database \"${ORACLE_SID}\" NOT started."
                fi
            fi

            if test $STATUS -eq 1 ; then
                if [ -f $PFILE ] ; then
                    case $VERSION in
                        "6"  sqldba command=startup ;;
                        "internal"  $SQLDBA <<EOF
connect internal
startup force
EOF
                            ;;
                        *)  $SQLDBA <<EOF
connect / as sysdba
startup force
EOF
                            ;;
                    esac

                    if test $? -eq 0 ; then
                        echo ""
                        echo "Database \"${ORACLE_SID}\" warm started."
                    else
                        echo ""
                        echo "Database \"${ORACLE_SID}\" NOT started."
                    fi
                else
                    echo ""
                    echo "Can't find init file for Database \"${ORACLE_SID}\"."
                    echo "Database \"${ORACLE_SID}\" NOT started."
                fi
            fi
        fi
        ;;
    esac
done

论坛徽章:
2
2015年迎新春徽章
日期:2015-03-03 17:33:52数据库技术版块每日发帖之星
日期:2015-09-21 06:20:00
32 [报告]
发表于 2008-04-09 11:20 |只看该作者
启动脚本毛要弄的这么复杂!

#!/bin/bash

${ORACLE_HOME}/bin/sqlplus << EOF
  connect as sysdba
  startup;
  quit;
EOF

论坛徽章:
0
33 [报告]
发表于 2008-04-09 17:58 |只看该作者
原帖由 w3wu 于 2008-4-9 11:20 发表
启动脚本毛要弄的这么复杂!

启动脚本毛要弄的这么复杂!

#!/bin/bash

${ORACLE_HOME}/bin/sqlplus << EOF
  connect as sysdba
  startup;
  quit;
EOF  

这个以perl script 方式执行,sqplus /nolog登陆,实例没有启动啊

论坛徽章:
0
34 [报告]
发表于 2008-04-09 17:59 |只看该作者
LZ能否把你的启动script贴出来给我看一下?

论坛徽章:
2
2015年迎新春徽章
日期:2015-03-03 17:33:52数据库技术版块每日发帖之星
日期:2015-09-21 06:20:00
35 [报告]
发表于 2008-04-10 12:20 |只看该作者
原帖由 stornewer 于 2008-4-9 17:58 发表

这个以perl script 方式执行,sqplus /nolog登陆,实例没有启动啊



i 服了u
#!/bin/bash   没看到!!!

论坛徽章:
0
36 [报告]
发表于 2008-04-13 00:43 |只看该作者
应该感谢才对!

论坛徽章:
0
37 [报告]
发表于 2008-04-13 16:34 |只看该作者
看到了lz,谢谢啊!可以了

论坛徽章:
0
38 [报告]
发表于 2008-04-28 00:35 |只看该作者
vmware server 最新2.0多版本.免费的了.不过网页型式,不爽.
GSX SERVER 现升为ESX SERVER 3.5
vmware workstation 这个最新6.5测试版,不过占内存大,PARALLELS SERVER2.0也不错,和这个对等.占内存蛮少的.
vmware infrastructure 3.0管理控制端.结合ESX SERVER3.5.

论坛徽章:
2
2015年迎新春徽章
日期:2015-03-03 17:33:52数据库技术版块每日发帖之星
日期:2015-09-21 06:20:00
39 [报告]
发表于 2008-04-28 12:47 |只看该作者
vmware server 2.0还是测试版吧。

论坛徽章:
0
40 [报告]
发表于 2008-04-28 18:09 |只看该作者
各位大哥,谁有Autostart 的DEMO License ,小弟测试想用用
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP