Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    Join Date
    Jul 2007
    Posts
    15

    Red face Unanswered: ORA-06522:can someone help me!!!

    I am getting the errors for extproc as below:
    ORA-06520: PL/SQL: Error loading external library
    ORA-06522:
    '/u01/app/oracle/product/10.2.0/db_1/lib/shell.so' is not a valid
    load module: Bad magic number
    ORA-06512: at "SYS.SHELL", line 1
    ORA-06512: at line 1
    I have serached entire google but i got no answer.
    Hope to get it from oracle guru's.
    Please help me.

    Steps followed:

    1. shell.so is my own library.
    It's code is
    #include<stdio.h>
    #include<stdlib.h>

    void sh(char *command) {

    int num;

    num = system(command);

    }

    2.Created the library and procedure in the sql prompt
    -->CREATE LIBRARY shell_lib is '/u01/app/oracle/c/shell.so';
    /
    -->CREATE OR REPLACE PROCEDURE shell(command IN char)
    AS EXTERNAL
    NAME "sh"
    LIBRARY shell_lib
    LANGUAGE C
    PARAMETERS (command string);
    /

    3.Then executed
    SQL> exec shell('ls');
    The error is as follows:
    ERROR at line 1:
    ORA-06520: PL/SQL: Error loading external library
    ORA-06522: '/u01/app/oracle/product/10.2.0/db_1/lib/shell.so' is not a valid
    load module: Bad magic number
    ORA-06512: at "SYS.SHELL", line 1
    ORA-06512: at line 1

    Can someone resolve this error.
    My listener.ora is perfect as well as my shell.so as i have used the library
    in a sample program.

    Thanks,
    Anilkumar

  2. #2
    Join Date
    Jul 2007
    Posts
    15
    I hace done tnsping extproc_connection_data.
    It is positive.

  3. #3
    Join Date
    Jul 2007
    Posts
    15
    Can someone help me to solve this problem.
    I would be really grateful to them.

  4. #4
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    Did you compile the source program as a shared library?
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  5. #5
    Join Date
    Jul 2007
    Posts
    15
    Thanks for the help Beil.
    I have used the library using a test program. It worked fine for me.
    Not sure what the problem is.

  6. #6
    Join Date
    Jul 2007
    Posts
    15
    Hi,

    Here is brief thing on the library's authenticity.

    This is the test program i have written to test my library
    ===============================
    #include <stdio.h>

    int main ()
    {
    sh ("ls");
    printf ("\n I am done");
    }
    ================================
    The below code is my library code
    ================================
    #include<stdio.h>
    #include<stdlib.h>

    void sh(char *command) {

    int num;

    num = system(command);

    }
    =================================
    After linking the library, i got the listing of the directory output.
    SO this confirms that the library is built properly.

    Can anyone help me to solve the problem??

    Thanks,
    Anilkumar

  7. #7
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    Is the library physically in a directory that is in your LD_LIBRARY_PATH? Also what are it's permissions.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  8. #8
    Join Date
    Jul 2007
    Posts
    15
    Hi Beil,

    The Library is in $ORACLE_HOME/lib
    The permissions are rwrwrw

    Thanks,
    Anilkumar B.V.N

  9. #9
    Join Date
    Aug 2007
    Posts
    2
    Hi All,

    I am facing the following problem when i connect the application with oracle10g

    java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=168821248)(ERR=1 2505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))

    but i can connect oracle10g through sqlplus or plsql developer
    why i could not connect my application with oracle10g


    Can someone help me to solve this problem.
    I would be really grateful to them

  10. #10
    Join Date
    Jul 2007
    Posts
    15
    Ignore the post. Annie created a new thread

  11. #11
    Join Date
    Jul 2007
    Posts
    15
    Ignore the above annie's post. Annie created a new thread. Did anyone get a chance to go through my problem

  12. #12
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    http://www.dbforums.com/showthread.php?t=1031644
    How many of the resources list in the post above have you searched?
    I suspect you question has been answered above if you are willing to look.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  13. #13
    Join Date
    Jul 2007
    Posts
    15
    After much efforts and going through every post, i tried all that they gave
    like problem with library, extproc version, 32/64 bit extproc.
    It still didn't work and that's the reason i made a post. i would like to thank anacedant for directing me to the search. yes this questions has been posted long time back but no conclusion or answer has been posted. So i had to start a new thread. I will provide any info regaring the way i am trying extproc.
    Already, i have given my listener.ora as well as authenticity of the library. Please do help me if u can.

  14. #14
    Join Date
    Jul 2007
    Posts
    15
    Quote Originally Posted by Anilkumarbvn
    After much efforts and going through every post, i tried all that they gave
    like problem with library, extproc version, 32/64 bit extproc.
    It still didn't work and that's the reason i made a post. i would like to thank anacedant for directing me to the search. yes this questions has been posted long time back but no conclusion or answer has been posted. So i had to start a new thread. I will provide any info regaring the way i am trying extproc.
    Already, i have given my listener.ora as well as authenticity of the library. Please do help me if u can.
    I give up. Thanks for your support.

  15. #15
    Join Date
    Aug 2007
    Posts
    2

    Red face same kind of error

    ORA-06520: PL/SQL: Error loading external library
    ORA-06522: ld.so.1: $MMHOME/oracle/lib/bin/extproc:
    fatal: libdealinc.so: open failed: No such file or directory
    ORA-06512: at "SCOTT.PUTENV2", line 0
    ORA-06512: at line 1

    tnsping extproc_connection_data is alright

    the As user had LD_LIBRARY_PATH set to
    $MMHOME/oracle/lib/bin:$ORACLE_HOME/bin

    The file is located at the specified destination with 777 permissions.

    can you suggest me anything to look for

    Thank you.

Posting Permissions

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