Can you please share the query you are running with us?
Please see if the queries in the following docs help.
What is the Relationship Between the ICX_SESSIONS Table and the FND_LOGINS Table? [ID 358823.1]
How to Count Total Number of Users Connected to ORACLE Application [ID 295206.1]
How to Track IP Address of the Form Session in Oracle application 11i [ID 878931.1]
11i: How To Identify the User for a Forms Session [ID 185762.1]
my problem solved by previous post
spid always was null because I didn't knew about Sign-On Audit Level profile option.
when I set this profile option to value except None my problem solved.
in addition, my goal for activating this is to find out who is online now and when I see an os pid consumes more resource than others,identify who is this user and what does he do,
so I prefer this profile option always set to Form
But please tell me is it correct to set it to FORM according to performance?
I mean that most of dba active this profile option always or it is better to set it only when need?
With an extra feature, you will have to incur some cost.
Without a doubt performance will be affected, but ultimately it is you who have to decide the gain and the loss factor. Being said that the level unto which the performance is affected will also be decided in several factors such as number of users, level of auditing to be performed, server capacity and etc.
As a DBA, its one of the options you would desire and I do also favor the respective profile but a small analysis should be made on the cost factors.
Also note, you will have to schedule "Purge sign-on data" program so that you may periodically purge of old sign on data. Please also refer links:
Hope this helps!