SECONDS_IN_WAIT column of v$session in 10gr2!!
Hi, all.
Recently, I have found the unbelievale value for SECONDS_IN_WAIT in v$session view. The database is 10.2.0.2.0.
select sid, wait_time, seconds_in_waits,wait_class, event,state from v$session;
SID WAIT_TIME SECONDS_IN_WAITS WAIT_CLASS EVENT
500 0 117874 Cluster gc buffer busy WAITING
In the above example, session 500 is waiting for something for 117874 seconds.
117874 seconds is 32.7 hours(117874/60/60).
Thus, session 500 is waiting for 32.7 hours.
The unit of SECONDS_IN_WAITS column is really "seconds"????
http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2088.htm#REFRN30223
Thanks and Regards.
Hi, yes the metric is on seconds, you must review the definition for this field on the view, look this.
<br>
<br>
If WAIT_TIME = 0, then SECONDS_IN_WAIT is the seconds spent in the current wait condition.
<br>
<b>
If WAIT_TIME > 0, then SECONDS_IN_WAIT is the seconds since the start of the last wait, and SECONDS_IN_WAIT - WAIT_TIME / 100 is the active seconds since the last wait ended.
</b>
<br>
<br>
<br>
Regards.
<br>
Similar Messages
-
COMMAND column in V$SESSION table
Is there any table which stores all the meaning of various values that can be stored in COMMAND column of V$SESSION table
Like 3 is for SELECT and 47 for Execute, I found some documentation in data dictionary but was wondering if there is some table that can be used when a trigger or procedure is running to pull the values on the fly.
ThxYou can find the various values for V$SESSION.COMMAND in Table 7-5 COMMAND Column of V$SESSION and Corresponding Commands found in the link below to build your own table.
http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2088.htm#sthref3985 -
COMMAND column in V$SESSION just show s SELECT
Hi,
i queried command column in v$session, but it shows only 3(which is for SELECT) and 0 (which is for unknown), even i update some thing its not shown.
ThanksHi Pavan,
following is the list for that
Number Command Number Command
1 CREATE TABLE 2 INSERT
3 SELECT 4 CREATE CLUSTER
5 ALTER CLUSTER 6 UPDATE
7 DELETE 8 DROP CLUSTER
9 CREATE INDEX 10 DROP INDEX
11 ALTER INDEX 12 DROP TABLE
13 CREATE SEQUENCE 14 ALTER SEQUENCE
15 ALTER TABLE 16 DROP SEQUENCE
17 GRANT OBJECT 18 REVOKE OBJECT
19 CREATE SYNONYM 20 DROP SYNONYM
21 CREATE VIEW 22 DROP VIEW
23 VALIDATE INDEX 24 CREATE PROCEDURE
25 ALTER PROCEDURE 26 LOCK
27 NO-OP 28 RENAME
29 COMMENT 30 AUDIT OBJECT
31 NOAUDIT OBJECT 32 CREATE DATABASE LINK
33 DROP DATABASE LINK 34 CREATE DATABASE
35 ALTER DATABASE 36 CREATE ROLLBACK SEG
37 ALTER ROLLBACK SEG 38 DROP ROLLBACK SEG
39 CREATE TABLESPACE 40 ALTER TABLESPACE
41 DROP TABLESPACE 42 ALTER SESSION
43 ALTER USER 44 COMMIT
45 ROLLBACK 46 SAVEPOINT
47 PL/SQL EXECUTE 48 SET TRANSACTION
49 ALTER SYSTEM 50 EXPLAIN
51 CREATE USER 52 CREATE ROLE
53 DROP USER 54 DROP ROLE
55 SET ROLE 56 CREATE SCHEMA
57 CREATE CONTROL FILE 59 CREATE TRIGGER
60 ALTER TRIGGER 61 DROP TRIGGER
62 ANALYZE TABLE 63 ANALYZE INDEX
64 ANALYZE CLUSTER 65 CREATE PROFILE
66 DROP PROFILE 67 ALTER PROFILE
68 DROP PROCEDURE 70 ALTER RESOURCE COST
71 CREATE MATERIALIZED VIEW LOG 72 ALTER MATERIALIZED VIEW LOG
73 DROP MATERIALIZED VIEW LOG 74 CREATE MATERIALIZED VIEW
75 ALTER MATERIALIZED VIEW 76 DROP MATERIALIZED VIEW
77 CREATE TYPE 78 DROP TYPE
79 ALTER ROLE 80 ALTER TYPE
81 CREATE TYPE BODY 82 ALTER TYPE BODY
83 DROP TYPE BODY 84 DROP LIBRARY
85 TRUNCATE TABLE 86 TRUNCATE CLUSTER
91 CREATE FUNCTION 92 ALTER FUNCTION
93 DROP FUNCTION 94 CREATE PACKAGE
95 ALTER PACKAGE 96 DROP PACKAGE
97 CREATE PACKAGE BODY 98 ALTER PACKAGE BODY
99 DROP PACKAGE BODY 100 LOGON
101 LOGOFF 102 LOGOFF BY CLEANUP
103 SESSION REC 104 SYSTEM AUDIT
105 SYSTEM NOAUDIT 106 AUDIT DEFAULT
107 NOAUDIT DEFAULT 108 SYSTEM GRANT
109 SYSTEM REVOKE 110 CREATE PUBLIC SYNONYM
111 DROP PUBLIC SYNONYM 112 CREATE PUBLIC DATABASE LINK
113 DROP PUBLIC DATABASE LINK 114 GRANT ROLE
115 REVOKE ROLE 116 EXECUTE PROCEDURE
117 USER COMMENT 118 ENABLE TRIGGER
119 DISABLE TRIGGER 120 ENABLE ALL TRIGGERS
121 DISABLE ALL TRIGGERS 122 NETWORK ERROR
123 EXECUTE TYPE 157 CREATE DIRECTORY
158 DROP DIRECTORY 159 CREATE LIBRARY
160 CREATE JAVA 161 ALTER JAVA
162 DROP JAVA 163 CREATE OPERATOR
164 CREATE INDEXTYPE 165 DROP INDEXTYPE
167 DROP OPERATOR 168 ASSOCIATE STATISTICS
169 DISASSOCIATE STATISTICS 170 CALL METHOD
171 CREATE SUMMARY 172 ALTER SUMMARY
173 DROP SUMMARY 174 CREATE DIMENSION
175 ALTER DIMENSION 176 DROP DIMENSION
177 CREATE CONTEXT 178 DROP CONTEXT
179 ALTER OUTLINE 180 CREATE OUTLINE
181 DROP OUTLINE 182 UPDATE INDEXES
183 ALTER OPERATOR -
How to enable AI(accent insensitiv) for one column without changing session
Following is my test SQL:
create table accent_test(col varchar2(10 char);
insert into accent_test values('INDIA');
insert into accent_test values('india');
insert into accent_test values('InDiÄ ');
Following SQL can only enable CI(Case insensitive), but can’t enable AI(accent insensitive):
select *
from accent_test
where NLS_UPPER(col, 'NLS_SORT=GENERIC_BASELETTER') LIKE NLS_UPPER('INDIA', 'NLS_SORT=GENERIC_BASELETTER')
COL
INDIA
india
Upper SQL can’t return the third row ‘InDiÄ’ which includes accent character.
I know following SQL can enable AI by changing the session. However it will change the whole session and other columns in one table:
SQL> ALTER SESSION SET NLS_COMP=LINGUISTIC;
SQL> ALTER SESSION SET NLS_SORT=GENERIC_BASELETTER;
Is there any solution to enable AI for only one column without changing the session?convert(<Any Chinese Character>, 'US7ASCII') will all return same character '?'.might be an matter of using the right characterset:
SQL> select 'ä' str, convert('ä', 'JA16SJIS') converted_str from dual union all
select 'á', convert('á', 'JA16SJIS') from dual union all
select 'â', convert('â', 'JA16SJIS') from dual union all
select 'à', convert('à', 'JA16SJIS') from dual
STR CONVERTED_STR
ä a
á a
â a
à a
4 rows selected. -
About the last_call_et column in v$session
Hello,
Can someone help me about a behaviour that is very strange ...
We have connection about SAS on a database which manipulate Oracle table and others SAS Structure.
The query is a "join" about that table and a "SAS Table" between million of lines in the Oracle table one ....
It last a long time ....
During the query, we have time to see at the v$session table...
At any time (it lasts 3h), we saw that the column 'last_call_et' of the v$session never change : it continuesly stay at 0.
What does it mean ? it means that SAS send a query every second ? Or this column shows the last "internal call"?
If this is the right reason, i would'nt understand why, when i take the same query( launched by SAS) in TOAD, there is no the same behaviour and this behaviuor is in that case the right behaviour : the session is ACTIVE but the last_call_et respresents really the time since i launched the query... So why when SAS do it, the last_call_et stay at 0 ? it works like SAS launch every second this query !!!!
Can someone help me ?
Thanks ...Jonathan Lewis wrote:
user12046632 wrote:
When you say :
A FETCH is a database call :
That means that it must affect the value of 'last_call_et' or not ?"A Fetch is a database call"
"last_call_et" -- certainly sounds like that could be something to do with database calls, perhaps End Time of LAST database CALL.
A parse is also a database call, as is an execute ... I feel that perhaps I was a little too concise with my description. You asked why SAS could be doing lots of calls (although that wasn't exactly how you put the question) and I replied that calls could include fetches. And yes, the last_call_et is reset on every fetch (amongst other things - and ignoring the special behaviour of background processes).Ok
>
(accordint to me, only to user's activity do so and not to "database internal callsl") ! isn't it ?You don't want to believe everything you read on the internet - even if it did come from the online manuals. But a "fetch" is not a "database internal call" anyway, it's a call from a client to the server.Be sure that i don't do so.
But the explanation of Oracle of the term 'cal' is not so precise at all ...
>
Your follonwing explanations seems to answers contrarily ....
But the question is there : what sort of call affetcs the value of "last_call_et"All database calls - which you should read as "all calls from the client to the server".Ok
>
>>
>>
When you say
all_rows plan => parse call, execute call ..... with very long call time, lots of fetch calls
first_rows_n plan => parse call, execute call ... with very short call time, lots of fetch calls
In the first case you would see last_call_et constantly growing until the fetches started
In the second case last_call_et would keep resetting to zero so fast you probably wouldn't see it as a non-zero value.
I don't understand : ok for the conséquences on the timing ... but if there are a lot of fetch call in both cases : the behaviour on the 'last_call_et' has to be equal ?True - but in one case I've included an execute call that is active for a very long time, and in the other I've proposed an execute call that is active for a very short time. (And execute calls are calls, and I did ask you about the exact details of your observations.)Ok
If we consider that every call reset to 0 the value of 'last_call_et',
why, in the case of launching the same request by TOAD, shouldn't i see the reset to 0 when the fetches works (because in TOAD during the whole query, which means since the click on "launching query" to the retrieving of data, the value did not reset to 0) ?
>
>>
When you say
Having said that, I've just run a quick test in SQL*Plus on 11.1.0.6 and 10.2.0.3 to demonstrate this point, and 11g is behaving differently from 10g - in the case where the last_call_et should be growing it stays at zero.
"in the case" : in the case of the v11 or the v10 ?11g
In my case : i'am on a v10.2.0.3 ::: Is there a bug ?Not that I know of.ok. So it is in V11 that you have an incorrect behaviour ....
>>
>
Regards
Jonathan LewisLAST NEWS : we have relaunched the query in SAS and observed that we have the same context of plan in both cases (by SAS en y TOAD) : ALL_ROWS.
Very strange ...
Last question :
Just to be sure : When you talk about "First Rows plan" : it means that the retrieve data are restricted to the first rows encountered
or
it is just the plan of the query which is in "that context" which means that the engine works so although the whole data are retrieved ....
thanks for your return -
Sort by columns once per session
Hi there, I am using apex 3.1 and I have a report generated by a pl/sql function. There are several columns on which the user might sort. Is it possible to reset the sorting preferences when the user logs in? (like: a process running once per session?)
thx in advance
Edited by: 814932 on 23-Nov-2010 08:00You can use the <tt>apex_util.remove_sort_preferences</tt> method (although it is a bit of a blunt instrument). See the Admin guide for more information on user preferences.
To run it once per session, code the call as an Application Process with execution point On New Session After Authentication. -
Module column of v$session
Hi:
Is this the right column to see what's the name of the program a
user is running? Why most of them are blanks? Can I assign a
value to this column? What should I do if I want this column to
show the name of self-developed applications? Thanks.
MM
nullMichael,
Use the plsql package dbms_application_info to set this:
dbms_application_info.set_module( 'module_name','action_name' );
or
dbms_application_info.set_action( 'action_name' );
These will set those columns.
You may have to load 'dbmsutil.sql' as SYS. Ask your DBA.
Michael Mou (guest) wrote:
: Hi:
: Is this the right column to see what's the name of the program
a
: user is running? Why most of them are blanks? Can I assign a
: value to this column? What should I do if I want this column to
: show the name of self-developed applications? Thanks.
: MM
null -
BLOCKING_SESSION column of v$session in 10g
Hi. all.
http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2088.htm#REFRN30223
what does BLOCKING_SESSION column mean?
For example,
SID Blocking_session
500 400
In the above case,
SID 400 is blocking SID 500 ?
or
SID 500 is blocking SID 400?
Thanks and Regards.Dear Yas.
Thanks for your confirmation.
Best Regards. -
V_$Session column program too small.
I'm tring to find the program executed in a given session using the PROGRAM column in V_$SESSION (Oracle 8.1.7) however I can't because the column length seems 48 chacacters wide and that's not enough with a long path like "C:\somewhere......".
Then the column value is truncated.
Is there any workaround ?
Tks
TullioYou can see from v$fixed_view_definition that the gv$session and v$session views directly reflect the undelying value in x$ksuse. Hence I suspect there is no way to get a longer text for the os program.
-
How can a session have an ACTIVE status with a WAITING state
Hi all,
I would like to know the difference between status and state of a session ?
The documentation says :
for status ACTIVE : Session currently executing SQL
for state WAITING : The session is currently waiting...
How can a session execute a SQL statement and be waiting at the same time ?
Regards,
fcjunic.Hi fcjunic,
It's really not paradoxical, once you understand the definition of the terms.
First, we have V$SESSION.STATUS, which can be ACTIVE or INACTIVE. A session is ACTIVE if it's in a database call. So, think of this from the client side point of view. A session does a parse call, or an execute call, or a fetch call, etc. For the duration of that call, till control returns back to the client, that session is said to be ACTIVE.
From the time the calls returns, till the time of the next call, the session is INACTIVE.
Next, we have V$SESSION.STATE. This is probably more useful to think of from the server process point of view. This refers to whether the server process is currently running, i.e. on the CPU, or WAITING, i.e., waiting on a resource. Possible values for this column are WAITING, WAITED KNOWN TIME, WAITED SHORT TIME, and WAITED UNKNOWN TIME. Of those possibilities, a session is only actually waiting if STATE is WAITING. All the other values mean that it's no longer waiting, but is running on CPU.
A session w/ STATUS of INACTIVE, will always be in STATE of WAITING, waiting on the 'SQL*NET message from client' wait. So, in that case, it means the server process is waiting around for work to do. It's in between calls, so, STATUS is INACTIVE, and it's waiting on that network port, to receive the next call from the client.
An example of a session that's ACTIVE and has STATE of WAITING, would be a session that's, for example, doing a full table scan. So, it's got lots of data to read from disk. While the session waits for the read from disk to complete, the session waits on 'db file scattered read'.
Finally, for completeness, the difference between the different possible values of the STATE column. I already covered WAITING. If a session is not waiting, it's now on CPU, and it previously waited. If so, it either waited more than 10 ms, in which case it will report WAITED KNOWN TIME, or less than 10 ms, in which case it reports WAITED SHORT TIME, or timed_statistics is false, in which case this column will always be WAITED UNKNOWN TIME. Also, it's important to pay attention to this column, when trying to interpret the WAIT_TIME and SECONDS_IN_WAIT columns.
See here:
http://download.oracle.com/docs/cd/E11882_01/server.112/e10820/dynviews_3016.htm#REFRN30223
for more information.
Hope that helps,
-Mark -
Hi,
I kill a session with the commands:
select username, sid, serial#, status from v$session where username like 'RION%'
alter system kill session 'sid, serial#'
and if I give again the first select command at the status column appears KILLED. I want not to have KILLED in the status column.
Thank you,
Mihaelahi all,
As u know you are seeing the status of at v$session view as killed, I wanna confirm that this will exists in two senario.
When a Session is in inactive state and a kill command on that session is issued then the "status" column of v$session will be updated as killed as to indicate/mark as it is killed, and the "server " column will be updated as psuedo. when the user again try to connect to the session user will receive 0ra-00028 error and the entry will be removed from v$session.
Another senario is that the transaction is at its half way, either in commiting or at the roleback stage for that partucular session then also you can find that the v$table is updated as above.
more information, go through the documentation, at the Server Process handling section.
i hope it cleared your confussion, -
Status inactive in v$session
on what basis, session is shown as inactive in the status column of v$session..
am connected through toad and execute so many queries, but still my session is shows as inactive ..
can anyone shed some lite on this ?
KaiMark,
DB:11.1.0.6
O/S:Win XP Proff
This is the output that I got from V$session which has got one user ,Aman connected and ran a long query which took sufficiently good amount of time to get complete.
SQL> /
STATUS USERNAME
ACTIVE
ACTIVE
ACTIVE
ACTIVE
ACTIVE
ACTIVE
ACTIVE
ACTIVE
ACTIVE
ACTIVE
ACTIVE
STATUS USERNAME
ACTIVE
ACTIVE
ACTIVE
ACTIVE
ACTIVE
ACTIVE
ACTIVE SYS
ACTIVE
ACTIVE
ACTIVE
ACTIVE
STATUS USERNAME
ACTIVE
INACTIVE AMAN
24 rows selected.
SQL> /
STATUS USERNAME
ACTIVE
ACTIVE
ACTIVE
ACTIVE
ACTIVE
ACTIVE
ACTIVE
ACTIVE
ACTIVE
ACTIVE
ACTIVE
STATUS USERNAME
ACTIVE
ACTIVE
ACTIVE
ACTIVE
ACTIVE
ACTIVE SYS
ACTIVE
ACTIVE
ACTIVE
ACTIVE
ACTIVE
STATUS USERNAME
INACTIVE AMAN
23 rows selected.
SQL> select status,username,last_call_e from v$session;
select status,username,last_call_e from v$session
ERROR at line 1:
ORA-00904: "LAST_CALL_E": invalid identifier
SQL> select status,username,last_call_et from v$session;
STATUS USERNAME LAST_CALL_ET
ACTIVE 8
ACTIVE 5124
ACTIVE 5392
ACTIVE 5392
ACTIVE 5402
ACTIVE 5406
ACTIVE 5406
ACTIVE 2399
ACTIVE 5430
ACTIVE 5430
ACTIVE 5430
STATUS USERNAME LAST_CALL_ET
ACTIVE 5430
ACTIVE 5430
ACTIVE 5430
ACTIVE 5430
ACTIVE 5430
ACTIVE 5430
ACTIVE SYS 0
ACTIVE 5430
ACTIVE 5430
ACTIVE 5430
ACTIVE 5436
STATUS USERNAME LAST_CALL_ET
ACTIVE 5436
INACTIVE AMAN 36
24 rows selected.
SQL>I guess,you must have noticed too.There is one session which gets added and removed on its own. I am getting 23 rows and than 24 ,the second last one becomes an active session but my session,Aman's,remains inactive only. The last_call_et column is also shown which according to docs,is showing time period of staying inactive. Interstingly, I couldn't make my user's status changed to Active. My best guess is that it might have become active when the call was submitted but after that it has become inactive again.I surely can be wrong but just wanted to share my thought.If you can explain the behaviour in more detail,it will be great.
Regards
Aman.... -
How to trace other user's session?
Dear Experts,
I would like to trace other user's session, I am on Oracle 10g R2 (10.2.0.4) on a Windows box. I did search on google and found tons of articles explaining about tracing techniques. But unfortunately, trace file is not getting generated in my case. Below are the steps I am following:
SQL> conn /as sysdba
Connected.
SQL>
SQL> select sid, serial# from v$session where username = 'TEST';
SID SERIAL#
38 17
SQL> show parameter user_d
NAME TYPE VALUE
user_dump_dest string C:\DB10G\UDUMP
SQL> show parameter timed_s
NAME TYPE VALUE
timed_statistics boolean TRUE
SQL>Connect a new SQL*Plus session as TEST and then
SQL> show user
USER is "SYS"
SQL>
SQL> select sid, serial# from v$session where username = 'TEST';
SID SERIAL#
19 24465
38 17
SQL> exec dbms_system.set_ev(38,17, 10046, 12, '');
PL/SQL procedure successfully completed.
SQL> exec dbms_system.set_ev(38,17, 10046, 0, '');
PL/SQL procedure successfully completed.
SQL> grant execute on dbms_system to test;
Grant succeeded.
SQL> exec dbms_system.set_ev(38,17, 10046, 12, '');
PL/SQL procedure successfully completed.in the new session (TEST):
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
T TABLE
T3 TABLE
T1 TABLE
T2 TABLE
MYEMP TABLE
SQL>Yet, no trace file is generated in "C:\db10g\udump" folder.
C:\db10g\udump>dir
Volume in drive C is SYSTEM
Volume Serial Number is AC21-0462
Directory of C:\db10g\udump
12/15/2008 12:36 PM <DIR> .
12/15/2008 12:36 PM <DIR> ..
0 File(s) 0 bytes
2 Dir(s) 9,891,508,224 bytes free
C:\db10g\udump>Your help/advice in this regard will be very helpful.
RegardsYou must be using shared server.
You can verify this by referring to the SERVER column of v$session.
In shared server several servers will execute your code, so that's why you don't find a trace file.
The method described in this article should work in your case also:
http://technology.amis.nl/blog/1794/how-to-trace-a-java-application-through-a-connection-pool-using-dbms_monitor-6
Hth
Sybrand Bakker
Senior Oracle DBA -
(oracle 10.2) Access to v$session from pl/sql code
Hello,
I wonder if anybody can help me with the following problem as I have read some previous posts on similar topics but could not come to a solution so far.
The problem is simple: I need to select some columns form v$session from within a PL/SQL body in oracle 10.2.
Now, the "Application Developer's Guide - Fundamentals" reads:
"The owner of the procedure or package must be explicitly granted
the necessary object privileges for all objects referenced within the
body of the code."
However, if I connect sys as sysdba and run "grant select on v$session to <proc owner>" I will get "ORA-02030: can only select from fixed tables/views".
Any hint about this?
Thank you in advance.There is nothing wrong with your instance, v$session is a public synonym for the "real" view v_$session. You cannot grant on a synonym, only on the underlying real object.
HTH
John -
How to change the Program in Oracle Session
When I create or use a JDBC connection, I want to set the value of something 'in' the connection so that it shows when I do a query like:
select SID, Program, Machine, Module, client_info
from v$session
For example, how do I set the 'Client_Info' column of v$session? Or the, 'Program' column?
Or can you do this in JDBC?
I am using the thing 8.1.x driver ( where x = 6, I think).
My server, is 8.1.7.4 on Solaris...
ThanksThanks a lot for your answer.
Do you know how to implement that when using the Oracle ADF framework?
JClient dynamic credentials and Struts/ADF => Application module with configuration file.
see thread (JDeveloper forum)
JClient 2Tiers/JDBC Security question
Regards
Fred
Maybe you are looking for
-
Planning File Entry in case of MD51
Hi, While we run MRP through MD51, Planning file entries are not getting updated. Means, In the planning file entries "X" indicator remains there. Actually it should be removed after MRP run. Is it a problem or standard behaviour? If it's SAP standar
-
How do I get an Installation Disc for Lion after I already installed it.
I am furious, with myself and Apple.... I started this journey of upgrading to Lion soley because I needed to increase the capacity of the HD on my early 2008 MBP. I saw that it was much easier with Lion, I didn't see or understand the part about onl
-
IPhone 4 won't turn on and unable to continue with your activation at this time
I have an iphone 4 which was working fine. I tried to update it but this time I used a computer running xp. When I did so I got an error. Since getting this error my iphone will not turn on. I am not even getting apple logo. It does show up in itunes
-
Problems with itunes syncing!!!!
Hi All, I have just updated my music library adding album art to all artists, yet when i sync with ipad, it doesnt update. Also I synced ipad so i should of only had one album on ipad, yet even though it only showed the one album on itunes, all the o
-
Keep up to date without money .
How can I keep this up to date without having to have money all the time ..... Do you have to pay for the up loads of apps.