Catch User Logged on the Bank

Dúvidas, dicas e truques de PL/SQL. Aqui também vão assuntos relacionados a pacotes, triggers, funções, Java-Stored Procedures, etc
Post Reply
leandrolinof
Rank: Programador Pleno
Rank: Programador Pleno
Posts: 33
Joined: Wed, 17 Feb 2010 6:30 am
Location: Americana

Good morning!

I have the following problem.

I need to get the user who is logged in to the PL and that is running something.

Ex: The guy goes and disables a trigger, can you get this in real run-time?

I'm waiting.

Abraxxx
diegolenhardt
Moderador
Moderador
Posts: 1177
Joined: Thu, 15 Oct 2009 10:28 am
Location: Recife

I know there is a Database level trigger, which you monitors changes in the tables and objects type, maybe it would be the case that you put a trigger from these to send an e-mail I do not know, or serious in another table such information, To get the logged user searches for

USERENV Oracle, has several functions, machine name, domain, etc.,
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

Select all

 
select * from v$session;  
 
select * from v$sql; 
leandrolinof
Rank: Programador Pleno
Rank: Programador Pleno
Posts: 33
Joined: Wed, 17 Feb 2010 6:30 am
Location: Americana

Diegolenhardt
I did not understand what would use a field? A table? I am a programmer in the company our bank the administrative part the DBAs é who take care of the company's database so I do not have access. Would you tell me what the name of this trigger you said in the post?

VictorHugomuniz
These two selects that you gave me one has already done that it is the bad Session's V $ na can not get if the user logged in is doing an update in some trigger.
In v $ SQL I did not find where I can base myself to find what the user is doing at the moment, I did not find anything in the SQL_Text field that speaks of update from the sys.all_triggers table.

As I am half a layman in the subject of the bank I am kind of lost now.
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

I do not know if it solves I know brother problem but ..

Select all

 
select username, vsql.SQL_TEXT from v$session vses, v$sql vsql where vses.sql_id=vses.sql_id; 
 
-- para achar o seu update 
vsql.SQL_TEXT like '%SYS.ALL_TRIGGERS%' 
leandrolinof
Rank: Programador Pleno
Rank: Programador Pleno
Posts: 33
Joined: Wed, 17 Feb 2010 6:30 am
Location: Americana

VictorHugomuniz
It did not work it seems that he only moves me what the staff does in the system and not in the bank, I made the code below and he brought me nothing ...

Select all

Select OSUSER, username,  
       vsql.SQL_TEXT  
From v$session vses,  
     v$sql vsql  
Where vses.sql_id = vsql.sql_id 
And   vsql.SQL_TEXT like '%SYS.ALL_TRIGGERS%';  
I guess you can not do this via code. Only via adm. Bank !!!
Post Reply
  • Information
  • Who is online

    Users browsing this forum: Bing [Bot] and 1 guest