Problem in DBLINK | More Inactive sessions
Hello All,
We are facing some problem in our environment due to db links between the applications
1. MYDB and TSTDB applications reside on two different DB’s.
2. MYDB has a db link to TSTDB to extract data from TSTDB.
3. There are lot of sessions created due to the db link.
4. Application doesn’t effectively close these links , hence a lot of inactive sessions are seen in the DB
5. The inactive sessions cause high cpu and makes the system go very slow.
6. only way we managed to remove the inactive sessions is by bouncing the db.
Can any one please help us is there any other way to resolve this..? Most of the time we could see lot of inactive sessions ...!!!
Also, If we reduce the job queue process will it help..?
Create profile and set appropriate resource parameters.
Assign this profile to user connected in db link.
Hope this helps.
Similar Messages
-
Hi,
We are facing a problem of lot of inactive sessions consuming huge resources. We have setup connection pooling from weblogic application and connection timout and resuse parameters have been setup from application side for connection pooling. And we still find high inactive sessions which are not getting released even after application user closes the session properly. What might be the work around for this as we facing this for last one week.
Oracle 10.2.0.3.0 on solaris box.
regards
JaffyJaffy wrote:
Hi,
We are facing a problem of lot of inactive sessions consuming huge resources. We have setup connection pooling from weblogic application and connection timout and resuse parameters have been setup from application side for connection pooling. And we still find high inactive sessions which are not getting released even after application user closes the session properly. What might be the work around for this as we facing this for last one week.
Oracle 10.2.0.3.0 on solaris box.
regards
JaffyHi Jaffy,i suggest you have to configure profile for oracle users.For example if you user will inactive 10 minute then can oracle automatically kill this session.For this you can create profile as:
create profile test_prof limit idle_time 10;
alter user <user> profile test_prof;
/*but first you need change resource limit*/
alter system set resource_limit=true; -
I have OC4j server running on one box and the oracle database
is on different server. We connect through JDBC.
It looks like the application server does not close inactive sessions.
Because of this temporary tablespace on database server gets filled
up. I tried increasing it 4g but the problem looks like
of inactive sessions.
How do I specify timeout period for inactivity?
I am using Oracle 9iAS Containers for J2ee (1.0.2.2.1)
How do I clean up inactive sessions/processes.
Satish JuwareYes,
I am talking about inactive data connections. My application does not
have any ejb module.It does have web module with servlets and JSPs.
We do not use JNDI or data-sources.xml file for specifying
username, SID, host:port to specify where database is.
Insted we code thise values iside a servlet called DBconnection.
IN that case should I still Specify inactivity timeout period
in data-sources.xml.
In the application code how do I make sure that connection is
closed.
Thanks !
Satish Juware
Hi Satish,
I assume the "session" you are referring to is what I refer to as
a database "connection".
If the OC4J debug messages are accurate and reliable, then OC4J does,
most definitely, close inactive database connections, after a certain
"timeout" period. You configure this in your "data-sources.xml" file.
Unfortunately I am not at work now, so I can't show you what mine
looks like, but I suggest you do a search for information regarding
the "data-sources.xml" file. I recommend searching the following URLs:
http://www.orionserver.com
http://www.orionsupport.com
http://www.atlassian.com
http://www.elephantwalker.com
Hope this helps you.
Good Luck,
Avi. -
Inactive sessions in v$session. True problem
Hi,
I am working in an Oracle 9i/Weblogic/J2EE platform. And when i look for session info in v$session view, i see that there are many sessions that have a status "Inactive". I already figured out what it means- the session is ACTIVE when it is doing an SQL query at the time and the session is INACTIVE when it is not doing an SQL query at that particular moment.
But i have questions:
1) If a client logs in to my webapplication and does a SQL query- then the sessions status is ACTIVE. After that, when the client just leaves (logs out just closes the browser) then Oracle marks that connection as 'INACTIVE'- Oracle does not KILL that session.
Ok let that be, but can another client then log in to my webapplication (from different computer) and get that same INACTIVE connection and start to use it?? If not, then these "abandoned" connection are truly useless, because they still use ORACLE resources (memory).
2)Another thing is that there are many INACTIVE sessions in v$session that have a name "plsqldev.exe" in PROGRAM column. That is a database client that i use to connect directly to my DB. But basicly i have only one PL/SQL program with one SQL query window open (this session is marked ACTIVE in v$session). So are these other 10 INACTIVE "plsqldev.exe" sessions meant for new plsql clients that may start to use the database or can only that particular user for whom the session was created at first place use that session?
And finally- sessions that are INACTIVE and have "plsqldev.exe" as a PROGRAM in v$session - is there any chance that a client logs in to webapplication and then gets that INACTIVE session?
If not, then these 10 INACTIVE plsqldev sessions (allthough the user has maybe shut down the program) are wasteless for webapplication users and they just starve the database.
Also a screenshot for illustration.
Waiting for your comments,
Thanks!If connection pooling is in use then yes a different end-user can reuse the "inactive" session. Remember that ACTIVE and INACTIVE really only refers to if the session is executing SQL at the exact moment you query v$session.
In the case of a dedicated user connection using a product like Oracle Forms where the user spends much of the time reading and filling in screen fields the Oracle background session can show INACTIVE almost constantly because the queries being ran by the user are very fast.
Take a look at the last_call_et column. This is the time in seconds from when the last SQL statement was issued (not completed). If this value is resetting then the queries are being done.
If the time is large and the status is INACTIVE then you could have a 'dead' or 'runaway' background process which is a background process without a front-end process. Those can and should be terminated. For that matter sessions that are idle for long periods of time should probably also be killed. If nothing else runaway and idle sessions may make it appear you are using all your licensed connections even if you really are not.
Most connection pools wil automatically restart a terminated connection so if you clean-up process terminates an idle pooled connection it should not be a problem.
HTH -- Mark D Powell -- -
Inactive sessions while using Iplanet server
Hi all,
I am facing a strange problem. On application level we use 'apps' user to login in oracle. It was working fine earlier. But now a days when we login thru it the performance becomes slow,when I checked the sessions, it shows me 250 inactive sessions.The max limit of sessions is 400.
Then I have to manually kill the inactive sessions and application starts working fine . Any idea about this problem?
Oracle version is 10g version 2
Thanx and regardsI am not very sure but there must be some property from which you can kill the inactive session which has taken more time.
Cheers -
AUTOMATICALLY KILL INACTIVE SESSIONS
Hi all. we are using oracle 8.1.6 on windows-2000 with 2gb ram. we facing
ora-12500 listner failed to start a dedicated server.
error and for this we made certain changes. we also added a parameter in sqlnet.ora at server side sqlnet.expire_time=10.. for automatically killing inactive sessions but it did not helped and many sessions remain in v$session. i wana know what should we do to kill inactive sessions. because i think when the sessions reach more than 300 then we face problem of listner failed. thanks for u'r valueable comments in advance as well.
best wishes
muhammad mohsin chatthaHi Nicolas, what you say is correct, but, unless the user try to do something (and receives an error),
those sessions will show up as SNIPED in V$SESSION, and never go away.
We can create a procedure to kill these sessions, something like this : 1 CREATE OR REPLACE PROCEDURE Kill_Sessions IS
2 Stmt VARCHAR2(200);
3 V_Sid VARCHAR2(30);
4 V_Serial VARCHAR2(30);
5 V_Username VARCHAR2(30);
6 CURSOR pri IS
7 SELECT Sid, Serial#, Username
8 FROM V$Session
9 WHERE Username Is Not Null
10 And Username not like 'SYS%'
11 And Status = 'SNIPED';
12 BEGIN
13 FOR usr in pri LOOP
14 V_Sid := usr.Sid;
15 V_Serial := Usr.Serial#;
16 Stmt := 'ALTER SYSTEM KILL SESSION ''' || V_Sid || ',' || V_Serial || '''';
17 Execute Immediate(Stmt);
18 END LOOP;
19* END;
20 / and execute it every minute (change 1440 to change the frequence) :SQL> Declare
2 Out_Var Int;
3 Begin
4 Dbms_Job.Submit(Out_Var,
5 'Kill_Sessions;',
6 Sysdate,
7 'Sysdate+1/1440' );
8* End;
SQL> /
PL/SQL procedure successfully completed.
SQL> commit;
Commit complete.
SQL> -
Inactive Sessions Getting Automatically Generated in Database
I am facing a strange problem of getting huge number of inactive sessions getting generated th the database server which leads to it's connection closure.
The Error reads as "Failed to check out an Application due to connection failure of Application Module."
This happens each time I execute the following code:
String amDefName = "amendprgo.model.CSDInvFRCAmendPrgoServices";
String configName = "CSDInvFRCAmendPrgoServicesLocal";
ApplicationModule app1 = Configuration.createRootApplicationModule(amDefName,configName) ;
String voInstanceName="prgoHdrRO";
ViewObject prgoHdrROVO =app1.createViewObjectFromQueryStmt(voInstanceName,"select * from INV_PRGO_HDR");
prgoHdrROVO.setWhereClause("PRGO_ID="+tempRow.getAttribute("PrgoId")+" and DEPOT_CD = '0' and ITEM_CAT = 'I3' ");
prgoHdrROVO.executeQuery();
if(prgoHdrROVO.getEstimatedRowCount()>0){
return true;
I know there is a process of creating connection and View Object in Model part in JDeveloper, but I want to know why this problem happens.ApplicationModule app1 = Configuration.createRootApplicationModule(amDefName,configName) ;is your problem as it causes at least one (sometimes more) connections to open. As you don't free the resource after using it the connection remains open even if you can't access it anymore.
You should call Configuration.releaseApplicationModule(...), with the application module you created before returning.
On the other side you shoulnd not even call createRootApplicationModule in the first place (as it causes trouble if you don't deeply know what the framework do with a root application module).
Can you tell us the use case which make you call createRootApplicationModule()? We might find a better solution.
Timo
Edited by: Timo Hahn on 19.05.2011 13:45
PS: something to read http://blogs.oracle.com/jdevotnharvest/entry/when_to_use_createrootapplicationmodule_in_oracle_adf and http://radio-weblogs.com/0118231/2009/08/20.html#a959 -
Problem with Frameset and page session
All,
I am having a problem with Framesets and page session attributes. I
have a client who's application uses a three frame frameset. They
have a requirement on several pages that when a button is pushed two
different pages load into the right and left frames. The way they
are accomplishing this is that on the pages were this is required,
they are adding target="_top" to the form declaration in their JSP.
Then they store the page names they want to display in session,
forward the request to the frameset, the frameset then determines
which pages to display based on the session variables. This works
exactly how they want it to.
Here is our problem. We need to store some information in page
session attributes. We have tried to get a handle to the desired
view bean and call the setPageSessionAttribute method. However,
since we are forwarding to the frame and the frame handles displaying
the desired JSP, that view bean we had the handle to is not the one
that is created to hand the display of the JSP.
The next thing I tried was to use the request object. In the
handleBtnRequest method, I set an attribute in the request object. I
then query the request object in the beginDisplay event of the view
bean. When the frame is reset the request object does not contain
the attribute that I have set. I'm confused by this because I
thought the request object would be available to me throughout the
life of the request.
Given the above information, does anyone have any suggestions? Also,
am I going about this in the wrong manner.
The client had been storing this information in user session, which
seemed to work. However, since the data being stored dealt
specifically with data for the requested page, we felt that storing
it as page session was more appropriate.
Thanks,The script on your page web page has some obvious bugs.. Best
fix those
first before looking to blame Flash.
Jeckyl -
PL/SQL procedure to kill inactive session
Hi all ,
Please i am trying to write a procedure to kill inactive sessions of the shema 'TESTSCHEMA' .This is my first procedure , am not use to pl/sql but i went through many turtorial but have some errors at compliation .when i try to compile the procedure the errors are as below :
15:50:28 Start Find Objects [TESTSCHEMA@TESTDB_UNIX(2)] ...
15:50:28 End Find Objects [TESTSCHEMA@ TESTDB_UNIX(2)]
15:50:32 Start Compiling 1 object(s) ...
15:50:32 Executing ALTER PROCEDURE fib_dead_cnx_cleanup COMPILE ...
15:50:32 [13:2] PL/SQL: ORA-00933: SQL command not properly ended
15:50:32 [9:3] PL/SQL: SQL Statement ignored
15:50:32 [18:12] PLS-00103: Encountered the symbol "(" when expecting one of the following:
15:50:32 constant exception <an identifier>
15:50:32 <a double-quoted delimited-identifier> table LONG_ double ref
15:50:32 char time timestamp interval date binary national character
15:50:32 nchar
15:50:32 The symbol "<an identifier>" was substituted for "(" to continue.
15:50:32 [18:21] PLS-00103: Encountered the symbol "LOOP" when expecting one of the following:
15:50:32 := ; not null default character
15:50:32 The symbol "; was inserted before "LOOP" to continue.
15:50:32 [27:8] PLS-00103: Encountered the symbol "ALTER" when expecting one of the following:
15:50:32 begin case declare exit for goto if loop mod null pragma
15:50:32 raise return select update while with <an identifier>
15:50:32 <a double-quoted delimited-identifier> <a bind variable> <<
15:50:32 close current delete fetch lock insert open rollback
15:50:32 savepoint set sql execute commit forall merge pipe
15:50:32 Compilation complete - 5 error(s) found
15:50:32 End Compiling 1 object(s)
below is the procedure code :
CREATE OR REPLACE
PROCEDURE fib_dead_cnx_cleanup
AS
l_serial CHAR(100);
l_sid CHAR (100);
l_sid_serial CHAR(100);
l_count NUMBER(10,0);
CURSOR session_cur IS
SELECT sid,serial#,sid||','||serial# as sid_serial
FROM v$session
WHERE username='EBBFCAT' and schemaname='TESTSCHEMA'
and status='INACTIVE'
BEGIN
BEGIN
l_count := 0;
OPEN session_cur;
WHILE ( 1 = 1) LOOP
BEGIN
FETCH session_cur INTO l_sid ,l_serial,l_sid_serial ;
EXIT WHEN session_cur%NOTFOUND ;
BEGIN
alter system kill session 'l_sid_serial' ;
END;
END;
END;
CLOSE session_cur;
END;
END FIB_DEAD_CNX_CLEANUP;
ThanksHi,
Never write, let alone post, unformatted code.
When posting any formatted text on this site, type these 6 characters:
{code}
(small letters only, inside curly brackets) before and after sections of formatted text, to preserve spacing.
Among the benefits of formatting: you can indent to show the extent of blocks, such as BEGIN-END.
Different types of blocks need modifiers after the end, such as "END *IF* " and " END *LOOP* ". If each opening statement (BEGIN, IF, LOOP) is directly above its corresponding END, then it's easy to check if you got the right modifier.
Here's what you code looks like with some formatting, and a couple of corrections added. Look for -- comments.
CREATE OR REPLACE
PROCEDURE fib_dead_cnx_cleanup
AS
l_serial CHAR(100);
l_sid CHAR (100);
l_sid_serial CHAR(100);
l_count NUMBER(10,0);
CURSOR session_cur IS
SELECT sid
, serial#
, sid || ','
|| serial# as sid_serial
FROM v$session
WHERE username = 'EBBFCAT'
and schemaname = 'TESTSCHEMA'
and status = 'INACTIVE'; -- need semicolon here
BEGIN
BEGIN -- Why?
l_count := 0;
OPEN session_cur;
WHILE ( 1 = 1)
LOOP
BEGIN -- Why?
FETCH session_cur
INTO l_sid
, l_serial
, l_sid_serial ;
EXIT WHEN session_cur%NOTFOUND ;
BEGIN -- Why?
alter system kill session 'l_sid_serial' ; -- Not a PL/SQL command
END;
END;
END LOOP; -- LOOP ends with END LOOP
CLOSE session_cur;
END;
END FIB_DEAD_CNX_CLEANUP;Take baby steps.
I've been wrtiing PL/SQL for 20 years, and I would never write that much code at once. If you're a beginner, all the more reason to start small. Write as little as possible, test, debug and test again (if necessary). When you have someting working, add 2 or 3 more lines and test again.
It looks like you have three BEGIN statements that don't serve any purpose. You should get rid of them (and their corresponding END statements, of course).
One error I did not fix: ALTER SYSTEM is not a PL/SQL statement. It's a SQL statement. You can run a SQL statement inside PL/SQL by using dynamic SQL, where you construct a string containing the SQL statement, and then use dbms_sql or EXECUTE IMMEDIATE to run it.
Edited by: Frank Kulash on Aug 18, 2009 12:37 PM -
Inactive sessions increasing in database
Hi
Recently i migrated Oracle9i database to oracle10g database 64 bit on windows 2008 server.
After Migration.Inactive sessions are not automatically flushing from database,and these inactive sessions are reaching maximum sessions limits that leads to Database Hang.
How can i solve this inactive sessions problem?
Thanks
With Regards
OHdamorgan wrote:
desc sys.kottd$Interesting table and custom data type.
SQL> set long 9999
SQL> col SQL format a50
SQL>
SQL> select
2 DBMS_METADATA.get_ddl( 'TABLE', 'KOTTD$', 'SYS') as SQL
3 from dual;
SQL
CREATE TABLE "SYS"."KOTTD$" OF "SYS"."KOTTD"
OIDINDEX ( PCTFREE 10 INITRANS 2 MAXTRANS 255
STORAGE(INITIAL 65536 NEXT 1048576 MINEX
TENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFF
ER_POOL DEFAULT)
TABLESPACE "SYSTEM" )
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS
LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MA
XEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GRO
UPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "SYSTEM"
SQL>
SQL>
SQL> select
2 DBMS_METADATA.get_ddl( 'TYPE', 'KOTTD', 'SYS') as SQL
3 from dual;
ERROR:
ORA-31603: object "KOTTD" of type TYPE not found in schema "SYS"
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
ORA-06512: at "SYS.DBMS_METADATA", line 2805
ORA-06512: at "SYS.DBMS_METADATA", line 4333
ORA-06512: at line 1
no rows selected
SQL>
SQL> col attr_name format a30
SQL> col attr_type_name format a30
SQL> select
2 attr_no,
3 attr_name,
4 attr_type_name
5 from dba_type_attrs
6 where type_name = 'KOTTD'
7 and owner = 'SYS'
8 order by attr_no;
ATTR_NO ATTR_NAME ATTR_TYPE_NAME
1 KOTTDKVN UNSIGNED BINARY INTEGER(32)
2 KOTTDSCH VARCHAR2
3 KOTTDNAM VARCHAR2
4 KOTTDUVN VARCHAR2
5 KOTTDTC UNSIGNED BINARY INTEGER(16)
6 KOTTDTDS CANONICAL
7 KOTTDNDS CANONICAL
8 KOTTDFLG UNSIGNED BINARY INTEGER(16)
9 KOTDVSN UNSIGNED BINARY INTEGER(16)
10 KOTTDBDY KOTTB
10 rows selected.
SQL> -- not even a varchar2 attr of the data type "accessible"
SQL> select KOTTDNAM from sys.kottd$ where rownum < 11;
select KOTTDNAM from sys.kottd$ where rownum < 11
ERROR at line 1:
ORA-00904: "KOTTDNAM": invalid identifier
SQL> -- Calling the constructor? Oracle no likes..
SQL> select KOTTD( null, 'test','test','test',null,null,null,null,null,null) from dual;
select KOTTD( null, 'test','test','test',null,null,null,null,null,null) from dual
ERROR at line 1:
ORA-00600: internal error code, arguments: [qctcte1], [0], [], [], [], [], [], []
SQL> -
Inactive sessions increasing database
Hi
We are using oracle11.5.10.2 on windows 2000 server and database version 10.2.0.3
we are facing problem with inactive sessions,grdually inactive sessions increasing and thats leads database crash.
Temporary i increased processes parameter value tp 400 prviously it was 200
Most of inactive session from apps user only
How can i fix this problem?
Thanks
With Regards
OHHi,
Please see these threads.
how to kill inactive sessions????????
how to kill inactive sessions????????
Inactive sessions in Database
Re: Inactive sessions in Database
Regards,
Hussein -
Inactive sessions of oracle consume resources?
We Red Hat and Data Base Oracle 10g.
Gracias y saludos.Please define 'inactive session'.
I see several possible definitions. A few of the more likely include:
- a session that is still connected to the end client, and therefore prepared to perform some work and therefore will consume resources
- a session that has been forcibly disconnected and is rolling back or waiting to roll back, and is therefore consuming resources
- a Linux or Unix zombie session, which may still hold memory but no CPU cycles
Depending on the tools used to report the information, the SGA memory may be reported again and again for each session's process. This can cause some alarming interpretations. -
1. 9.2.0.4 - 64bit (MTS) (DB-A)
2. 10.2.0.2.0 - 64 bit (DB-B)
3. 10.2.0.2.0 - 64 bit (DB-C)
We are having a process which starts with a trigger on a table in DB-A,
The code in Trigger calls to a procedure which inturn access tables of user X
in DB-C through DB link, and a procedure of user Y in DB-B through DB-Link
connecting to user Z in DB-B.
While doing this process some of the sessions originated from DB-A to DB-B and
DB-C becomes Inactive and the number of Inactive sessions keep growing
consuming memory.
Thanks
JDHi,
>>becomes Inactive...
Maybe you should investigate and query the V$SESSION_WAIT view in order to displays the events for which these inactive sessions have just completed waiting or are currently waiting. The other view V$SYSTEM_EVENT displays the total number of times all the sessions have waited for the events in that view.
Take a look on this doc below for more information:
Oracle Wait Events
http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14237/waitevents.htm#REFRN101
Cheers -
Disconnection leaves inactive sessions
Hi I am new to this forum, I have looked but cannot find any reference to my problem, apologies if it has been discussed earlier.
When in SQLDev (EA2 and also earlier versions) on windows2000prof v5 sp4, when I disconnect from a connection inactive sessions are still on the DB (9i r2), this for reasons I won't go into here causes us problems. We have to save all our work and exit sqldev then restart to ensure connections disappear.
I assume this is so connections are reused if you reconnect, and on the face of it seems reasonable, however, it is a problem for us.
Is there some config I can do to stop this behaviour either by connection or for all connections ?
Help appreciated.
btw really like this product, EA2 now has support for AQ's and Materialised views which we use ( we have now decided not to renew TOAD licences because sqldev seems to be mature enough for our purposes now - and is cheaper :-) )
Message was edited by:
CharlieColsonMany thanks for your reply.
I am not doing anything special, it must be designed behaviour because as soon as I exit sqldev the sessions are gone :-
open a connection
run some sql in a worksheet, close worksheet
disconnect from the connection using the connection tree
inactive sessions remain on the database, one for connection and one for insight.
I was hoping that there is some java/config/connection setting I could use, it dosen't happen from TOAD so I can't think it is server behaviour ( and neither does my DBA ).
Cheers -
Within AMserver console --> Sessions, I can view a list of active/inactive sessions. Is there a configuration that will remove all sessions that are inactive? The list does not clear invalid sessions automatically.
I have the same problem! Is there any solution ?
Maybe you are looking for
-
Batch Job not Generating Spool No
Hi Experts, We had a custom program where we are printing multiple invoice in a single go i.e all invoices for a particular sales office are printed in a single spool request. for foreground execution it is running fine. But after creating variant of
-
Database schema synchronization
Hello, i am going to maintain any machines with maxdb and synchronization in production, but i am still changing applicacion schema because i am still in development so i will need to be able to change the database schema to the machines in productio
-
Eliminating "same-plant" movements in Query Designer
Hi all, We have extended the standard BC InfoCube (0IC_C03) to include the Issuing/Receiving Plant characteristic. Now in our some of our queries we want to perform calculations like Total Receipt last 3 months per Plant, but we want to exclude "same
-
Create/Manage WF approval - Admin Console
Hi Gurus, OIM 9.1.0.2 I have an user group in the OIM that need only be able to create/manage resource's approval workflow thru Admin Console. (Resource Management / Manage / Select Resource Name - Resource Detail - Resource Workflow) I have already
-
MDT 2013 Server 2012 R2 Core Deployment Fails After Disabling ChecksumOffloads on NICs
When changes are made to the Checksum offloads, the NICs reset themselves and I'm losing connectivity to the deployment share during the deployment process (LiteTouch). It happens during a custom PowerShell script I'm running in the Task Sequence af