Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to start a Stored Procedure directly from Unix shell skript ?
The best practice approach is to create a dbms_job.
However, if you absolutely must use a UNIX script, here is an example:
$ORACLE_HOME/bin/sqlplus -s /nolog << EOF
connect / as sysdba
SELECT count(*)
FROM dba_tablespaces;
exit;
EOF
Substitute the connect / as sysdba for username and password. It is
not good practice to hardcode usernames and passwords in your Oracle
scripts, so use your method of choice to obscure them.
You can also call a SQL script instead of embedding the SQL as shown above.
Hope this helps, there will be a lot of opinions on this. Received on Tue Mar 11 2003 - 13:25:58 CST