WorkStation ID or similar in Oracle

Dúvidas, dicas e truques de SQL, Select, Update, Delete, cláusulas, operações com joins, Funções em SQLs, etc
  

Poston Tue, 01 Apr 2008 2:21 pm

Hello guys, I am new to Oracle and would like to clarify a doubt or even receive a suggestion. I have the following scenario: I'm implementing data audit on the banks of the applications I develop in .NET, however would like to when my trigger for audit log the inclusion/deletion/change retrieve which the user of the application (not the Bank) has implemented such an operation, I'd like to do it in a less engaged as possible.

Applications that use the SqlServer, implemented as follows: there is an attribute in the ConnectionString called Workstation ID that I can inform any value, and the Bank, through a trigger or procedure can retrieve the value that was informed at the time of connection to the Bank.
With this implementation does not need to implement at any time fields in the tables with the user code, or even move in the methods of my application. Because all connection will have the user code.

I wonder if there is a similar attributes in Oracle, or even any suggestions of how to implement this audit.

I thank you to anyone who can help me.
mvbios
Location: Rio de Janeiro - RJ

Att.
Marcus Dorbação

Poston Tue, 01 Apr 2008 3:27 pm

damn son, oracle has to Yes ... look at this select
Code: Select all
select trim(username), -- Usuário conectado no banco
       nvl(trim(program),'PROGRAMA NÃO INDENTIFICADO'), -- Nome do programa que abriu a sessao não banco
       trim(machine), -- Nome do computador na rede
       trim(osuser), -- Nome do usuário da rede
       trim(terminal) --Nome do computador
from v$session
where audsid = userenv('sessionid')
I have helped;)
gokden
Location: Ribeirão Preto - SP

Lucas de Souza

OCA Developer
Analista de sistemas

Poston Tue, 01 Apr 2008 3:51 pm

I ran the query above, and appeared the error below.
SQL Error: ORA-00942: table or view does not exist you know what can be?
Grateful.
mvbios
Location: Rio de Janeiro - RJ

Att.
Marcus Dorbação

Poston Tue, 01 Apr 2008 4:18 pm

ueh ... you are connecting to an oracle database?

because as far as I know, all users have privilege to view the v $ session now do not know why to be happening that, if anyone can help ....
gokden
Location: Ribeirão Preto - SP

Lucas de Souza

OCA Developer
Analista de sistemas

Poston Tue, 01 Apr 2008 4:22 pm

Yes ... and the worst is that I tried to see other views of native oracle and is showing the same error ...

If anyone can help me. ..
mvbios
Location: Rio de Janeiro - RJ

Att.
Marcus Dorbação

Poston Tue, 01 Apr 2008 4:40 pm

Friend of grant of DBA in the user in which you want to run this query..

aqui was without problems ....
Dulima-SP
Location: SP

Dulima

DBA Oracle Jr

Poston Tue, 01 Apr 2008 4:41 pm

Friend of grant of DBA in the user in which you want to run this query..

aqui was without problems ....
Dulima-SP
Location: SP

Dulima

DBA Oracle Jr

Poston Tue, 01 Apr 2008 4:41 pm

Friend of grant of DBA in the user in which you want to run this query..

aqui was without problems ....
Dulima-SP
Location: SP

Dulima

DBA Oracle Jr

Poston Wed, 02 Apr 2008 1:06 pm

Guys, I assign some privileges to my user and it was ... just a question, is there any attribute that I can inform in the ConnectionString of my application and retrieve via query?
Type a value that I can report anything in SQL Server I use the attribute Workstation ID = id_usuario_aplicacao ... I would like to do something similar in Oracle.

The waits and even more ...
mvbios
Location: Rio de Janeiro - RJ

Att.
Marcus Dorbação

Poston Wed, 02 Apr 2008 2:48 pm

hmm.. well, it got muito what você qui ... by qui I intend, you want something like global variables não é??

It exists in the forms, the more I don't understand very well about this .... more on sqlPlus you can retrieve the logged-on user's connection code like this:
Code: Select all
select user from dual;
= D
gokden
Location: Ribeirão Preto - SP

Lucas de Souza

OCA Developer
Analista de sistemas



Return to SQL

Who is online

Users browsing this forum: Google [Bot] and 4 guests