Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Cleusa

Trigger Auditoria

Recommended Posts

Preciso criar uma trigger de auditoria , para saber quem alterou , qual campo alterou , e quando . Alguém poderia me ajudar , estou com problemas para saber quem alterou .Obrigada .Cleusa

Compartilhar este post


Link para o post
Compartilhar em outros sites

USERENV

Example SELECT ename, NVL(TO_CHAR(COMM), 'NOT

APPLICABLE')

"COMMISSION" FROM emp

WHERE deptno = 30;

ENAME COMMISSION

---------- -------------------------------------

ALLEN 300

WARD 500

MARTIN 1400

BLAKE NOT APPLICABLE

TURNER 0

JAMES NOT APPLICABLE

Syntax UID

Purpose Returns an integer that uniquely identifies the current user.

Syntax USER

Purpose Returns the current Oracle user with the datatype VARCHAR2.

Oracle compares values of this function with blank-padded comparison

semantics.

In a distributed SQL statement, the UID and USER functions identify

the user on your local database. You cannot use these functions in the

condition of a CHECK constraint.

Example SELECT USER, UID FROM DUAL;

USER UID

------------------------------ ----------

SCOTT 19

Syntax USERENV(option)

SQL Functions

Operators, Functions, Expressions, Conditions 3-55

VSIZE

Purpose Returns information of VARCHAR2 datatype about the current session.

This information can be useful for writing an application-specific audit trail

table or for determining the language-specific characters currently used by

your session. You cannot use USERENV in the condition of a CHECK constraint.

The argument option can have any of these values:

’ISDBA’ returns ’TRUE’ if you currently have the ISDBA role

enabled and ’FALSE’ if you do not.

’LANGUAGE’ returns the language and territory currently used by your

session along with the database character set in this form:

language_territory.characterset

’TERMINAL’ returns the operating system identifier for your current

session’s terminal. In distributed SQL statements, this

option returns the identifier for your local session. In a distributed

environment, this is supported only for remote

SELECTs, not for remote INSERTs, UPDATEs, or

DELETEs.

’SESSIONID’ returns your auditing session identifier. You cannot use

this option in distributed SQL statements. To use this keyword

in USERENV, the initialization parameter AUDIT_

TRAIL must be set to TRUE.

’ENTRYID’ returns available auditing entry identifier. You cannot use

this option in distributed SQL statements. To use this keyword

in USERENV, the initialization parameter AUDIT_

TRAIL must be set to TRUE.

’LANG’ Returns the ISO abbreviation for the language name, a

shorter form than the existing ’LANGUAGE’ parameter.

’INSTANCE’ Returns the instance identification number of the current

instance.

Example SELECT USERENV(’LANGUAGE’) "Language" FROM DUAL;

Language

-----------------------------------

AMERICAN_AMERICA.WE8DEC

Syntax VSIZE(expr)

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.