su oracle -c "${ORACLE_HOME}/bin/sqlplus /nolog" <<EOF
connect / as sysdba
drop user tccs  CASCADE
exit
EOF
    ret=$?
    if [[ $ret != 0 ]]
    then
        print "user has delete failed!"
    return $ret
    else
        print "user deleted done."
    fi;
好像这个SHELL搞不定啊!!

解决方案 »

  1.   

    shell脚本如下:
    #!bin/bash
    su - oracle <<EOF
    /u01/app/oracle/product/10.2.0/db_1/bin/sqlplus -S / as sysdba
    drop user tccs CASCADE; 
    exit 
    EOFroot下执行:
    [root@jk ~]# sh test.shUser dropped.[root@jk ~]# sh test.sh
    drop user tccs CASCADE
              *
    ERROR at line 1:
    ORA-01918: user 'TCCS' does not exist[root@jk ~]#
      

  2.   

    哪里不行?你要把你的脚本和错误贴出来。还有路径别错了。oracle的版本多少?
      

  3.   

    报这个错
    standard in must be a tty
      

  4.   

    你把这个脚本加到crontab里做定时任务了?