Search Results current_serial_number




Overview

OKS_USAGE_COUNTERS_V is a PL/SQL view owned by the APPS schema in Oracle E-Business Suite, delivered as part of the OKS – Service Contracts module. Its purpose is to present usage counter data associated with service contract counter groups and their underlying source objects. The view is defined as a UNION of two queries, allowing a single result set to combine counters whose source object is a customer product instance (code 'CP') with counters whose source object is a contract line (code 'CONTRACT_LINE').

From a reporting and integration standpoint, OKS_USAGE_COUNTERS_V provides a denormalized, read-only surface over the counter schema, exposing counter group and counter identifiers, descriptive names, measurement types, units of measure, accumulated net readings, and — most notably for users searching on value_timestamp — the point in time at which a counter reading was captured. This makes the view suitable for Service Contracts dashboards, usage-based billing extracts, and integration interfaces that need a consolidated counter snapshot without navigating the individual OKX and CSI base tables.

Underlying Base Objects

The documented ETRM metadata lists the following referenced objects beneath OKS_USAGE_COUNTERS_V: CSI_COUNTERS_B, CSI_COUNTERS_TL, CSI_COUNTER_ASSOCIATIONS, CSI_COUNTER_READINGS, CSI_ITEM_INSTANCES, CS_CSI_COUNTER_GROUPS, OKC_CONTEXT (package), OKC_K_HEADERS_V (view), OKC_K_LINES_V (view), OKC_UTIL (package), OKS_AUTH_UTIL_PVT (package), and OKX_SYSTEM_ITEMS_V (view). The view text itself joins the counter group and counter views — OKX_COUNTER_GROUPS_V and OKX_COUNTERS_V — with CSI_ITEM_INSTANCES for the product-instance branch, and with OKC_K_LINES_V and OKC_K_HEADERS_V for the contract-line branch. The system context value used in the instance branch, SYS_CONTEXT('OKC_CONTEXT', 'ORGANIZATION_ID'), is supplied by the OKC_CONTEXT package, which reflects the OKS authorization model surfaced through OKS_AUTH_UTIL_PVT.

Key Columns

  • COUNTER_GROUP_ID — Identifier of the counter group to which the counter belongs.
  • COUNTER_ID — Identifier of the individual counter.
  • NAME — Concatenation of the counter group name and counter name (CG.NAME || '.' || CT.NAME).
  • TYPE — Classification of the counter (for example, metered or non-metered).
  • UOM_CODE — Unit of measure associated with the counter reading.
  • NET_READING — The accumulated net reading value for the counter.
  • VALUE_TIMESTAMP — The timestamp at which the counter value or reading was recorded; this is the column most relevant to the "value_timestamp" search term.
  • SOURCE_OBJECT_ID / SOURCE_OBJECT_CODE — Identifier and type of the source object (instance or contract line).
  • USAGE_ITEM_ID — Identifier of the usage item tied to the counter.
  • SOURCE_DETAILS — Descriptive context: item name for instances, or line/contract number concatenation for contract lines.
  • CURRENT_SERIAL_NUMBER / REFERENCE_NUMBER — Instance serial number and instance number, populated only for the product-instance branch; NULL for contract-line counters.
  • TEMPLATE_FLAG — Indicates whether the counter group is a template.

Common Use Cases and Queries

Typical scenarios include extracting the latest counter readings per instance for usage-based billing, reconciling contract-line counters to their header contracts, and powering Service Contracts usage reports.

  • Retrieving counters with their reading timestamps for a serial number:

SELECT name, type, uom_code, net_reading, value_timestamp
FROM apps.oks_usage_counters_v
WHERE current_serial_number = :serial_number;

  • Identifying the most recent reading per counter:

SELECT name, MAX(value_timestamp) last_reading
FROM apps.oks_usage_counters_v
GROUP BY name;

  • Listing contract-line counters with source details:

SELECT name, source_details, value_timestamp
FROM apps.oks_usage_counters_v
WHERE source_object_code = 'CONTRACT_LINE';

Because the view enforces the organization context through OKC_CONTEXT, queries executed outside the Service Contracts responsibility may return restricted rows, and appropriate OKS security setup should be confirmed before integrating results.