Skip to Main Content
  • Questions
  • End-of-communication channel , hostdef not found

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, Raman.

Asked: June 29, 2000 - 8:13 am UTC

Last updated: November 29, 2011 - 11:37 am UTC

Version: 8.0.4

Viewed 10K+ times! This question is

You Asked

Hi Tom,
I am back with my new problems. actually what happened, I had exported one user's schema in imported in other user's schema. whats happening now, the moment devlopers try any transactins thru that user, 2 error comes :

1. end-of-communication channel
2. hostdef not found.

I am badly stuck with these probs. Will u please help me to find out, why and whats happening. It happens sometimes even when working on SQL*Plus in daily routine.

pls. help me !

regards.

raman.

and Tom said...

when you get the 3113 -- that indicates the server thread/process we were using has "unexpectedly gone away". In sqlplus this will undoubtably lead to the hostdef error since the error causes the backend to disappear.

The underlying cause of a 3113 can be diagnosed typically by:

o inspecting the alert log on the server. There should be a message in there typically that tells of the error occuring and gives the name of a trace file.

o the trace file will contain more details. Most importantly, you can see the SQL statement that was executing usually at the time of the crash. This can be useful in diagnosing the statement that is giving us a hard time. The remainder of the trace file will not be very useful to you -- but it will be useful to support which is your next step....

o contact support with the contents of the trace file. For errors like this, the information in the trace file can be used by support/development to track down the cause of this error.

Rating

  (19 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Very well put

Doug, November 09, 2001 - 12:59 pm UTC

Very clear explanation of an error. Quick follow up, can you elaborate on why in SQL PLUS we get the hostdef problem? The backend? What is hostdef exactly anyhow?

Tom Kyte
November 09, 2001 - 1:39 pm UTC

the hostdef is just an OCI programming structure - it's part of the connection. The host definition is not found when the host "goes away" like this.

end-of-comunication problem

Arumugam Sivababu, February 01, 2002 - 3:35 am UTC

Hello TOM,
While running the trigger i'm getting end-of-file communication. The same trigger is running in other users with out any problem. I couldn't find any problem in the user. I'm not in a position to send my production triggers and procedures.

Please reply me and expecting your mail.

regards,
sivababu

Tom Kyte
February 01, 2002 - 9:11 am UTC

Umm, see the last step in my answer. There is nothing i can personally do. If you cannot give support the information -- there will be not much they can do either. They will need you to generate a tracefile at the very least.

Auto reconnect after DB cold backups

A reader, April 19, 2004 - 12:34 pm UTC

Hi Tom,

Our database (9iR2) is shutdown early a.m. every first monday for cold backup, whereas the application is not restarted afterwards. When the users try to use the application again, they received ora-03113 errors. The database is already up at the time.

I can use a script to restart the application every first monday, but is there other ways such as fail-over in Listener?

Tom Kyte
April 19, 2004 - 3:01 pm UTC

well, shutting down for backups is a bad thing but

... how about having the application itself connect after it fails? You wrote the app right?

seems the people that do the backup could help here as well -- perhaps they could shutdown the application if they are going to shutdown the database.

You could go fancy with TAF (transparent application failover) to have it reconnect to "itself" (fail over to itself) but that would be a little like taking an atom bomb to crack open a walnut in this case.

Getting End of file Communication error when using vpn

Balaji, May 06, 2004 - 11:11 am UTC

Hi Tom
We get the End of file communication error when compiling a stored proc on a remote database using VPN connection.

It doesn't happen when we do the same from the local network.

We have been using the DCD and update expire time as 5 mins in the sqlnet.ora, and that sovled the problem of disconneting so often.
But if we are running some sql or compiling a procedure, and if there is an error, then the sqlplus session is getting disconnected with the "end-of-file communication" error.

We are running oracle 9.2.0.1 EE on sun solaris and using Check point VPN. I am sure it is a network issue but just want to check with you, why it is happening only there is an error..

Thanks as always

3113 after the remote server is rebooted.

Sean, December 16, 2004 - 10:52 am UTC

Hi Tom,

I have procedure in scott/tiger@cbadmin and call cbtest2 db.  After cbtest2 rebounced, I will get the error the FIRST TIME to call the procedure.

It is quite strange since I didn't connect to that remote server when it is rebooted.  Any solution for this?  Thanks so much for your help.

----------------------------------------------------------
Here is the testing case:

SQL> create or replace procedure p1
  2  is 
  3  
  4  v1 varchar2(100);
  5  
  6  begin
  7  
  8    select sysdate into v1 from dual@cbtest2;
  9     dbms_output.put_line('v1 is '|| v1);
 10  
 11  end;
 12  /

Procedure created.

SQL> set serveroutput on
SQL> exec p1
v1 is 16-DEC-04

PL/SQL procedure successfully completed.


-- After cbtest2 rebooted.
SQL> exec p1
BEGIN p1; END;

*
ERROR at line 1:
ORA-02068: following severe error from CBTEST2
ORA-03113: end-of-file on communication channel
ORA-06512: at "SCOTT.P1", line 8
ORA-06512: at line 1

-- exec again.
SQL> exec p1
v1 is 16-DEC-04

PL/SQL procedure successfully completed.



 

Tom Kyte
December 16, 2004 - 11:32 am UTC

3113 = please contact support. there should be a trace file generated that they can use to track down the issue.

3113 error

Sean, December 16, 2004 - 11:49 am UTC

Hi Tom,

It is not real bug. You can repeat that error when remote server is rebooted.

Thanks so much for your help.

Tom Kyte
December 16, 2004 - 12:02 pm UTC

umm, how is that not a real bug?

3113 error

Sean, December 16, 2004 - 12:50 pm UTC

Hi Tom,

I just thought that you would have educated me. Some thing like “This is how Oracle works. You call remote server, establish the connection. When remote server is down, the connection is broken. When you call remote server, you get 3113 error. If you call again, Oracle reestablish the link.”

The testing is so generic that if it is the bug, Oracle would have fixed it a long time ago.

Thanks so much for your help.



Thanks so much for your help.


Tom Kyte
December 16, 2004 - 1:35 pm UTC

I did that in the top of this page.


Look -- you have a query.

Query failed on the first attempt after a reboot with an ora-3113

ora-3113 means

<quote>
when you get the 3113 -- that indicates the server thread/process we were using
has "unexpectedly gone away".
</quote>

if that is not a bug to you, well, don't know what to say.

Sean's error seems reasonable to me...

Andrew, December 16, 2004 - 2:21 pm UTC

I also don't see how it can be called a bug - it seems intuative to me.

When p1 is created, it opens a DB link to database2 to verify the remote reference. The link stays open on databse2 (visible in v$session on database2).

Database2 is bounced.

P1 is executed in the same session as it was created in predictably it fails with 3113 (because it doesn't know the remote session is gone until it tries to communicate over the "open" link again).

The next execution of P1 re-opens the DB link (a new session is started in databse2).

What am I missing?

Tom Kyte
December 16, 2004 - 2:55 pm UTC

ahh, ok -- now I see.

I was thinking he was saying

"first time after a bounce, I make this call -- and it fails with ora-3113. Just the first time". So my timeline was:

a) bounce remote database
b) log into a database and run a procedure
c) bamm 3113.

but, if you make that:

a) you log into the "local database"
b) open a dblink to "remote" and use it
c) someone shuts down "remote"
d) then a 3113 is expected - not a bug, got it. You terminated the communication change -- tcp doesn't tell us (can't really) that the other end "is gone".

sorry about that. Makes sense that way.

3113 error

Sean, December 16, 2004 - 4:02 pm UTC

That is what I meant. Thanks so much for your help.

Tom Kyte
December 16, 2004 - 5:09 pm UTC

sorry for the confusion, in retrospect -- i read it wrong.

How to avoid 3113 error

Sean, December 27, 2004 - 11:29 am UTC

Hi Tom,

The reason I asked this question is that we have VB application which calls stored procedure in local database, which then calls remote database. VB application always gets 3113 error every time the remote database is bounced (Of course, users use same VB session).

I tried to kill the remote session before bounce the remote db, but killing the remote session would kill local session too. Why?

Are there any ways to avoid this error assuming we need to bounce remote db and uses want to use same application session?

Thanks so much for your help.


Tom Kyte
December 27, 2004 - 12:20 pm UTC

killing the remote session kills the local session? not sure what you mean by that. it would result in a 3113 is all.


The VB application can close dblinks after it is done using them instead of keeping them open.

killing remote session leads local session killed

Sean, December 27, 2004 - 2:30 pm UTC

Here is the demo.  Thanks so much.

-- In session on cbadmin  ( local db)

SQL> connect scott/tiger@cbadmin
Connected.

SQL> create or replace procedure p1
  2      is  
  3  v1 varchar2(100); 
  4  begin   
  5       select sysdate into v1 from dual@cbtest2;  -- connect to remote db
  6  end; 
  7  /

Procedure created.

SQL> exec p1

PL/SQL procedure successfully completed.


-- In session two on cbtest2 (remote db)
SQL> connec system/password@cbtest2
Connected.
SQL> select sid, serial# from v$session where username='SCOTT';

       SID    SERIAL#
---------- ----------
        13      26199

-- Kill the remote session.
SQL> alter system kill session '13, 26199';

System altered.


-- In session one on cbadmin (local db)
-- The session is still alive after the remote session is killed.
SQL> select count(*) from emp;

  COUNT(*)
----------
        14

-- Running this procedure shows the session is killed.
SQL> exec p1
BEGIN p1; END;

*
ERROR at line 1:
ORA-00028: your session has been killed
ORA-02063: preceding line from CBTEST2
ORA-06512: at "SCOTT.P1", line 5
ORA-06512: at line 1


-- Running this query returnes error.
SQL> select count(*) from emp;
select count(*) from emp
*
ERROR at line 1:
ORA-01012: not logged on


SQL>  

Tom Kyte
December 27, 2004 - 4:30 pm UTC

interesting, learn something new everyday, I would not have anticipated that necessarily. Never tried.


But, if you don't want the 3113, you'll have to close database links (like closing a file) when you are done with them.

Close database link

Richard, December 28, 2004 - 12:17 pm UTC

I just wonder how to close database link?

Tom Kyte
December 28, 2004 - 2:20 pm UTC

Close database link

Richard, December 28, 2004 - 1:48 pm UTC

I just wonder how to close database link?

what has oracle recommended for 3113 ?

A reader, March 16, 2005 - 1:45 am UTC

Hi Tom,

I always follow this site for any kind of problems. I really appreciate that.

I have a small query. What are Oracle's recommendations in order to avoid 3113 ?

Thanks in advance.

Tom Kyte
March 16, 2005 - 8:19 am UTC

metalink.oracle.com

3113 means "something went wrong" generally. sometimes a configuration issue, sometimes a bug.

3113 in OWB

jas, May 15, 2005 - 2:57 am UTC

Hi Tom

We are running a mapping through OWB in databse test it runs fine and inserts 4,00,000 records
Now I am running the same Mapping through production database it just hangs or sometimes adds 39,000 records or aother times 214 records and then does nothing.
In the alert file no error is there but in table wb_rt_errors shows ora-3113 error in runtime env.

Actually in this environment we are taking data directly from oltp environment in which the table has 4,00,000 records.
Other 2 mappings which inserts nearlu 30,000 records runs fine

Tom Kyte
May 15, 2005 - 9:35 am UTC

if you are getting a 3113, please contact support.

end-of-file on communication channel

Rahul Chaudhari, May 15, 2005 - 11:58 pm UTC

Hi Tom,

i'm getting these error end-of-file on communication channel when i'm starting my database.

Actually i'd copied all the datafiles, redofile, controlfiles, dump files, Archive files, pfile on other machine(all the files of database). i have created the service for these database on other machine (were the database files are copied). but when i'm trying to connect the database by SYSDBA the error end-of-file on communication channel is getting.




Tom Kyte
May 16, 2005 - 7:53 am UTC

please contact support.

end-of-file on communication channel

Rahul Chaudhari, July 12, 2005 - 12:34 am UTC

Hi Tom,

i'm stuck with the error end-of-file on communication channel.

what i did i copied database from one machine and put all the files with the same structure and drives.
but when i'm trying to connect through sqlplus it is giving me the above error. i checked the services it's runing ||||

i tried to create fresh database on different drive but the error is same..

i'd create the password file through orapwd utility also but not of used.

Regards
Rahul Chaudhari


Tom Kyte
July 12, 2005 - 4:36 pm UTC

you don't give your step by steps (you have to create the service using oradim for example) so no answers.

but -- did you just follow your procedures you should already have in place and tested for restoring a database to a new host for when the old system blows up? Those steps will do it.

end-of-file on communication channel

A reader, November 23, 2011 - 9:07 pm UTC

I met 03113 with a query, as you suggested i went to alert log for detail but due to my pure knowledge,i can not tell anything from the error in alert.log, it is beyond my understanding, could you please kindly elaborate more on this case?

Below is backgroud:

purpose:
for a given ID who has more than 1 different price, get all distinct price, and just randomly choose a value for any other columns

input:
ID PRICE SYSID
---------- ---------- ----------
10 1000 1
10 1000 2
20 2000 3
20 2500 4
30 1000 5
30 1000 6
30 1500 7
40 1000 8
40 1000 9
40 1500 10
40 1500 11
50 2000 12
50 2500 13
50 3000 14

output:
ID PRICE SYSID
---------- ---------- ----------
20 2000 3
20 2500 4
30 1000 6
30 1500 7
40 1000 9
40 1500 11
50 2000 12
50 2500 13
50 3000 14

sql for preparation:
create table PRICE
(
ID VARCHAR2(10),
PRICE NUMBER,
SYSID VARCHAR2(10)
);
insert into price (ID, PRICE, SYSID)values ('10', 1000, '1');
insert into price (ID, PRICE, SYSID)values ('10', 1000, '2');
insert into price (ID, PRICE, SYSID)values ('20', 2000, '3');
insert into price (ID, PRICE, SYSID)values ('20', 2500, '4');
insert into price (ID, PRICE, SYSID)values ('30', 1000, '5');
insert into price (ID, PRICE, SYSID)values ('30', 1000, '6');
insert into price (ID, PRICE, SYSID)values ('30', 1500, '7');
insert into price (ID, PRICE, SYSID)values ('40', 1000, '8');
insert into price (ID, PRICE, SYSID)values ('40', 1000, '9');
insert into price (ID, PRICE, SYSID)values ('40', 1500, '10');
insert into price (ID, PRICE, SYSID)values ('40', 1500, '11');
insert into price (ID, PRICE, SYSID)values ('50', 2000, '12');
insert into price (ID, PRICE, SYSID)values ('50', 2500, '13');
insert into price (ID, PRICE, SYSID)values ('50', 3000, '14');
commit;


my bad query who cause 03113:
with tmp as (select * from price where rowid in (select max(rowid) from price group by id, price)),
tmp1 as (select id from tmp group by id having count(distinct price)>=2)
select b.* from tmp1 a, tmp b where a.id=b.id;

my relatively good:) query which got expected result:
with tmp as (select * from price where rowid in (select max(rowid) from price group by id, price)),
tmp1 as (select id from tmp group by id having count(distinct price)>=2)
select b.*
from tmp1 a,
(select * from price where rowid in (select max(rowid) from price group by id, price)) b
where a.id=b.id order by b.id,b.price;


So i am thinking it is due to those 2 tmporary tables in 'with' are refered interchangely and joined together, which might result in endless loop or something else. But can not quite sure about how ORACLE handle this kind of 'with' query and why cause 03113 error. Thanks very much

Tom Kyte
November 28, 2011 - 8:55 am UTC

ops$tkyte%ORA11GR2> with tmp as (select * from price where rowid in (select max(rowid) from price
  2  group by id, price)),
  3  tmp1 as (select id from tmp group by id having count(distinct price)>=2)
  4  select b.* from tmp1 a, tmp b where a.id=b.id;

ID              PRICE SYSID
---------- ---------- ----------
20               2000 3
20               2500 4
30               1000 6
30               1500 7
40               1000 9
40               1500 11
50               2000 12
50               2500 13
50               3000 14

9 rows selected.



I cannot reproduce. The stuff I pointed you to - in the alert/trace areas - isn't for you - it is for support to diagnose what happened. You'll want to open a SR with support on this.




However - I will say that your query is very very very suspect, I cannot imagine the use of it.

consider:

ops$tkyte%ORA11GR2> with tmp as (select * from price where rowid in (select max(rowid) from price
  2  group by id, price)),
  3  tmp1 as (select id from tmp group by id having count(distinct price)>=2)
  4  select b.* from tmp1 a, tmp b where a.id=b.id;

ID              PRICE SYSID
---------- ---------- ----------
20               2000 3
20               2500 4
30               1000 6
30               1500 7
40               1000 9
40               1500 11
50               2000 12
50               2500 13
50               3000 14

9 rows selected.

ops$tkyte%ORA11GR2> 
ops$tkyte%ORA11GR2> create table price2 as select * from price order by to_number(sysid) desc;

Table created.

ops$tkyte%ORA11GR2> 
ops$tkyte%ORA11GR2> with tmp as (select * from price2 where rowid in (select max(rowid) from price2
  2  group by id, price)),
  3  tmp1 as (select id from tmp group by id having count(distinct price)>=2)
  4  select b.* from tmp1 a, tmp b where a.id=b.id;

ID              PRICE SYSID
---------- ---------- ----------
50               3000 14
50               2500 13
50               2000 12
40               1500 10
40               1000 8
30               1500 7
30               1000 5
20               2500 4
20               2000 3

9 rows selected.



Just by changing the order of the rows on disk - I changed the answer (look at id=40, price=1000)

This is a very scary query - what are you really trying to achieve? What is the question you are trying to answer with this query?

more explanation on this scary query

A reader, November 28, 2011 - 8:40 pm UTC

thx very much for your response.
good to hear you can not reproduce it, it prove my bad query at least can function and get what i want.
Actually either of your result meet my requirement.

exceptation: for a given ID who have more than 1 different prices, want to get id, associated different prices and sysid(do not care which value for this column is choose, juse choose one is ok)

Let me explain my query in a step by step basis
1> select * from price where rowid in (select max(rowid) from price group by id, price)
--a result without duplicated rows in terms of id+price

2> select id from tmp group by id having count(distinct price)>=2
--from above result, get the id list who have more than 1 different prices

3> select b.* from tmp1 a, tmp b where a.id=b.id;
-- join it above two results together and get my expected result


Tom Kyte
November 29, 2011 - 11:37 am UTC

(do not care which value for this
column is choose, juse choose one is ok)


as long as that is true - as long as it doesn't matter that given the same exact data in the same exact table - the answer could be different - then you are OK.