Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2007
    Posts
    2

    Unanswered: ORA-28576: lost RPC connection to external procedure agent during extproc

    Hi,

    I am trying to implement an external procedure to call a bat file.

    Hi,

    I tried the example posted by you.

    Here is what my code looks like

    create or replace library libc_w as 'C:\WINDOWS\system32\kernel32.dll';

    *************************

    create or replace function WinExec( Cmdstr IN varchar2, Cmdwin binary_integer ) return

    binary_integer as
    external
    library libc_w
    name "WinExec"
    language C
    calling standard PASCAL
    parameters ( Cmdstr string, Cmdwin int );

    *************************


    declare
    rc binary_integer;
    begin
    rc := WinExec( 'D:\\AutoTest\\test.bat',0 );
    DBMS_OUTPUT.put_line( 'return code='||rc );
    end;
    /

    *************************

    But this gives me the error

    "ORA-28576: lost RPC connection to external procedure agent"

    I have verified the listner.ora and tnsnames.ora files... they are correct
    (I was able to run a 'DIR' command through C 'system()' function using msvcrt.dll)

    Can you help me on this?

    *************************

    My final motive is to run a UNIX command on Oracle client machine through PL/SQL extproc.

    I plan to use a flow like
    PL/SQL --> WinExec (or CreateProcess) --> rsh --> Unix

    I have configured and tried the following command form Windows cmd and succeeded.

    'rsh 172.21.161.79 -l bld351 /home1/bld351/sachin/script

    Any guidance on this would be great.

    Thanks

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    28576, 00000, "lost RPC connection to external procedure agent"
    // *Cause: A fatal error occurred in either an RPC network connection,
    // the extproc agent, or the invoked 3GL after communication had
    // been established successfully.
    // *Action: First check the 3GL code you are invoking; the most likely
    // cause of this error is abnormal termination of the
    // invoked "C" routine. If this is not the case, check for
    // network problems. Correct the problem if you find it. If all
    // components appear to be normal but the problem persists, the
    // problem could be an internal logic error in the RPC transfer
    // code. Contact your customer support representative.

    The environment in which the "rsh" exists may be lacking typical values; such as PATH.
    IMO, it is wise to either verify the state of the environment or to always use fully qualifies pathnames for all commands & files.
    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.

  3. #3
    Join Date
    Jun 2007
    Posts
    2
    Quote Originally Posted by anacedent
    28576, 00000, "lost RPC connection to external procedure agent"
    // *Cause: A fatal error occurred in either an RPC network connection,
    // the extproc agent, or the invoked 3GL after communication had
    // been established successfully.
    // *Action: First check the 3GL code you are invoking; the most likely
    // cause of this error is abnormal termination of the
    // invoked "C" routine. If this is not the case, check for
    // network problems. Correct the problem if you find it. If all
    // components appear to be normal but the problem persists, the
    // problem could be an internal logic error in the RPC transfer
    // code. Contact your customer support representative.

    The environment in which the "rsh" exists may be lacking typical values; such as PATH.
    IMO, it is wise to either verify the state of the environment or to always use fully qualifies pathnames for all commands & files.

    I am planning to try this with rsh once I am able to invoke the .bat file "D:\\AutoTest\\test.bat"

    test.bat file at present only contains
    DIR D:\AutoTest > D:\AutoTest\test.log

Posting Permissions

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