+ Reply to Thread
Page 3 of 4 FirstFirst 1 2 3 4 LastLast
Results 21 to 30 of 32

Using "whenever oserror" on Windows

  1. Re: Using "whenever oserror" on Windows


    Vsevolod Afanassiev wrote:
    > When writing SQL scripts for batch execution on UNIX I normally put
    > "whenever sqlerror", "whenever oserror" at the top, for example
    >
    > ---------------------------------------
    > whenever sqlerror exit failure rollback
    > whenever oserror exit failure rollback
    >
    > connect user/pass
    >
    >
    >
    > exit
    > -----------------------------------------
    > and then check for return code from SQL*Plus.
    >
    > For some reason it does not work on Windows - the "whenever oserror"
    > bit leads to message
    > O/S Message: No such file or directory
    >
    > For example:
    > ---------------------------------------
    > whenever sqlerror exit failure rollback
    > whenever oserror exit failure rollback
    >
    > connect / as sysdba
    > select * from dual;
    >
    > exit
    > -----------------------------------------
    >
    > This is for Oracle 9.2.0.4.0 on Windows 2003.
    >
    > File "glogin.sql" is where it should be, i.e. in
    > ORACLE_HOME\sqlplus\admin.
    >
    > It is not that I particularly need this "oserror" thing to work, but

    it
    > would be nice to know what is wrong with it.
    >
    > Thanks


    It does that on XP also. I thought it was looking for login.sql.
    Created a login.sql and tried placing that under SQLPATH value, system
    path, current directory, user home directory etc etc without any luck.

    I believe the only workarounds are,

    1) Move the connect statement out of the file and to the command line,
    sqlplus "/ as sysdba" @script.sql
    OR
    2) Change the connect clause to do a remote connection instead of
    local,
    connect sys/password@database as sysdba

    Regards
    /Rauf


  2. Re: Using "whenever oserror" on Windows


    Vsevolod Afanassiev wrote:
    > When writing SQL scripts for batch execution on UNIX I normally put
    > "whenever sqlerror", "whenever oserror" at the top, for example
    >
    > ---------------------------------------
    > whenever sqlerror exit failure rollback
    > whenever oserror exit failure rollback
    >
    > connect user/pass
    >
    >
    >
    > exit
    > -----------------------------------------
    > and then check for return code from SQL*Plus.
    >
    > For some reason it does not work on Windows - the "whenever oserror"
    > bit leads to message
    > O/S Message: No such file or directory
    >
    > For example:
    > ---------------------------------------
    > whenever sqlerror exit failure rollback
    > whenever oserror exit failure rollback
    >
    > connect / as sysdba
    > select * from dual;
    >
    > exit
    > -----------------------------------------
    >
    > This is for Oracle 9.2.0.4.0 on Windows 2003.
    >
    > File "glogin.sql" is where it should be, i.e. in
    > ORACLE_HOME\sqlplus\admin.
    >
    > It is not that I particularly need this "oserror" thing to work, but

    it
    > would be nice to know what is wrong with it.
    >
    > Thanks


    It does that on XP also. I thought it was looking for login.sql.
    Created a login.sql and tried placing that under SQLPATH value, system
    path, current directory, user home directory etc etc without any luck.

    I believe the only workarounds are,

    1) Move the connect statement out of the file and to the command line,
    sqlplus "/ as sysdba" @script.sql
    OR
    2) Change the connect clause to do a remote connection instead of
    local,
    connect sys/password@database as sysdba

    Regards
    /Rauf


  3. Re: Using "whenever oserror" on Windows

    Hi, Vsevolod,

    You may try creating the file tnsnav.ora under
    %oracle_home%\network\admin. I'm documenting my way to identify this
    file in case other people are interested.

    In the test.sql file, I say "whenever oserror continue rollback" so I
    don't have to login repeatedly. I type "conn yong/yong" to get the "O/S
    Message: No such file or directory" message, followed by "Connected"
    and "Rollback complete".

    Now I launch filemon (from sysinternals.com), apply filter d:\ora9i\*
    since I know it mostly likely is a file missing from that folder and
    down, and type "conn yong/yong" in sqlplus. Filemon.log shows a dozen
    lines of "FILE NOT FOUND" for sqlplus.exe process. I try each one and
    find that creating tnsnav.ora eliminates the error. Tedious? Maybe. But
    it's systematic.

    Yong Huang
    yong321ATyahoo.com


  4. Re: Using "whenever oserror" on Windows

    Hi, Vsevolod,

    You may try creating the file tnsnav.ora under
    %oracle_home%\network\admin. I'm documenting my way to identify this
    file in case other people are interested.

    In the test.sql file, I say "whenever oserror continue rollback" so I
    don't have to login repeatedly. I type "conn yong/yong" to get the "O/S
    Message: No such file or directory" message, followed by "Connected"
    and "Rollback complete".

    Now I launch filemon (from sysinternals.com), apply filter d:\ora9i\*
    since I know it mostly likely is a file missing from that folder and
    down, and type "conn yong/yong" in sqlplus. Filemon.log shows a dozen
    lines of "FILE NOT FOUND" for sqlplus.exe process. I try each one and
    find that creating tnsnav.ora eliminates the error. Tedious? Maybe. But
    it's systematic.

    Yong Huang
    yong321ATyahoo.com


  5. Re: Using "whenever oserror" on Windows

    Hi, Vsevolod,

    You may try creating the file tnsnav.ora under
    %oracle_home%\network\admin. I'm documenting my way to identify this
    file in case other people are interested.

    In the test.sql file, I say "whenever oserror continue rollback" so I
    don't have to login repeatedly. I type "conn yong/yong" to get the "O/S
    Message: No such file or directory" message, followed by "Connected"
    and "Rollback complete".

    Now I launch filemon (from sysinternals.com), apply filter d:\ora9i\*
    since I know it mostly likely is a file missing from that folder and
    down, and type "conn yong/yong" in sqlplus. Filemon.log shows a dozen
    lines of "FILE NOT FOUND" for sqlplus.exe process. I try each one and
    find that creating tnsnav.ora eliminates the error. Tedious? Maybe. But
    it's systematic.

    Yong Huang
    yong321ATyahoo.com


  6. Re: Using "whenever oserror" on Windows

    Hi, Vsevolod,

    You may try creating the file tnsnav.ora under
    %oracle_home%\network\admin. I'm documenting my way to identify this
    file in case other people are interested.

    In the test.sql file, I say "whenever oserror continue rollback" so I
    don't have to login repeatedly. I type "conn yong/yong" to get the "O/S
    Message: No such file or directory" message, followed by "Connected"
    and "Rollback complete".

    Now I launch filemon (from sysinternals.com), apply filter d:\ora9i\*
    since I know it mostly likely is a file missing from that folder and
    down, and type "conn yong/yong" in sqlplus. Filemon.log shows a dozen
    lines of "FILE NOT FOUND" for sqlplus.exe process. I try each one and
    find that creating tnsnav.ora eliminates the error. Tedious? Maybe. But
    it's systematic.

    Yong Huang
    yong321ATyahoo.com


  7. Re: Using "whenever oserror" on Windows

    Hi, Vsevolod,

    You may try creating the file tnsnav.ora under
    %oracle_home%\network\admin. I'm documenting my way to identify this
    file in case other people are interested.

    In the test.sql file, I say "whenever oserror continue rollback" so I
    don't have to login repeatedly. I type "conn yong/yong" to get the "O/S
    Message: No such file or directory" message, followed by "Connected"
    and "Rollback complete".

    Now I launch filemon (from sysinternals.com), apply filter d:\ora9i\*
    since I know it mostly likely is a file missing from that folder and
    down, and type "conn yong/yong" in sqlplus. Filemon.log shows a dozen
    lines of "FILE NOT FOUND" for sqlplus.exe process. I try each one and
    find that creating tnsnav.ora eliminates the error. Tedious? Maybe. But
    it's systematic.

    Yong Huang
    yong321ATyahoo.com


  8. Re: Using "whenever oserror" on Windows

    Hi, Vsevolod,

    You may try creating the file tnsnav.ora under
    %oracle_home%\network\admin. I'm documenting my way to identify this
    file in case other people are interested.

    In the test.sql file, I say "whenever oserror continue rollback" so I
    don't have to login repeatedly. I type "conn yong/yong" to get the "O/S
    Message: No such file or directory" message, followed by "Connected"
    and "Rollback complete".

    Now I launch filemon (from sysinternals.com), apply filter d:\ora9i\*
    since I know it mostly likely is a file missing from that folder and
    down, and type "conn yong/yong" in sqlplus. Filemon.log shows a dozen
    lines of "FILE NOT FOUND" for sqlplus.exe process. I try each one and
    find that creating tnsnav.ora eliminates the error. Tedious? Maybe. But
    it's systematic.

    Yong Huang
    yong321ATyahoo.com


  9. Re: Using "whenever oserror" on Windows

    Hi, Vsevolod,

    You may try creating the file tnsnav.ora under
    %oracle_home%\network\admin. I'm documenting my way to identify this
    file in case other people are interested.

    In the test.sql file, I say "whenever oserror continue rollback" so I
    don't have to login repeatedly. I type "conn yong/yong" to get the "O/S
    Message: No such file or directory" message, followed by "Connected"
    and "Rollback complete".

    Now I launch filemon (from sysinternals.com), apply filter d:\ora9i\*
    since I know it mostly likely is a file missing from that folder and
    down, and type "conn yong/yong" in sqlplus. Filemon.log shows a dozen
    lines of "FILE NOT FOUND" for sqlplus.exe process. I try each one and
    find that creating tnsnav.ora eliminates the error. Tedious? Maybe. But
    it's systematic.

    Yong Huang
    yong321ATyahoo.com


  10. Re: Using "whenever oserror" on Windows

    Hi, Vsevolod,

    You may try creating the file tnsnav.ora under
    %oracle_home%\network\admin. I'm documenting my way to identify this
    file in case other people are interested.

    In the test.sql file, I say "whenever oserror continue rollback" so I
    don't have to login repeatedly. I type "conn yong/yong" to get the "O/S
    Message: No such file or directory" message, followed by "Connected"
    and "Rollback complete".

    Now I launch filemon (from sysinternals.com), apply filter d:\ora9i\*
    since I know it mostly likely is a file missing from that folder and
    down, and type "conn yong/yong" in sqlplus. Filemon.log shows a dozen
    lines of "FILE NOT FOUND" for sqlplus.exe process. I try each one and
    find that creating tnsnav.ora eliminates the error. Tedious? Maybe. But
    it's systematic.

    Yong Huang
    yong321ATyahoo.com


+ Reply to Thread
Page 3 of 4 FirstFirst 1 2 3 4 LastLast