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

Home -> Community -> Usenet -> c.d.o.tools -> Re: scripting question

Re: scripting question

From: Erik de Castro Lopo <nospam_at_mega-nerd.com>
Date: Tue, 16 Jan 2001 00:38:08 GMT
Message-ID: <3A639559.42E730D7@mega-nerd.com>

Matt Gross wrote:
>
> I have a question about building a script. Here is what I need the script to
> do. First, I need it to login to another unix machine (is this through
> telnet?)

If this telnet session has to go across the public internet then this is a VERY bad idea. You should look ito something like ssh.

man ssh

To automate the use of ssh to log into the other machine you might look at expect.

man expect

> and then on that machine I need it to somehow log into sqlplus and
> execute a *.sql script. Does anyone know how I can do this?

Well that too can be done with expect.

> Finally, I will
> need to set this up to run every morning at say around 8 am.

That can be done by with cron.

man cron

> Can anyone help
> with this or at least point me in a direction to search for info?

Just looking at this problem makes me think there must be an easier way.

If you ran a (possibly secure) web server on the other end then with a CGI script you could run the sql query. At this end you could probably even use wget (man wget) or curl to do the CGI request.

What I'm not too sure about is whether the .sql script just has to be run and you're not interested in seeing the output or whether you want to download the results of runing the .sql script. Either way, this is probably an easier solution.

BTW, its usually bad form to post something like this to six newsgroups. It is however better than posting it separately to each newsgroup.

Erik

-- 
+----------------------------------------------------------+
  Erik de Castro Lopo  nospam_at_mega-nerd.com (Yes its valid)
+----------------------------------------------------------+
"If you don't know what you need Windows NT for, you don't need it."
  - Bill Gates
Received on Mon Jan 15 2001 - 18:38:08 CST

Original text of this message

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