decoding siebel 8.x audit trail data[1]

8
Decoding Siebel 8.x Audit Trail data May 2009

Upload: cltanmy

Post on 03-Apr-2015

621 views

Category:

Documents


6 download

TRANSCRIPT

Decoding Siebel 8.x Audit Trail data May 2009

Decoding Siebel 8.x Audit Trail data Page 2

Decoding Siebel 8.x Audit Trail data

Introduction ....................................................................................................... 3 Other Options............................................................................................... 3

Logical Design ................................................................................................... 4 Structure ......................................................................................................... 4 Triggering....................................................................................................... 4

Implementation ................................................................................................. 5 Business Service ............................................................................................ 5

Conclusion.......................................................................................................... 7

Decoding Siebel 8.x Audit Trail data Page 3

Decoding Siebel 8.x Audit Trail data

INTRODUCTION

In Siebel 8.x data captured by Audit Trail functionality is stored in an encoded

form in the Siebel database in order to maximise the performance of the overall

Siebel application.

This document sets out to assist customers who wish to export this data for use in

other applications, for example a Data Warehouse. It describes the use of the

functionality of the “Audit Trail Item 2” Virtual Business Component (VBC) to

decode the data as part of a wider solution to send the decoded data to any

downstream system.

Other Options

Some customers have previously undertaken efforts to manually decode audit data

from the underlying database tables for use in their own applications. While this

approach might be suitable for a small number of scenarios it is essential to note

that the encoded format used in this table is an internal format and is subject to

change without notice. Customers undertaking to design their own decoding logic

must understand that they risk their solution being negatively affected by any

future changes to this format.

Oracle strongly recommends that customers use the VBC included as part of the

Siebel application in order to decode their audit data; this VBC will be updated to

reflect any changes in the underlying data structure.

Audit Trail creates a history of the changes

that have been made to data in Siebel

applications. An audit trail item is a record

showing who has accessed a record, which

operation was performed, when it was

performed and how the value was changed.

Decoding Siebel 8.x Audit Trail data Page 4

LOGICAL DESIGN

Structure

The flow of logic in any solution decoding audit data is very dependent on the use

to which that data is put. Some customers, implementing an archival solution, may

wish to simply read all created records (potentially destructively) whereas other,

more data oriented, use cases may demand finer grained control of the data.

The high level flow for reconstructing data is given below.

This flow may be modified in order to restrict the data returned, by BC, user,

position etc. but the fundamental aspect of querying both the “Audit Trail Item 2”

VBC and “Audit Trail Item – Data” BC in order to construct a record consistent

in format to a Siebel 7.x Audit Trail record will always be present.

The final “Write out decoded” step is entirely dependant on a customer’s specific

requirements and could range from writing to a custom table in the Siebel database

to sending the decoded data to an external data using one of the EAI Transports;

as this step is so specific it will not be considered here.

Triggering

The triggering for this flow is key to the solution. Two options will present

themselves to any team considering such an approach. The first is some form of

reactive trigger, be that through runtime events or workflow policies. If the use

case that is being designed for requires real-time or near-real-time onward

transmission of the audit trail data then this solution may have to be considered.

However, developers are urged to consider that the volume of transactions

occuring on the audit tables is understandably very high and so any “per record”

solution may cause unwanted performance effects on the overall performance of

Decoding Siebel 8.x Audit Trail data Page 5

the Siebel application. Certainly for any deployment making use of reactive

triggering on audit data, extensive performance profiling is essential.

For any scenario that does not demand real-time data transmission an

asynchronous batch approach using a mechanism such as Repeating Component

Requests (or similar) can be considered. These can be tuned and adjusted so that

the frequency of the job matches the data and performance requirements of the

system and in many cases can be timed to occur at periods of reduced activity in

the system. This then is the recommended approach for the majority of use cases.

IMPLEMENTATION

Either a custom Business Service in conjunction with a Workflow Process, or a

Workflow Process on its own could be used to implement this type of

functionality. Leveraging a workflow process only may assist in the long term

maintenance of the solution if it is felt that it may require modification over time;

however this will also add complexity to the solution due to the requirements of

stepping through data sets and restricting records.

Business Service

This example provides sample code for a business service that could be used to

retrieve and decode data; note however that the search specification is arbitary and

needs careful consideration for individual implementations.

function decodeAuditTrail(strTimediff)

{

try {

// Create objects

var boAudit = TheApplication().GetBusObject("Audit Trail");

var bcAuditItem = boAudit.GetBusComp("Audit Trail Item 2");

with(bcAuditItem) {

SetViewMode(AllView);

ClearToQuery();

// Set the search specification. In this example we are only

// using time differential.

SetSearchSpec("Date", ">= " + strTimediff);

ExecuteQuery(ForwardOnly);

var bRecord = FirstRecord();

while(bRecord) {

//Retrieve field values

var strRecordId = GetFieldValue("Record Id");

Decoding Siebel 8.x Audit Trail data Page 6

var strBC = GetFieldValue("Business Component");

var strFieldName = GetFieldValue("Field");

var strOldVal = GetFieldValue("Old Value");

var strNewVal = GetFieldValue("New Value");

var strDate = GetFieldValue("Date");

//Query for underlying Row Id

var strAuditId = getAuditRowId(strRecordId, strDate);

//Placeholder for function to write out values

writeAuditValues(strAuditId, strBC, strFieldName, strRecordId,

strOldVal, strNewVal, strDate);

bRecord = NextRecord();

}

}

}

catch(e)

{

throw(e);

}

}

function getAuditRowId(strAuditRecordId, strAuditRecordDate)

{

var strReturn = "";

try

{

// Create objects

var boAudit = TheApplication().GetBusObject("Audit Trail");

var bcAuditData = boAudit.GetBusComp("Audit Trail Item - Data");

with(bcAuditData) {

SetViewMode(AllView);

ClearToQuery();

// Set the search specification for the combination of

// record Id and date

SetSearchSpec("Date", strAuditRecordDate);

SetSearchSpec("Record Id", strAuditRecordId);

ExecuteQuery(ForwardOnly);

The placeholder in this script is purely that.

Depending on your specific requirements

you will likely only require a subset of the

fields listed here.

For simple audit records it would even be

possible to dispense with the call to the

Aduti Trail Item – Data BC.

Decoding Siebel 8.x Audit Trail data Page 7

var bRecord = FirstRecord();

if(bRecord) {

strReturn = GetFieldValue("Id");

// Check to see that we only have one record

bRecord = NextRecord();

if(bRecord) {

throw("Error: Multiple Record Id and Date records

identified");

}

}

else

strReturn = "";

}

}

catch(e)

{

throw(e);

}

return(strReturn);

}

CONCLUSION

Customers wishing to decode Audit Trail data in a Siebel 8.x environment should

use the Audit Trail Item 2 virtual business component in order to decode data in

line with the internal data representation.

Decoding Siebel 8.x Audit Trail data

May 2009

Author: Graham Nicol

Oracle Corporation

World Headquarters

500 Oracle Parkway

Redwood Shores, CA 94065

U.S.A.

Worldwide Inquiries:

Phone: +1.650.506.7000

Fax: +1.650.506.7200

oracle.com

Copyright © 2009, Oracle. All rights reserved.

This document is provided for information purposes only and the

contents hereof are subject to change without notice.

This document is not warranted to be error-free, nor subject to any

other warranties or conditions, whether expressed orally or implied

in law, including implied warranties and conditions of merchantability

or fitness for a particular purpose. We specifically disclaim any

liability with respect to this document and no contractual obligations

are formed either directly or indirectly by this document. This document

may not be reproduced or transmitted in any form or by any means,

electronic or mechanical, for any purpose, without our prior written permission.

Oracle is a registered trademark of Oracle Corporation and/or its affiliates.

Other names may be trademarks of their respective owners.