Skip to Main Content
Oracle PL/SQL for DBAs
book

Oracle PL/SQL for DBAs

by Arup Nanda, Steven Feuerstein
October 2005
Intermediate to advanced content levelIntermediate to advanced
454 pages
14h 44m
English
O'Reilly Media, Inc.
Content preview from Oracle PL/SQL for DBAs

Client Identifier

Starting with Oracle9i Database, a variable-length character string can be assigned as an attribute of a user’s session. It can then be retrieved later from another program through a query against the V$SESSION view , effectively providing distinguishing information about the real user. Suppose that the user connects to the database as a user named DBUSER and then issues a statement:

    BEGIN
       DBMS_SESSION.set_identifier ('REAL_USER');
    END;
    /

This populates the CLIENT_IDENTIFIER column of the V$SESSION view with the value REAL_USER. So, from another session you will be able to see the value of this column.

    SELECT client_identifier
      FROM v$session
     WHERE SID = sid;

This returns REAL_USER.

This information is not limited to V$SESSION; it also shows up in the FGA trails—for example:

    SELECT client_id
      FROM dba_fga_audit_trail;

This also returns REAL_USER.

If this value is populated with the name of the real user, you will be able to accurately assign accountability to that user.

There are several ways that the client identifier can be set securely and reliably, as discussed in Chapter 5.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Oracle PL/SQL Best Practices

Oracle PL/SQL Best Practices

Steven Feuerstein
Expert Oracle PL/SQL

Expert Oracle PL/SQL

Ron Hardman, Michael McLaughlin
Oracle PL/SQL For Dummies

Oracle PL/SQL For Dummies

Michael Rosenblum, Paul Dorsey

Publisher Resources

ISBN: 0596005873Supplemental ContentErrata Page