Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to start a Stored Procedure directly from Unix shell skript ?

Re: How to start a Stored Procedure directly from Unix shell skript ?

From: NorwoodThree <norwoodthree_at_my-deja.com>
Date: 11 Mar 2003 11:25:58 -0800
Message-ID: <ba03e2c.0303111125.46599b00@posting.google.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US