Architecture

SMART-DB

Why putting the logic in the database makes every number defensible — and every new capability a change you can govern, version and review.

Six principles that move Oracle licensing intelligence out of application code and into the database engine — where it is faster, deterministic, auditable and far easier to extend.

S

Single source of truth

Data and logic live together in one PostgreSQL schema. There is no hidden calculation in the app, no duplicated rule, no drift between a report and its backing query.

For your audit: your DBA can reproduce the exact boardroom figure in psql — there is no black box to defend.

Implementation: 001.a001.r own the schema; the app only calls DB::select().

M

Multi-tenant by design

Every table carries a username holding the tenant's MD5 identifier, and every function filters on it. A strict role hierarchy — Super Admin > Admin > Client > User — keeps tenants isolated inside a shared database.

For compliance: tenant isolation is enforced at the data layer, so no cross-client leak is possible through the UI.

Implementation: username = login.identifier; sec_check() gates every call; roles S > A > C > U.

A

Analytics inside the engine

Coverage analysis, effective-processor resolution, edition and option costing, ROI and topology traversal are all PL/pgSQL functions. The heavy lifting happens next to the data, not over the wire.

For finance: one engine means consistent numbers across every report — no reconciliation between spreadsheets.

Implementation: 40+ rdb_calc_*() calculators, os_multiplier(), roi_*(); 80+ functions total.

R

Reactive by construction

Materialized views join raw inventory to the price list; triggers keep Fusion Middleware mappings consistent when contracts are inserted or deleted. Change the inputs and the analysis stays coherent automatically.

For procurement: change a contract and coverage updates itself — no stale report to chase down.

Implementation: contract_f_insert_trigger / contract_f_delete_trigger; materialized db, fmw_view.

T

Thin application layer

Laravel controllers do one thing: DB::select("SELECT * FROM schema.rdb(...)"). Business rules never leak into PHP. Swap the frontend, the API, or the language — the engine remains the contract.

For governance: the UI is replaceable; the audited truth stays in one governed place.

Implementation: controllers/services are wrappers only — the logic is in the function, not the framework.

D

Deterministic, testable SQL

Same inputs, same outputs, every time. Functions can be unit-tested, versioned and code-reviewed like any other source. No opaque agent, no proprietary black box — just SQL you can read.

For risk: every figure is repeatable and reviewable — defensible in front of an auditor or a board.

Implementation: SQL assertions in CI; modules independently versioned.

Data flow

From bare host to boardroom number.

Raw discovery flows through ingest functions into typed views, is analysed by cost engines, and finally surfaces through a thin rendering layer.

1 · Discover
DB + FMW + OS inventoryagentless, encrypted, no footprint
Workload over timehow hard each system really works
2 · Consolidate
Entitlement vs deploymentcontracts joined to real usage
Exposure surfacedunderused · overused · not covered
3 · Quantify
Annual savingsranked by financial impact
Payback & CapExmigration and consolidation cases
Risk matrixlikelihood × impact
4 · Decide
Audit evidence packrepeatable, checksummed, exportable
Renewal positionnegotiate from evidence
1 · Collect (agentless)
LMSCloudsingle bash file · built-ins only · root or sudo
WRT daemonDB / FMW / OS workload metrics over time
Encrypted outputAES-256 files, uploaded by your preferred method
2 · Ingest (never write raw tables directly)
mdb()databases + options + alerts
mfmw()middleware + auto-mapping
mos() / m_opl()servers · price list merge
3 · SMART-DB analysis
db · fmw_viewmaterialized views + core factors
rdb() · rfmw() · sdb()cost, coverage, what-if
roi_*() · granular_tree()ROI-* and hierarchy
4 · Present
Laravel servicesDB::select(...) — no business logic
Blade + vis.jscharts, tables, topology, reports
The engine room

Representative functions

A sample of the public functions the application calls. Internally, more than 130 functions and calculators compose to produce a single report row.

FunctionPurposeReturns
rdb(mode, username, location)Database licence cost: contracted vs deployed, by edition and optionSETOF trr
rfmw(mode, username, location)Fusion Middleware cost and coverage analysisSETOF trr
sdb(mode, username, location, edition)Simulated “what-if” database deployment costSETOF trr
roi_db / roi_fmw / roi_osROI-* module retrievers for database, middleware and server lensesROI rows
roots / leafs / max_levelNavigate the Region-DC-Env-App-Group location hierarchytree sets
os_multiplier(...)Resolve effective Oracle processors from sockets, cores and core factornumeric
granular_tree(...)Full hierarchy annotated with cost at every granularitySETOF trtreecost
sec_check(...)Validate caller permissions before returning tenant databoolean
Capability → evidence

What each engine buys you

Know what's uncoveredrdb('N', …)not-covered report
Price any optionrdb_calc_opt_*per-option €
See dependencygranular_tree()drill-down chart
Alert on driftadd_alert()severity inbox
What-if the cloudsdb()migration business case
Five commercial views

One parameter: A · C · U · O · N

  • A — All products, deployed and contracted
  • C — Coverage only items with anomalies
  • U — Underused contract cost > deployment cost
  • O — Overused deployment cost > contract cost
  • N — Not covered deployed but no contract
Schema layout

Ordered SQL source

001.a tables (25) 001.b sequences 001.c types + base utils 001.d views 001.e ingest: mdb/mfmw/mos 001.f aux: roots/leafs/os_multiplier 001.g contract triggers 001.h rdb_calc_* calculators 001.i rdb() · sdb() 001.j rfmw() 001.m roi_db/roi_fmw/roi_os 001.q granular_tree() 001.r sec_check()
Introspect

Every function is visible

-- list the engine surface
\df u1.*

-- reproduce a report row
SELECT * FROM u1.rdb(
  'C', :tenant, :location
);

Filter topofmw by location; refresh materialized db/fmw_view before reporting.

Comparison

Vendor review vs your own evidence.

Agent-based SAM vs SMART-DB.

Spreadsheet / vendor review

  • Position estimated, then defended after the fact
  • Weeks to answer a simple coverage question
  • Discovery shaped by the vendor's own worksheet
  • Data handed outside your perimeter
  • Number changes with whoever built the sheet
  • No view of migration effort per system
  • Extension means another vendor engagement

LMS Cloud

  • Per-instance trr rows, reproduced on demand
  • Coverage answer in seconds from the engine
  • You generate your own deep discovery input
  • Self-hosted — data never leaves your perimeter
  • Deterministic SQL — same inputs, same figures
  • Dependency and effort visible per server/database
  • Extend with an ROI-* module your team writes

Typical agent-based tool

  • Install a component on every server
  • Create a monitoring user in every database
  • Requires network access to all hosts
  • Vendor review-file driven discovery
  • Business logic hidden in the application
  • Hard to extend without vendor involvement
  • Licence data leaves your perimeter

SMART-DB

  • One bash file, built-ins only, nothing installed
  • No database users created
  • Works in segmented, unreachable networks
  • Generates its own deep discovery input
  • Logic lives in auditable PL/pgSQL (rdb())
  • Extend by shipping a module.json
  • Self-hosted — data never leaves your perimeter
Return on investment

When does the change pay for itself?

Where the compute time actually goes.

Payback is modelled from the same cost rows the coverage report uses — no separate spreadsheet.

A single report row composes ~130 functions; the trace shows the breakdown you can optimise.

Payback

Break-even at month 14

break-even · m14
m0m6m12m18m24

Cumulative savings reach €682k by month 24, sourced from payback_history + roi_db/roi_fmw/roi_os.

Scenario inputs

What drives the curve

  • Consolidate 12 underused DBs — mode U
  • EE → SE2 for 7 QA databases — edition calculator
  • Retire 3 Exadata half-racks — appliance model
  • Reclaim unused options rdb_calc_opt_*
Call trace

rdb('C', tenant, location)

sec_check() 0.3 ms roots()/leafs() 1.1 ms db view 8.4 ms os_multiplier() 0.2 ms 40× rdb_calc_*() 96 ms ───────────────────────────────── total ~106 ms
Snapshot source

payback_history

Each payback run stores snap_id, username, location, total_licensing_cost and total_deployment_cost, so the payback curve and the audit snapshot diff come from the same table.

See how a module plugs in.

The ROI-* module system turns Oracle licensing coverage into something your team can extend without touching the core.