To trace the users connecting to database
Hi ,
can any body help me on tracing the users who are connected to a database at a particular period of time.?
thanks
soundar wrote:
these details on the audit where it gets recorded..?
it's in audit trail file in the same directory as background process trace files or some where else..?It depends on the setting. If it is set to DB then it will be sent to the SYS.AUD$ table. This table doesn't need to be accessed directly. You can use the DBA_AUDIT_TRAIL view to get a more friendly look at the audit information.
If it is set to OS it will go to the operating systems audit trail.
It may be worth it to look at the documentation :)
[Initialization Parameters: AUDIT_TRAIL|http://download.oracle.com/docs/cd/A84870_01/doc/server.816/a76961/ch111.htm]
Similar Messages
-
How to find the number of users connected to database from OS level(Linux)
Hi All,
Could anyone know , how to find the number of users connected to database without connecting with sql*plus
is there any command to find it?
example we have 10 databases in one server, how to find the number of users connected to particular database without connecting to database(v$session)?
oracle version:- 10g,11g
Operating System:- OEL4/OEL5/AIX/Solaris
any help will be appreciated.
Thanks in advance.
Thank you.
Regards,
Rajesh.Excellent.
Tested, works as long as you set the ORACLE_SID first ( to change databases )
ps -ef | grep $ORACLE_SID | grep "LOCAL=NO" | awk '{print $2}' | wc -l
Thanks!
select OSUSER
from V$SESSION
where AUDSID = SYS_CONTEXT('userenv','sessionid')
and rownum=1;Best Regards
mseberg -
How to trace which user shutdown oracle database in unix OS?
our organization is having 10 DBA with sysdba priviladge. We are using UNIX operating system. At morning say for example if some one (SYSDBA user) shutdown the oracle database how other sysdba user trace the user who shutdown the database? the information i need is terminal from where oracle got shutdown and the username? Please help...
Hello,
You are right Sybrand, SYSDBA connections are always audited.
My answer was about enabling auditing to any connections, which may give informations about who access to the Database in general. And, this is true, it was not the scope of the OP question.
However, so as to enlarge audit of SYS/SYSDBA/SYSOPER operations, setting the parameter audit_sys_operations=TRUE may be interesting:
http://download.oracle.com/docs/cd/E11882_01/network.112/e16543/auditing.htm#DBSEG0611
To the OP:
Where the audit tracefile get genareted for sys user?You may execute this:
show parameter audit_file_destThank again Sybrand for correcting me.
Best regards,
Jean-Valentin -
Chat App: how to store the user IP in database when they login.
hello,
i am working on chat application. first i made a login GUI form. after login when we run the Chat program, it ask the ip address of the server to whom it want to connect. and if u enter the ip address, it will connect to the server and chat will begin, thats working perfect.
but i want to show the list of users who r logged on and when i simply click on the user name, chat should begin.
i have the logic that when any user log in, then its IP address will be stored in the database. this ip address will shown to the online users.
but i dont know how to store the user information in database when they log in. can any body suggest me wht lines of code i should use.
thanks.palakk wrote:
i have the logic that when any user log in, then its IP address will be stored in the database. Bad approach. That will only work if this chat is only intended for use on a LAN. If it's used on the internet, then your users' IP addresses will almost always be either a) those of their routers, or b) private IP addresses, and in both cases, multiple users can have the same IP address.
this ip address will shown to the online users. Why would you want to do that? I want to chat with "Bill", not with "1.2.3.4".
but i dont know how to store the user information in database when they log in.Do the same thing that you're currently doing to store the IP address, but with the other information you want to store.
can any body suggest me wht lines of code i should use. This is not a code writing service. -
How to read the RD Connect Broker DataBase!!!!
The msdn say there is a RD Connect Broker Data Base , it store the session information,but i dont know where is it and how to read it !
Thank you !!!!Hi,
You can use the vbs script below to dump the contents of the RD Connection Broker database.
With credits to the authors of the Windows Server 2008 R2 RDS Resource Kit for putting it in there!
' Copyright (c) 2004-2005 Microsoft Corporation
' WMI Script - SDDatabaseDump.vbs
' Author - GopiV
' This script dumps the contents (clusters and associated sessions)
' of the Session Directory database
' USAGE: Cscript.exe SDDatabaseDump.vbs <SBservername> <Administrator> <Password>
const TAB = " "
const LINESEPARATOR = "------------------------------------------------"
ON ERROR RESUME NEXT
'* Function blnConnect()
'* Purpose: Connects to machine strServer.
'* Input: strServer a machine name
'* strNameSpace a namespace
'* strUserName name of the current user
'* strPassword password of the current user
'* Output: objService is returned as a service object.
Function blnConnect(objService, strServer, strNameSpace, strUserName, strPassword)
ON ERROR RESUME NEXT
Dim objLocator
blnConnect = True 'There is no error.
' Create Locator object to connect to remote CIM object manager
Set objLocator = CreateObject("WbemScripting.SWbemLocator")
if Err.Number then
Wscript.Echo "Error 0x" & CStr(Hex(Err.Number)) & " occurred in creating a locator object."
if Err.Description <> "" then
Wscript.Echo "Error description: " & Err.Description & "."
end if
Err.Clear
blnConnect = False 'An error occurred
Exit Function
end if
' Connect to the namespace which is either local or remote
Set objService = objLocator.ConnectServer (strServer, strNameSpace, strUserName, strPassword)
if Err.Number then
Wscript.Echo "Error 0x" & CStr(Hex(Err.Number)) & " occurred in connecting to server " _
& strServer & "."
if Err.Description <> "" then
Wscript.Echo "Error description: " & Err.Description & "."
end if
Err.Clear
blnConnect = False 'An error occurred
end if
objService.Security_.impersonationlevel = 3
if Err.Number then
Wscript.Echo "Error 0x" & CStr(Hex(Err.Number)) & " occurred in setting impersonation level " _
& strServer & "."
if Err.Description <> "" then
Wscript.Echo "Error description: " & Err.Description & "."
end if
Err.Clear
blnConnect = False 'An error occurred
end if
end Function
' Start of script
if Wscript.arguments.count<3 then
Wscript.echo "Script can't run without 3 arguments: ServerName Domain\UserName Password "
Wscript.quit
end if
Dim strServer, strUserName, strPassword
Dim objService, blnResult
' Extract the command line arguments
strServer=Wscript.arguments.Item(0)
strUserName=Wscript.arguments.Item(1)
strPassword=Wscript.arguments.Item(2)
' Connect to the WMI service on the SD Server machine
blnResult = blnConnect( objService, strServer, "root/cimv2", strUserName, strPassword )
if not blnResult then
Wscript.echo "Can not connect to the server " & strServer & " with the given credentials."
WScript.Quit
end if
Set clusterEnumerator = objService.InstancesOf ("Win32_SessionDirectoryCluster")
if Err.Number then
Wscript.Echo "Error 0x" & CStr(Hex(Err.Number)) & " occurred"
end if
if clusterEnumerator.Count = 0 then
Wscript.Echo "No clusters found in Session Directory database on " & strServer & "."
Wscript.Echo
Wscript.Quit
end if
for each clusterObj in clusterEnumerator
WScript.Echo LINESEPARATOR
WScript.Echo "ClusterName = " & clusterObj.ClusterName
WScript.Echo "NumberOfServers = " & clusterObj.NumberOfServers
WScript.Echo "SingleSessionMode = " & clusterObj.SingleSessionMode
Wscript.Echo
set serverEnumerator = objService.ExecQuery("Select * from Win32_SessionDirectoryServer where ClusterName = '" & clusterObj.ClusterName & "'")
if Err.Number then
Wscript.Echo "Error 0x" & CStr(Hex(Err.Number)) & " occurred"
end if
if serverEnumerator.Count = 0 then
Wscript.Echo "Error : No servers in cluster " & clusterObj.ClusterName
Wscript.Echo
else
' Enumerate the servers in this cluster
for each serverObj in serverEnumerator
WScript.Echo TAB & "SERVER :"
WScript.Echo TAB & "ServerName = " & serverObj.ServerName & " ServerSingleSessionMode = " & serverObj.SingleSessionMode & " LoadIndicator = " & serverObj.LoadIndicator
' WScript.Echo TAB & "ServerIP = " & serverObj.ServerIPAddress
' WScript.Echo TAB & "ServerWeight = " & serverObj.ServerWeight
set sessionEnumerator = objService.ExecQuery("Select * from Win32_SessionDirectorySession where ServerName = '" & serverObj.ServerName & "'")
if Err.Number then
Wscript.Echo "Error 0x" & CStr(Hex(Err.Number)) & " occurred"
end if
if sessionEnumerator.Count = 0 then
WScript.Echo
WScript.Echo TAB & "No sessions on server " & serverObj.ServerName
WScript.Echo
else
WScript.Echo TAB & "NumberOfSessions = " & sessionEnumerator.Count
Wscript.Echo
' Enumerate the sessions on this server
for each sessionObj in sessionEnumerator
WScript.Echo TAB & TAB & "SESSION :"
WScript.Echo TAB & TAB & "UserName= " & sessionObj.DomainName & "\" & sessionObj.UserName & TAB & "ApplicationType= " & sessionObj.ApplicationType
& TAB & "SessionState= " & sessionObj.SessionState
WScript.Echo TAB & TAB & "CreateTime= " & sessionObj.CreateTime & TAB & "DisconnectTime= " & sessionObj.DisconnectTime
' WScript.Echo TAB & TAB & "ServerName= " & sessionObj.ServerName
' WScript.Echo TAB & TAB & "SessionID= " & sessionObj.SessionID
' WScript.Echo TAB & TAB & "ServerIP= " & sessionObj.ServerIPAddress
' WScript.Echo TAB & TAB & "TSProtocol= " & sessionObj.TSProtocol
' WScript.Echo TAB & TAB & "ResolutionWidth= " & sessionObj.ResolutionWidth
' WScript.Echo TAB & TAB & "ResolutionHeight= " & sessionObj.ResolutionHeight
' WScript.Echo TAB & TAB & "ColorDepth= " & sessionObj.ColorDepth
' WScript.Echo
WScript.Echo
next
end if ' End of sessions on this server
next
end if ' End of servers on this cluster
next
Wscript.Echo
Wscript.Echo
Wscript.Echo "Dump of SD database on " & strServer & " complete."
Kind regards,
Freek Berson
http://www.microsoftplatform.blogspot.com
Wortell company website -
Trace the user who has started the java instance.
Hi Gurus,
How can we trace the users those who restart the java instances?
Regards,
Ratan royHi,
Check dev traces and java trace files
\usr\sap\<SID>\<instance name>\work and
usr\sap\<SID>\<instance name>\j2ee\cluster\server<n>\log
and /usr/sap/<SID>/<Central instance name>/j2ee/JSPM/
I am not sure wthr the user who started the instance will be traced you can also try and trace database log files . I am not sure of the path
Rakesh -
BB Curve 8310 - Message -"Unable to look up the user info in database"
Have contacts with email address uploaded from older model. Receive emails ok...have also set up two addresses for myself, however when trying to either manually place the email address or select one from my contacts, I get the response
"Unable to look up the user info in database" when trying to send email
I have created a CSV file for my contacts to transfer to the Curve however I don't know where to go from there.Unable to look up the user info in database - KB03414
SOLUTION HERE.
If your issue is resolved, put a checkmark in the green box that contains the resolution.
OR
If it was just/or also really helpful - Give it a Kudos.. Go on Mate.. Help the rest of the clueless blackberry user world find their answer too..
~Gday from Down Under~ -
SYS user connects at database level, is it correct?
My senior colleague has given me following information about the sys user. I want to know, is it correct?
Since SYS user connects at the database level, therefore, on killing the active session of the SYS user,only the current statement is cancelled. The database session does not disconnect. Instead it continues to run the remaining statements in the script file in case we are running a script file containing a lot of SQL statements.
MoazzamMoazzam wrote:
My senior colleague has given me following information about the sys user. I want to know, is it correct?
Since SYS user connects at the database level, therefore, on killing the active session of the SYS user,only the current statement is cancelled. The database session does not disconnect. Instead it continues to run the remaining statements in the script file in case we are running a script file containing a lot of SQL statements.Running a SQL script very likely means SQL*Plus is used. One of two types of Oracle sessions will be created via sqlplus. A dedicated session. Or a shared server session.
A dedicated session can also be local (sqlplus connects "directly" to the dedicated server process), or remote (sqlplus connects via tcp/ip to the dedicated server process).
A server session is usually "killed" using the alter system kill session command. Despite the differences between shared and dedicated server connections, the end result is the same. The session terminates abnormally (session UGA will be released, session will be cleaned up, rolled back, etc) - and the session ceases to exist.
So irrespective of how that sqlplus session runs that script - the session, when killed, will cause a sqlplus failure. And no subsequent script commands would be executed by that Oracle session.
What can happen is that sqlplus continues running, continues reading the script, and continues submitting commands to be executed. However, with the server session killed, there is no server process to service the commands submitted by the sqlplus client. In this case, sqlplus will throw the error "+SP2-0640: Not connected+" after each of the commands it tries to execute after the server session was killed.
The only time when sqlplus will be able to continue is when the session is not killed, but interrupted. The Oracle Call Interface (OCI) supports a OCIBreak() call - allowing the client to interrupt-and-abort the request that its server session is currently executing.
For example, sqlplus sends a OCIBreak() while it waits for a server response (e.g. waiting for the answer to a SQL select query), when the user presses Ctrl-Break to abort that request.
In this case, the session still exists - and the client can issue a new request that the session will service. But an OCIBreak() cannot be triggered (to my knowledge) externally from another Oracle session. You need to send the client process a "break request" (like a Ctrl-Break keystroke) in order to trigger that client process to make an OCIBreak() call to Oracle and interrupt its server process. -
Not able to trace sys user connection from which node in audit
We have got one user who is accessing as sysdba and cannot be traced where the connection has come.
List of unique users logged successfully into SQLPLUS as SYSDBA
CLIENT USER: , STATUS: 0
Regards
NagaWe get the information from Audit of our production.
Someone accessing the production from client/desktop whose session is not traceable. Is there a way to trace the information who accessed it.
we are on 9.2.0.8 database -
Hi,
How can we find who are the users currently using/connected to the database?
Regards
Balu.BalaKrishna Reddy Avuthu wrote:
Thanks guys it is working........
Thank you very much.
I would like to find out the SID name/Connection string too.
Where do I get it?
Balu.
Edited by: BalaKrishna Reddy Avuthu on Apr 11, 2009 5:04 PMNow that you know about the v$session and gv$session views, you could do some further research on your own. Go to tahiti.oracle.com, drill down to your product and version, the take a look at the Reference Manual. It will detail the entire data dictionary. Just look down through the list of v$ (or gv$) views for stuff that looks likely to have what you are looking for, then read up on those views. -
Need To Trace Reports Server Connection to Database
Hi,
A customer is getting intermittent "Unable to connect to database" errors when running Oracle Reports.
We have tried teaking the Reports server's configuration, but the errors are still occuring.
I know how to set up a trace on the Reports server, but wonder how best to trace the server's connection/attempted connection to the database.
Is it possible to trace attempted connections?
Database is 9i 9.2.0.6, Reports server is OracleAS 10g 9.0.4.2.
Any suggestions greatly appreciated.
JimThere is a parameter SQL_TRACE which you can turn on and it will start tracing all the sessions at database level which is not preferred way. You need to enable the trace for only report server sessions for troubleshooting and you can do this by enabling the trace in specific sessions. You can do something like this:
Connect to database using report server
On the server identify the sessions belongs to report server connection
Enable the tracing for those sessions by using:
SQL> exec dbms_system.set_sql_trace_in_session(SID,SERIAL#,true);
You can find the SID and SERIAL# (if your report server session) in V$SESSION view in database.
Then find the trace files in path defined user_dump_dest parameter. After getting the trace file use TKPROF to parse it. Just type at command prompt:
tkprof abc.trc abc.txt
It will convert the trace file into readable format.
Best Of Luck.
Daljit Singh -
How to get the user connection type
hi all, I have a PAI process to execute only if the user is connected from ESS/MSS. how can I determine the type of connection, if u have some suggestions please help.
thanks in advance.>
mniakh mahmoud wrote:
> hi all, I have a PAI process to execute only if the user is connected from ESS/MSS. how can I determine the type of connection, if u have some suggestions please help.
> thanks in advance.
I use function module WS_QUERY to do exactly this thing. If it sends back RETURN = 'ITS" then it is connected to ESS/MSS. This has worked in our 6.20 and ECC6 systems, though I guess it may not work in exactly the same way in your system. There also might be a more modern method of a class to do the same thing.
CALL FUNCTION 'WS_QUERY'
EXPORTING
* ENVIRONMENT =
* FILENAME =
query = 'WS'
* WINID =
IMPORTING
return = window_system
EXCEPTIONS
* inv_query = 1
no_batch = 2
frontend_error = 3
OTHERS = 4. -
How to write select query for all the user tables in database
Can any one tell me how to select the columns from all the user tables in a database
Here I had 3columns as input...
1.phone no
2.memberid
3.sub no.
I have to select call time,record,agn from all the tables in a database...all database tables have the same column names but some may have additional columns..
Eg: select call time, record,agn from ah_t_table where phone no= 6186759765,memberid=j34563298
Query has to execute not only for this table but for all user tables in the database..all tables will start with ah_t
I am trying for this query since 30days...
Help me please....any kind of help is appreciated.....Hi,
user13113704 wrote:
... i need to include the symbol (') for the numbers(values) to get selected..
eg: phone no= '6284056879'To include a single-quote in a string literal, use 2 or them in a row, as shown below.
Starting in Oracle 10, you can also use Q-notation:
http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/sql_elements003.htm#i42617
...and also can you tell me how to execute the output of this script. What front end are you using? If it's SQL*Plus, then you can SPOOL the query to a file, and then execute that file, like this:
-- Suppress SQL*Plus features that interfere with raw output
SET FEEDBACK OFF
SET PAGESIZE 0
-- Run preliminary query to generate main query
SPOOL c:\my_sql_dir\all_ah_t.sql
SELECT 'select call time, record, agn from '
|| owner
|| '.'
|| table_name
|| ' where phone_no = ''6186759765'' and memberid = j34563298'
|| CASE
WHEN ROW_NUMBER () OVER ( ORDER BY owner DESC
, table_name DESC
) = 1
THEN ';'
ELSE ' UNION ALL'
END AS txt
FROM all_tables
WHERE SUBSTR (table_name, 1, 4) = 'AH_T'
ORDER BY owner
, table_name
SPOOL OFF
-- Restore SQL*Plus features that interfere with raw output (if desired)
SET FEEDBACK ON
SET PAGESIZE 50
-- Run main query:
@c:\my_sql_dir\all_ah_t.sql
so that i form a temporary view for this script as a table(or store the result in a temp table) and my problem will be solved..Sorry, I don't understand. What is a "temporary view"? -
How do I find the users connected via afptcp
I want to find the list of users connected to an OES2 Linux server.
Originally Posted by ataubman
Start with the documentation Novell Documentation . If you have further issues, please start your own fresh thread with full problem and system details, as your problem has nothing to do with the OP's.
I've already looked at the documentation and have another thread going, I'm just looking for any info from any source. That source may be watching this thread and not the other. -
Delete all the user connected to one transaction.
During some periods, we need to lock some transaction to avoid user modify data while we are processing some critical jobs.
If the users are yet in the transaction when we lock the transaction they are not removed from the transaction and we need to kill them manually from SM04 transaction in each application server.
I have been trying to adapt the RSM04000_ALV program to do this but i'm stuck with the use of the pooled session.
I guess that the system when you select the session and click on end session, it mark in anyplace something to indicate to the fuction module TH_DELETE_USER that when the option ONLY_POOLED_USER is enable, only that session need to be killed.
Anybody know how this works? someone have a similar fuctionality in you system?Hello
Try this:
DATA: BEGIN OF SERVER_LIST OCCURS 0.
INCLUDE STRUCTURE MSXXLIST.
DATA: END OF SERVER_LIST.
DATA: BEGIN OF USER_LIST OCCURS 0.
INCLUDE STRUCTURE UINFO.
DATA: END OF USER_LIST.
DATA: BEGIN OF USER_LIST1 OCCURS 0.
INCLUDE STRUCTURE UINFO.
DATA: END OF USER_LIST1.
DATA: USER_TERM LIKE RFCDISPLAY-RFCHOST.
CALL FUNCTION 'TH_SERVER_LIST'
TABLES
LIST = SERVER_LIST
EXCEPTIONS
OTHERS = 1.
LOOP AT SERVER_LIST.
CALL FUNCTION 'TH_USER_LIST'
DESTINATION SERVER_LIST-NAME
TABLES LIST = USER_LIST1.
APPEND LINES OF USER_LIST1 TO USER_LIST.
REFRESH USER_LIST1.
LOOP AT USER_LIST WHERE TCODE = 'YOUR T-CODE'.
CALL FUNCTION 'TH_DELETE_USER' DESTINATION SERVER_LIST-NAME
EXPORTING
USER = USER_LIST-BNAME
CLIENT = SY-MANDT
TID = USER_LIST-TID
EXCEPTIONS
AUTHORITY_ERROR = 1
OTHERS = 2.
ENDLOOP.
ENDLOOP.
Maybe you are looking for
-
LRM-00109: could not open parameter file
Hi, I have done clone using rman backup and change db name using DBNID utility Now i want to rename the pfile or spfile When i am trying to rename it occured below error.Tnsname and listener parameters have been changed. SQL> startup ORA-01078: failu
-
Autonumber bug in headings following a procedure
Hoping someone has an answer to this... I'm on Frame 11 (11.0.0.380) on Windows 7. I'm running into a strange issue with headings that are autonumbered. Everything works as expected... until I include a proccedure that has autonumbered steps and sub-
-
I cant add apps to my ipod from my computer but i can add music, books and pictures!!??
-
Aspect Ratio problem with Premiere Elements 10
I had old super 8 cine film transferred to video for me in December 2011 and put it onto a Blu Ray disc as AVCHD files. The disc is copied onto my computer and displays in the correct 4;3 aspect ratio on the Desktop and plays correctly in VLC media v
-
Can you update CS6 apps if you have the CC apps installed too?
I saw the Creative cloud menu item with 8 updates for the CS6 apps I left installed after downloading the CC versions. I get errors when trying to update the CS6 apps. Are you not abile to have both CC and CS6 installed?