使用oracle用户非交互式执行sql命令
执行一条命令
1 |
echo 'select member from v$logfile;' | su - oracle -c "sqlplus / as sysdba" |
执行两条命令
1 |
echo -e 'select member from v$logfile;\n select member from v$logfile;' | su - oracle -c "sqlplus / as sysdba" |
执行多条命令
1 2 3 4 5 |
su - oracle -c "sqlplus / as sysdba" <<EOF select member from v$logfile; select member from v$logfile; select member from v$logfile; EOF |
原文链接:CentOS下非交互式执行Oracle命令,转载请注明来源!