DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: error description

  1. #1
    Join Date
    Jul 2000
    Location
    india
    Posts
    213

    error description

    Hi everybody,

    How can i see the description of the error i encountered at the SQL prompt.For e.g if i got the error ORA-01531, a database already open by this instance.

    and if i type at sql prompt something like..(i read it somewhere..)
    SQL> !oerr ora 1531

    It should give me the description of the error...cause and action
    But i tried it and it gives me..
    SQL> !oerr ora 1531
    SP2-0734: unknown command beginning "!oerr ora ..." - rest of line ignored.

    Thanks in advance
    pras
    Dream as if u'll live forever..Live as if u'll die today.

  2. #2
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    Where are you firing this command from ??

    First it works only on unix not on windows...

    If you are using a windows sql client and using it to connect to unix server then also it wont work.

    telnet to unix machine, use the client there and then try.

    NOTE: Never try what you just read somewhere unless or until you know what it does.
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

  3. #3
    Join Date
    Jul 2000
    Location
    india
    Posts
    213

    Thanks

    Thanks Amar for the quick response...

    pras
    Dream as if u'll live forever..Live as if u'll die today.

  4. #4
    Join Date
    Jan 2002
    Location
    Up s**t creek
    Posts
    1,525
    If you want to perform the same function on any platform you can use a simple procedure like the following:

    Code:
    SQL> CREATE OR REPLACE PROCEDURE oerr (errno IN NUMBER) 
      2  IS 
      3    errno_v NUMBER; 
      4    msg_v   VARCHAR2(200); 
      5  BEGIN 
      6    IF errno > 0 THEN
      7      errno_v := errno * -1; 
      8    ELSE 
      9      errno_v := errno; 
     10    END IF; 
     11    msg_v := sqlerrm(errno_v) ; 
     12    dbms_output.put_line(msg_v) ; 
     13  END oerr; 
     14  
     15  /
    
    Procedure created.
    
    SQL> set serveroutput on
    SQL> exec oerr(1531)
    ORA-01531: a database already open by the instance
    
    PL/SQL procedure successfully completed.
    HTH
    Jim
    Oracle Certified Professional
    "Build your reputation by helping other people build theirs."

    "Sarcasm may be the lowest form of wit but its still funny"

    Click HERE to vist my website!

  5. #5
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    Jim, that's pretty!
    Obvious when you see it - isn't that always the way! Thanks.
    "The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman

  6. #6
    Join Date
    Jul 2000
    Location
    india
    Posts
    213
    Hi Jovery,

    Actually i am more interested in the cause and the action part of the description.How do i include that in the above procedure.Any other way..Thanks for the help.

    pras
    Dream as if u'll live forever..Live as if u'll die today.

Posting Permissions

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


Click Here to Expand Forum to Full Width