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
Post Reply
mvbios
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 4
Joined: Tue, 01 Apr 2008 2:08 pm
Location: Rio de Janeiro - RJ
Att.
Marcus Dorbação

Hello everyone,
I am a beginner in Oracle and would like to take a question or even receive a suggestion. I am with the following scenario:

I am implementing data auditing on the banks of the applications that I develop in .NET, but I would like the time when my audit trigger is to register the inclusion / amendment / deletion Recover which user of the application (and not from the bank) performed to such operation, I would like to do this in a less coupled as possible.

In the applications where I use SQLServer, I implemented as follows:
There is an attribute in ConnectionString named Workstation ID that I can inform any value, and in the bank, through A trigger or procedure can recover the value that was informed at the time of connection to the bank.
With this implementation I do not need at no time to implement fields in the tables with the user code, or even mechanize in the methods of my application. Because the entire connection will have the user code.

I would like to know if there is a similar attributes in Oracle, or even some suggestion of how to implement this audit.

Thanks for those who can help me.
gokden
Rank: DBA Pleno
Rank: DBA Pleno
Posts: 264
Joined: Sun, 19 Aug 2007 8:18 pm
Location: Ribeirão Preto - SP
Lucas de Souza

OCA Developer
Analista de sistemas

Ixi son, in Oracle has as yes ...
Look at this select

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 hope I have helped;)
mvbios
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 4
Joined: Tue, 01 Apr 2008 2:08 pm
Location: Rio de Janeiro - RJ
Att.
Marcus Dorbação

I performed the above query, and the error appeared below.

Select all

SQL Error: ORA-00942: a tabela ou view não existe
know what can be?
grateful.
gokden
Rank: DBA Pleno
Rank: DBA Pleno
Posts: 264
Joined: Sun, 19 Aug 2007 8:18 pm
Location: Ribeirão Preto - SP
Lucas de Souza

OCA Developer
Analista de sistemas

Ueh ... Are you connecting on an Oracle bank ??

porque as far as I know all users have privilege to see the v $ session
now I do not know why this is happening, if anyone can help ....
mvbios
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 4
Joined: Tue, 01 Apr 2008 2:08 pm
Location: Rio de Janeiro - RJ
Att.
Marcus Dorbação

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

If anyone can help me ...
Dulima-SP
Rank: DBA Júnior
Rank: DBA Júnior
Posts: 193
Joined: Thu, 24 Jan 2008 1:56 pm
Location: SP
Dulima

DBA Oracle Jr

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

aqui was without problems ....
Dulima-SP
Rank: DBA Júnior
Rank: DBA Júnior
Posts: 193
Joined: Thu, 24 Jan 2008 1:56 pm
Location: SP
Dulima

DBA Oracle Jr

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

aqui was without problems ....
Dulima-SP
Rank: DBA Júnior
Rank: DBA Júnior
Posts: 193
Joined: Thu, 24 Jan 2008 1:56 pm
Location: SP
Dulima

DBA Oracle Jr

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

aqui was without problems ....
mvbios
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 4
Joined: Tue, 01 Apr 2008 2:08 pm
Location: Rio de Janeiro - RJ
Att.
Marcus Dorbação

Guys, I managed ... 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 recover via Query?
Type a value that I can inform anything, in SQL Server I use the Workstation ID attribute = id_usuario_aplication ... I would like to do something like Oracle.

does not wait and even more ...
gokden
Rank: DBA Pleno
Rank: DBA Pleno
Posts: 264
Joined: Sun, 19 Aug 2007 8:18 pm
Location: Ribeirão Preto - SP
Lucas de Souza

OCA Developer
Analista de sistemas

Hmm .. well, I did not understand very well what you say ...
for the chi I intendi, you want something like global variables não é ??

This exists in Forms, but I do not understand well about it ....

More in SQLPlus you can recover the connected user's connection code Thus:

Select all

 select user from dual; 
= D
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 19 guests