About Real Application Security Diagnostics
Real Application Security uses an integrated infrastructure that spans across back-end databases, application servers, and application instances. Real Application Security components include diagnostic capabilities that enable you to locate, diagnose, and resolve problems in a Real Application Security system.
Real Application Security diagnostics make use of the database Diagnostic Framework (DFW) available in Oracle Database 12c Release 1 (12.1) and later. Functionality diagnostics allow you to track, investigate, and resolve functionality failures. You can use exception state dumps, event-based tracing, or default tracing to study and resolve functionality issues. Performance diagnostics enable you to identify and resolve performance issues.
The following sections discuss functionality and performance diagnostic techniques used in Real Application Security systems:
About Using Validation APIs
You should always validate objects after they are created. This includes objects, such as principals, security classes, ACLs, data security policies, and namespaces. You can also validate all these objects that exist in a workspace in a single operation. The XS_DIAG package includes subprograms that you can use to diagnose potential problems in any of these created objects. See “XS_DIAG Package” for more information. These packages are briefly described in the following table with links to each validation subprogram where examples of their usage are shown.
Summary of XS_DIAG Subprograms
| Subprogram | Description |
|---|---|
| VALIDATE_PRINCIPAL Function | Validates the principal. |
| VALIDATE_SECURITY_CLASS Function | Validates the security class. |
| VALIDATE_ACL Function | Validates the ACL. |
| VALIDATE_DATA_SECURITY Function | Validates the data security policy or validates the data security policy against a specific table. |
| VALIDATE_NAMESPACE_TEMPLATE Function | Validates the namespace template. |
| VALIDATE_WORKSPACE Function | Validates an entire workspace. |
How to Check Which ACLs Are Associated with a Row for the Current User
To find which ACLs are associated with a particular row for the current user, use the ORA_GET_ACLIDS function. The ORA_GET_ACLIDS function returns a list of ACL IDS associated with a row instance of data security policy enabled tables for the current application user. If access to the current row has been granted, this function captures all ACL identifiers that are associated with the matching data realm constraints. See “ORA_GET_ACLIDS Function” for reference information and “About Checking ACLs for a Privilege” for tutorial information.
How to Find If a Privilege Is Granted in an ACL to a User
To find if a privilege is granted in an ACL, use the ORA_CHECK_ACL function. The ORA_CHECKACL function checks whether an application user has the queried application privileges according to a list of ACLs. If the specified application privileges have been granted to the application user, ORA_CHECKACL returns 1. If they are not granted to the application user, then it returns 0. See “ORA_CHECK_ACL Function” for reference information and “About Checking ACLs for a Privilege” for tutorial information.
To list the ACLIDs associated with each row of a table, for example, the EMPLOYEE table, the user can use the following query:
select ORA_GET_ACLIDS(emp) from EMPLOYEE emp;
To list the result if a privilege, for example SELECT, is granted for each row of the EMPLOYEE table, the user can perform the following query:
select ORA_CHECK_ACL(ORA_GET_ACLIDS(emp), 'SELECT') from EMPLOYEE emp;
About Exception State Dumps
When an exception occurs, the state information for Real Application Security components is dumped into trace files. Exception state dumps are analogous to crash site evidence for a plane crash.
A failure, like an internal error or server crash, causes a Diagnostic Data Extraction (DDE) routine to be invoked for each component. This dumps the current system, session, and process state information into trace files. You can later analyze the cause of failure using the state information dumped into trace files.
About Event-Based Tracing
Event-based tracing can be used to track events related to specific Real Application Security components. Event-based tracing helps in tracing the events that led up to a failure. For example, event number 46148 is used to trace application session events, such as createSession and attachSession.
About In-Memory Tracing
In-memory tracing is a proactive tracing mechanism that is used do diagnose intermittent and hard to replicate errors. The in-memory tracing mechanism records component state changes and events in memory buffers. This is dumped to a trace file when a failure occurs. In-memory tracing is analogous to black box data that is used for plane crash investigation.
About Statistics
Real Application Security component statistics help identify performance issues in a Real Application Security system. Statistics include key data like the number of session create operations, principal invalidations, role-enabling operations, and so on.