1、用sqlplus调用:c:\script.txt的内容
startup;命令行:sqlplus internal/oracle @c:\script.txt
2、用svrmgrl调用:
c:\script.txt的内容connect internal/oracle;
startup;命令行:svrmgrl @c:\script.txt

解决方案 »

  1.   

    可是我是在unix下进行操作的,也就是说我现在要写一个shell脚本程序,
    所以楼上所说的是不可行的
    :)
      

  2.   

    抱歉,我对UNIX的shell编程不太熟。
    祝你好运!
      

  3.   

    # !/bin/sh # chkconfig: 345 51 49 
    # description: starts the oracle dabase deamons 
    # ORA_HOME=/u01/app/oracle/product/8.1.7 
    ORA_OWNER=oracle 
    case "$1" in 
    'start') 
    echo -n "Starting Oracle8i: " 
    su - $ORA_OWNER -c $ORA_HOME/bin/dbstart 
    touch /var/lock/subsys/oracle8i 
    echo 
    ;; 'stop') echo -n "Shutting down Oracle8i: " 
    su - $ORA_OWNER -c $ORA_HOME/bin/dbshut 
    rm -f /var/lock/subsys/oracle8i 
    echo 
    ;; 'restart') echo -n "Restarting Oracle8i: " 
    $0 stop 
    $0 start 
    echo 
    ;; *) 
    echo "Usage: oracle8i { start | stop | restart }" 
    exit 1 esac 
    exit 0 上面是脚本,放在/etc/rc.d/init.d的oracle8i中(自己创建一个)
    然后执行下面的
    # chmod 700 /etc/rc.d/init.d/oracle8i 
    # whoami 
    root 
    # cd /etc/rc.d/init.d/ 
    # chkconfig --add oracle8i 
    # chkconfig --list oracle8i 
    oracle8i 0:off 1:off 2:off 3:on 4:on 5:on 6:off ps:只能启动数据库,listener还是需要手动启动,如果你知道怎么做,请告诉我[email protected]
    谢谢。
      

  4.   

    补充:我的系统是linux 7.2
    可能有些地方会有差异
      

  5.   

    oracle安装完成后,找到dbstart文件,把中间有关启动的三句copy到自己做的shell文件中即可。