Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Hi

    I need to write a shell script that would call a sql script . While this sql
    script is running i need to run another SQL in another
    session continuously .
    test.ksh would call test.sql which would run for about 10 -20 minutes . I
    would like to call test1.sql ( which basically would be like
    "select * from dual" ) and spool to a log file .
    Any clues to do this will help .

    Thanks







    Oradba Linux Guest

  2. #2

    Default Re: Hi

    "Oradba Linux" <oradba_linux@attbi.com> wrote in
    news:fjmN9.67406$qF3.4863@sccrnsc04:
    > I need to write a shell script that would call a sql script . While
    > this sql script is running i need to run another SQL in another
    > session continuously .
    > test.ksh would call test.sql which would run for about 10 -20 minutes
    > . I would like to call test1.sql ( which basically would be like
    > "select * from dual" ) and spool to a log file .
    > Any clues to do this will help .
    >
    > Thanks
    >
    I surmise that you know neither Oracle nor Linux,
    other than being able to spell each of them.


    sqlplus << EOF
    @test1
    exit
    EOF

    HTH & YMMV!
    Ban Spam Guest

  3. #3

    Default Re: Hi

    On Sun, 22 Dec 2002 19:47:46 +0000, Ban Spam wrote:
    > "Oradba Linux" <oradba_linux@attbi.com> wrote in
    > news:fjmN9.67406$qF3.4863@sccrnsc04:
    >
    >> I need to write a shell script that would call a sql script . While this
    >> sql script is running i need to run another SQL in another session
    >> continuously .
    >> test.ksh would call test.sql which would run for about 10 -20 minutes .
    >> I would like to call test1.sql ( which basically would be like "select *
    >> from dual" ) and spool to a log file . Any clues to do this will help .
    >>
    >> Thanks
    >>
    >>
    > I surmise that you know neither Oracle nor Linux, other than being able to
    > spell each of them.
    >
    >
    > sqlplus << EOF
    > @test1
    > exit
    > EOF
    >
    > HTH & YMMV!
    Yeah you are right thats why i am posting to newsgroup .
    I did not want to know how to call sql script from a korn shell script .
    But i want to know how to run another SQL statement continuously (
    possibly another shell script ) while this sql script is running .
    Oradba Linux Guest

  4. #4

    Default Re: Hi

    "Oradba Linux" <oradba_linux@attbi.com> wrote in
    news:pan.2002.12.22.23.57.29.503034@attbi.com:
    > Yeah you are right thats why i am posting to newsgroup .
    > I did not want to know how to call sql script from a korn shell script
    > . But i want to know how to run another SQL statement continuously (
    > possibly another shell script ) while this sql script is running .
    >
    So what's stopping you from opening another "Window" on your Linux box
    and launching the 2nd script?













    HAND!
    Ban Spam Guest

  5. #5

    Default Re: Hi


    "Ban Spam" <ban-spam@operamail.com> wrote in message
    news:Xns92ECB2C273F85SunnySD@68.6.19.6...
    > "Oradba Linux" <oradba_linux@attbi.com> wrote in
    > news:pan.2002.12.22.23.57.29.503034@attbi.com:
    >
    > > Yeah you are right thats why i am posting to newsgroup .
    > > I did not want to know how to call sql script from a korn shell script
    > > . But i want to know how to run another SQL statement continuously (
    > > possibly another shell script ) while this sql script is running .
    > >
    >
    > So what's stopping you from opening another "Window" on your Linux box
    > and launching the 2nd script?
    >

    Howard J. Rogers Guest

  6. #6

    Default Re: Hi

    Why not put each SQL in its own shell and start them all at once with the nohup
    and & commands? Then all of them would be running in the background "at the
    same time".

    However,I fail to see the reason for this requirement because you're just
    competing with yourself.

    Cliff
    Noodles Guest

  7. #7

    Default Re: Hi

    "Noodles" <noodles@aol.com> wrote in message
    news:20021223071256.21518.00000195@mb-fm.aol.com...
    > Why not put each SQL in its own shell and start them all at once with the
    nohup
    > and & commands? Then all of them would be running in the background "at
    the
    > same time".
    >
    > However,I fail to see the reason for this requirement because you're just
    > competing with yourself.
    >
    Well, if you were trying to do performance tuning on a test setup, mimicing
    as closely as possible what happens in a production environment, this would
    be a very nice resource to have, don't you think?

    Regards
    HJR

    > Cliff

    Howard J. Rogers Guest

  8. #8

    Default Re: Hi

    Well, in a way you can. It's called a background job:


    sqlplus user/pass @test &
    sqlplus user/pass @test1 &

    The '&' will submit the given task as a background job, thus returning
    control to the calling shell allowing yet another statement to be
    processed. If you want the first job to run in the background and
    have the second job run 'live', simply remove the second '&':

    sqlplus user/pass @test &
    sqlplus user/pass @test1

    test.sql will be executed in the background whilst test1.sql will run
    in the foreground.

    David Fitzjarrell


    "Howard J. Rogers" <howardjr2000@yahoo.com.au> wrote in message news:<zGwN9.8566$jM5.24124@newsfeeds.bigpond.com>. ..
    > I think you've missed his point. He wants to run a shell script which runs
    > multiple SQL scripts, and have each SQL script run asynchronously. As
    > SQL1.sql runs, so the shell script starts running SQL2.sql, without waiting
    > for the first one to finish and return.
    >
    > Can you script something asynchronously?
    >
    > God knows. But that's what he's after, I think.
    >
    > Regards
    > HJR
    >
    >
    > "Ban Spam" <ban-spam@operamail.com> wrote in message
    > news:Xns92ECB2C273F85SunnySD@68.6.19.6...
    > > "Oradba Linux" <oradba_linux@attbi.com> wrote in
    > > news:pan.2002.12.22.23.57.29.503034@attbi.com:
    > >
    > > > Yeah you are right thats why i am posting to newsgroup .
    > > > I did not want to know how to call sql script from a korn shell script
    > > > . But i want to know how to run another SQL statement continuously (
    > > > possibly another shell script ) while this sql script is running .
    > > >
    > >
    > > So what's stopping you from opening another "Window" on your Linux box
    > > and launching the 2nd script?
    > >
    > >
    > >
    > >
    > >
    > >
    > >
    > >
    > >
    > >
    > >
    > >
    > >
    > > HAND!
    David Fitzjarrell Guest

  9. #9

    Default Re: Hi

    On Mon, 23 Dec 2002, [email]howardjr2000@yahoo.com.au[/email] wrote:
    > I think you've missed his point. He wants to run a shell script which
    > runs multiple SQL scripts, and have each SQL script run
    > asynchronously. As SQL1.sql runs, so the shell script starts running
    > SQL2.sql, without waiting for the first one to finish and return.
    >
    > Can you script something asynchronously?
    >
    > God knows. But that's what he's after, I think.
    This can be done, but it would take a reasonable amount of testing to
    make sure it worked correctly.

    But, first, he should probably get the cygwin distro at
    [url]http://cygwin.com[/url].

    Then, he should make sure he can, Start --> Run --> bash and then type
    ls and get a directory listing. This will then mean that he has access
    to sh.exe.

    His script suite would look something like:

    Call this file sql1.sh:

    #!/bin/sh
    sqlplus user/pass << EOF > sql1.log
    `cat sql1.sql`
    EOF

    echo "DONE WITH SQL1" > sql1_ind.log

    Call this file sql2.sh:

    #!/bin/sh
    while (1 eq 1) do
    sqlplus user/pass << EOF >> sql1.log
    `cat sql2.sql`
    EOF
    done

    Call this file doit.sh:
    #!/bin/sh
    done_ind=0
    sql1.sh&
    while (done_ind = 0) do
    if exists sql1_ind.log
    done_ind = 1
    fi
    sleep #secs
    done

    So, then he could kill the background process when doit.sh completes,
    but within the script he could get the process id and kill -9 it, or
    something like that anyways. If that were done, then his script would
    be fairly self contained.

    --
    Galen deForest Boyer
    Sweet dreams and flying machines in pieces on the ground.
    Galen Boyer Guest

  10. #10

    Default Re: Hi


    --------------010506040801060709000403
    Content-Type: text/plain; charset=us-ascii; format=flowed
    Content-Transfer-Encoding: 7bit

    I think we should redirect it to the perl community =)




    Justin Copeland wrote:
    > mpiby43agi6oaljik1m05s6v
    > Stop Mailings Here
    > <http://cRook-ED.com/%68os%74/%65%6d%61i%6c%72%65%6D%6F%76e.as%70>
    > <http://WWW.CheaPOnnET1.COm/mk%61/%6D%32c.%70hp?%6D%61%6E=k%6f%6D%345%36>
    > qspodfwj9y
    > 32ct2anihpnf33
    >


    --------------010506040801060709000403--


    Bermejo, Rodrigo Guest

  11. #11

    Default Re: Hi

    Saluton!

    * Bermejo, Rodrigo; 2003-07-02, 10:51 UTC:
    > I think we should redirect it to the perl community =)
    Or perhaps (see my message on IP matching against nets) start an
    obfuscation contest of our own.

    Gis,

    Josef 'Jupp' Schugt
    --
    Someone even submitted a fingerprint for Debian Linux running on the
    Microsoft Xbox. You have to love that irony :).
    -- Fyodor on [email]nmap-hackers@insecure.org[/email]

    Josef 'Jupp' Schugt Guest

  12. #12

    Default Hi

    MYSQL problems problems.
    I want to install an user login aplicationa on my site, but it is intarely in FLASH. ( [url]www.poker.club66.ro[/url] ).
    What do u think?

    Rausch Alexandru Guest

  13. #13

    Default Re: Hi

    On Tue, Jul 22, 2003 at 11:42:04AM +0300, Rausch Alexandru wrote:
    > From: "Rausch Alexandru" <rausch@go.ro>
    > Subject: Hi
    >
    > MYSQL problems problems.
    > I want to install an user login aplicationa on my site, but it is intarely in FLASH. ( [url]www.poker.club66.ro[/url] ).
    > What do u think?
    I think this doesn't sound like a problem with "Hi", as your subject
    line indicated.

    --
    Paul Chvostek <paul@it.ca>
    it.canada [url]http://www.it.ca/[/url]
    Free PHP web hosting! [url]http://www.it.ca/web/[/url]

    Paul Chvostek Guest

  14. #14

    Default hi

    Hi. I need MacOS 8.1.1 or 8.1.(english language).Thanks
    Almir Guest

  15. #15

    Default Re: hi

    In article <woPTa.697$gr.453@ns45.bih.net.ba>,
    "Almir " <ganic@bih.net.ba> wrote:
    > Hi. I need MacOS 8.1.1 or 8.1.(english language).Thanks
    Try eBay.
    Wayne C. Morris Guest

  16. #16

    Default Re: hi

    In article <woPTa.697$gr.453@ns45.bih.net.ba>, "Almir " <ganic@bih.net.ba>
    wrote:
    > Hi. I need MacOS 8.1.1 or 8.1.(english language).Thanks
    Ok.

    I need a new stereo, I am thinking about the Pioneer NS-DV1000. Thanks.

    --
    Sandman[.net]
    Sandman Guest

  17. #17

    Default hi


    Hi,
    I have created a UDF in java and I have registered that with DB2. I
    have put the class file in sqllib\function but in DB2 v 7.2 its able
    to load class but in DB2 version 8 its not able to find the class
    file. It returns
    custid='25'
    DB21034E The command was processed as an SQL statement because
    it was not a
    valid Command Line Processor command. During SQL processing it
    returned:
    SQL0723N An error occurred in a triggered SQL statement in trigger
    "DB2ADMIN.CJCHD24". Information returned for the error includes SQLCODE
    "-4304", SQLSTATE "42724" and message tokens
    "DB2ADMIN.SEND|SQL030801010310400|Sample1|". SQLSTATE=09000

    Could someone help me on this issue ?

    Regards,
    Ajay

    --
    Posted via [url]http://dbforums.com[/url]
    ajay978 Guest

  18. #18

    Default Re: hi


    hi,
    I am using DB2 v 8.1 and when i run the same program on 7.2 it worked
    but not in 8.1. Actually I tried to register even a simple function like

    =======================
    import java.lang.*;
    import java.io.*;

    public class UDFjsrv
    {

    public static double scalarUDF()
    throws Exception
    {
    double outNewSalary = 100 * 1.20;
    return outNewSalary;
    }
    }

    ==========================
    and after registering I call "db2 values(scalarUDF())" its giving
    following error
    1------------------------
    SQL4304N Java stored procedure or user-defined function
    "DB2ADMIN.SCALARUDF",
    specific name "SQL030801115449400" could not load Java class
    "UDFjsrv", reason
    code "5". SQLSTATE=42724

    code "5" means "Cannot establish default context."

    I don;t know what it mean ? I guess there is some bug in java runtime in
    db2 v8.1.If anyone has idea pls post it.


    Regards,
    Ajay

    --
    Posted via [url]http://dbforums.com[/url]
    ajay978 Guest

  19. #19

    Default Re: hi

    ajay978 <member10239@dbforums.com> wrote:
    >
    > Hi,
    > I have created a UDF in java and I have registered that with DB2. I
    > have put the class file in sqllib\function but in DB2 v 7.2 its able
    > to load class but in DB2 version 8 its not able to find the class
    > file. It returns
    > custid='25'
    > DB21034E The command was processed as an SQL statement because
    > it was not a
    > valid Command Line Processor command. During SQL processing it
    > returned:
    > SQL0723N An error occurred in a triggered SQL statement in trigger
    > "DB2ADMIN.CJCHD24". Information returned for the error includes SQLCODE
    > "-4304", SQLSTATE "42724" and message tokens
    > "DB2ADMIN.SEND|SQL030801010310400|Sample1|". SQLSTATE=09000
    >
    > Could someone help me on this issue ?
    Try calling the procedure outside of the trigger on the command line. Then
    you will see the actual message of the error, which is SQL4304, and check
    the conditions why this error could have been raised. (CLASSPATH not set,
    UDF/StoredProc interface not implemented, public flag missing, default
    constructor failed or mislsing, driver problem, ...).

    --
    Knut Stolze
    Information Integration
    IBM Germany / University of Jena
    Knut Stolze Guest

  20. #20

    Default Re: hi


    Check security attributes of the directory where the file resides.
    sqllib/function ?

    Maybe you need a "Grant execute on function ..."?

    PM


    PM \(pm3iinc-nospam\) Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139