Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question.

Asked: July 05, 2017 - 4:39 am UTC

Last updated: July 06, 2017 - 3:48 am UTC

Version: 12c

Viewed 10K+ times! This question is

You Asked

Hi Ora experts,

I have some quick queries regarding oracle database. Is there any way to find an oracle database owner information (in Windows platform, where I don't have 'oratab' file)?
Also, we also need to find the 'last access time' of an oracle database.

Any help here is much appreciated.

Thanks

and Connor said...

Quick and easy way would be query v$session to get os user, server etc details

SQL> select * from v$session where program like '%PMON%'
  2  @pr
==============================
SADDR                         : 00007FFD2510F048
SID                           : 253
SERIAL#                       : 55329
AUDSID                        : 0
PADDR                         : 00007FFD26B1FFF8
USER#                         : 0
USERNAME                      :
COMMAND                       : 0
OWNERID                       : 2147483644
TADDR                         :
LOCKWAIT                      :
STATUS                        : ACTIVE
SERVER                        : DEDICATED
SCHEMA#                       : 0
SCHEMANAME                    : SYS
OSUSER                        : SYSTEM
PROCESS                       : 5460
MACHINE                       : XPS13
PORT                          : 0
TERMINAL                      : XPS13
PROGRAM                       : ORACLE.EXE (PMON)
TYPE                          : BACKGROUND
...
...



Last access time ? Not sure what you mean ? If you mean users, there is LAST_LOGIN time on DBA_USERS.



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