Friday, August 18, 2023

Table Values Constructor in Oracle Database 23c

Table Values Constructor in Oracle Database 23c

The table values constructor allows us to define multiple rows using a single constructor for use in SQL statements.

Setup


The following table is required to run the examples in this article.

drop table if exists t1;

create table t1 (
  id number,
  code varchar2(6),
  description varchar(25),
  constraint t1_pk primary key (id)
);

INSERT


The table values constructor allows us to insert multiple rows into a table in a single step.

insert into t1
values (1, 'ONE', 'Description for ONE'),
       (2, 'TWO', 'Description for TWO'),
       (3, 'THREE', 'Description for THREE');

commit;


select * from t1;

        ID CODE   DESCRIPTION
---------- ------ -------------------------
         1 ONE    Description for ONE
         2 TWO    Description for TWO
         3 THREE  Description for THREE

SQL>

That's a single network round trip without having to combine all the insert statements into a PL/SQL block.

SELECT


The same type of table values constructor can be used in the FROM clause of a SELECT statement. Notice we have to alias the column names so they are presented correctly.

select *
from   (values
          (4, 'FOUR', 'Description for FOUR'),
          (5, 'FIVE', 'Description for FIVE'),
          (6, 'SIX', 'Description for SIX')
       ) a (id, code, description);

        ID CODE DESCRIPTION
---------- ---- --------------------
         4 FOUR Description for FOUR
         5 FIVE Description for FIVE
         6 SIX  Description for SIX

SQL>

WITH Clause


The table values constructor can be used as part of a WITH clause.

with a (id, code, description) AS (
  values (7, 'SEVEN', 'Description for SEVEN'),
         (8, 'EIGHT', 'Description for EIGHT'),
         (9, 'NINE', 'Description for NINE')
)
select * from a;

        ID CODE  DESCRIPTION
---------- ----- ---------------------
         7 SEVEN Description for SEVEN
         8 EIGHT Description for EIGHT
         9 NINE  Description for NINE

SQL>

MERGE


The table values constructor can be used as the source data for a MERGE statement.

merge into t1 a
  using (values
          (4, 'FOUR', 'Description for FOUR'),
          (5, 'FIVE', 'Description for FIVE'),
          (6, 'SIX', 'Description for SIX')
        ) b (id, code, description)
  on (a.id = b.id)
  when matched then
    update set a.code        = b.code,
               a.description = b.description
  when not matched then
    insert (a.id, a.code, a.description)
    values (b.id, b.code, b.description);

3 rows merged.

SQL>

select * from t1;

        ID CODE   DESCRIPTION
---------- ------ -------------------------
         1 ONE    Description for ONE
         2 TWO    Description for TWO
         3 THREE  Description for THREE
         4 FOUR   Description for FOUR
         5 FIVE   Description for FIVE
         6 SIX    Description for SIX

6 rows selected.

SQL>

rollback;

Source: oracle-base.com

Wednesday, August 16, 2023

Using JSON documents and don’t know what you’re looking for? 23c Search Indexes to the rescue

JSON Documents, Oracle Database Career, Oracle Database Skill, Oracle Database Jobs, Oracle Database Prep, Oracle Database Preparation, Oracle Database Tutorial and Materials, Oracle Database Guides Exam

Introduction


Oracle has powerful capabilities for handling JSON. It also has flexible capabilities for full-text searching, like keyword search, phrase search, or proximity search. We're going to see how these capabilities meet in the JSON search index to provide the powerful functionality of full text search in an optimized manner for all your JSON documents.

What are text indexes?


In its basic form, a text index allows you to create a word-based index on a textual field in the database. It is then possible to search the table for fields containing particular words or phrases.


Let's say we have a table emp which contains some employee details:

create table emp(name varchar2(40), salary number, qualifications varchar2(200));
insert into emp values ('John', 1500, 'PhD in physics, Msc Math');
commit;

In 23c I would create a text index on that table using:

create search index emp_qual on emp(qualifications);

In earlier versions I would do:

create index emp_qual on emp(qualifications) indextype is ctxsys.context;

After having created my text index, I can search it using a CONTAINS query, such as:

select * from emp where contains(qualifications, 'physics') > 0;

That’s the simplest example of how to use a text index. That search is looking for the word “physics” somewhere in the qualifications field. The query could be much more complex – we’ll see a few more advanced examples when we look at JSON_TEXTCONTAINS in a moment.

What’s special about a Search Index?


On the face of it, we might think that we could just do a substring search on the qualifications field to look for the word ‘physics’. But substring searches are quite limited

  • They can’t use an index
  • They are case-sensitive
  • Punctuation and spacing will affect the searches
  • We can’t do  oolean searches such as AND, OR or NOT within the substring search itself, we’d have to do multiple searches which would get very inefficient

Having a search index means that each word in our text has its own index entry, so we are able to rapidly find references to individual words or phrases, or boolean combinations of words, without having to scan the original text.

What are JSON indexes?


JSON Documents, Oracle Database Career, Oracle Database Skill, Oracle Database Jobs, Oracle Database Prep, Oracle Database Preparation, Oracle Database Tutorial and Materials, Oracle Database Guides Exam
Now let's say our employee data was stored as JSON, and we need to search using salary ranges. For small numbers of rows, a full scan of the JSON will be plenty fast enough, especially if we're using the binary JSON datatype in 21c/23c.

create table empj(empdata json);

insert into empj values ('{ "name":"john", "salary":1500, "qualifications": "PhD in physics, Msc Math"}');

insert into empj values ('{ "name":"bobby", "salary":900,
"qualifications": "Msc Math", "hobbies": "physics" }');

commit;

select * from empj e where e.empdata.salary.number() > 1000;

But what if we have a very large number of rows in our JSON table? In that case, we'll want to create an index on the salary element of the JSON:

create index emp_salary on empj e(e.empdata.salary.number());

But … what if we don't know what fields we need to search? Or we do know, but we want to do word-based searches on those fields? Ultimately, JSON data is flexible and does not have a static, fits-all schema definition like our relational table before.

Both of these problems are solved with a JSON Search Index. A JSON search index indexes all the data in a JSON object, without having to pre-declare any data types or even to know the attributes in your documents. It’s all JSON. Not only does it index your JSON documents in the most efficient manner, it provides full text search capabilities with this index.

OK ... I need a JSON search index. How do I create one?


Creating a JSON search index is as easy as this:

create search index emp_search on empj(empdata) for json;

With this JSON search index you killed two birds with one stone: First, you have an index for a ‘normal’ JSON search like our salary example before, as seen in the explain plan:

explain plan for select * from empj e where e.empdata.salary.number() > 1000;

select * from table(dbms_xplan.display);

------------------------------------------------------------------------------------------
| Id  | Operation                   | Name       | Rows  | Bytes | Cost (%CPU)| Time     |
------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT            |            |     1 |  4114 |     4   (0)| 00:00:01 |
|*  1 |  TABLE ACCESS BY INDEX ROWID| EMPJ       |     1 |  4114 |     4   (0)| 00:00:01 |
|*  2 |   DOMAIN INDEX              | EMP_SEARCH |       |       |     4   (0)| 00:00:01 |
------------------------------------------------------------------------------------------

The line with Id=2 shows that we are using a 'domain index' for the search - that's our JSON search index being used to speed up access to the2 salary field - even though we didn't specify that we wanted to specifically index that field.

Second, your JSON search index also allows for full-text search on all string fields within the JSON. We would do that using the JSON_TEXTCONTAINS operator, which takes the column name, a JSON path for where to search, and a full text search expression as arguments. For example:

select e.empdata.name from empj e
where json_textcontains(empdata, '$', 'physics');

NAME
--------------------------------------------------------------------------------
"john"
"bobby"

The '$' in there represents the root, or base of the JSON document (it's a "JSON path expression" if you want to look up more detail) and means we should search for the word 'physics' anywhere in the JSON document. If we wanted to search a particular part of the document, say "qualifications", we could express that as a path instead:

select e.empdata.name from empj e
where json_textcontains(empdata, '$.qualifications', 'physics');

NAME
--------------------------------------------------------------------------------
"john"

That is the power of JSON Search Indexes. Depending on your ‘search space’ – the whole document or a specific attribute – the JSON search index is speeding up your request.

We could have done that with a simple JSON equality operator and some wildcards, but it would not have been fast on a large collection. And we certainly couldn't have done more complex searches like:

select e.empdata.name, e.empdata.qualifications from empj e
where json_textcontains(empdata, '$.qualifications', 'physics AND msc math');

NAME      QUALIFICATIONS
_________ _____________________________
"john"    "PhD in physics, Msc Math"

Meaning "the qualifications field contains the single word "physics" and the contiguous phrase "msc math". Nor could we do a 'fuzzy' search such as:

select e.empdata.name, e.empdata.qualifications from empj e
where json_textcontains(empdata, '$.qualifications', 'fuzzy(phisiks'));

NAME      QUALIFICATIONS
_________ _____________________________
"john"    "PhD in physics, Msc Math"

Very useful if you're unsure of your spelling, or that of whoever created the JSON in the first place. The JSON search index comes to the rescue and you’ll find what you’re looking for!

We can even do relevance ranking in 23c with JSON_TEXTCONTAINS. Let's add a couple more JSON documents to our table:

insert into empj values ('{ "name":"bill", "salary":1000, "qualifications": "Math professor"}');

insert into empj values ('{ "name":"mike", "salary":2000, "qualifications": "Physics student"}');

commit;

We'll need to issue a COMMIT and wait two or three seconds for our index to get updated, then we can run a query with a SCORE. Note the extra final argument to JSON_TEXTCONTAINS - that's a number which associates the SCORE() function with this particular JSON_TEXTCONTAINS.

select score(1), e.empdata.name, e.empdata.qualifications from empj e
where json_textcontains(empdata, '$.qualifications', 'math ACCUM physics', 1)
order by score(1) desc;

The ACCUM operator guarantees that if both terms are found, the record will score higher than if only one term is found. There can be more than two terms, and the higher number of terms found will always score higher. So the query above gives us:

SCORE(1)    NAME       QUALIFICATIONS
___________ __________ _____________________________
         52             "john"      "PhD in physics, Msc Math"
          2              "bobby"    "Msc Math"
          2              "bill"         "Math professor"
          2              "mike"     "Physics student"

The absolute value of the score is not that important - it's not something we'd generally show to the user. Instead it is used, as here, to order the results according to their relevance. You find what you are looking for easily, with the help of JSON Search Indexes.

Source: oracle.com

Monday, August 14, 2023

Third Quarterly Update on Oracle Graph (2023)

Oracle Graph, Oracle Java, Oracle Java Career, Oracle Java Skills, Oracle Java Jobs, Oracle Java Prep, Oracle Java Preparation, Oracle Java Tutorial and Materials, Oracle Java Guides, Oracle Java Learning, Oracle Java Certification, Oracle Java Graph

The graph features of Oracle Database enables developers to store and navigate relationships between entities. Oracle Graph Server and Client enables developers, analysts, and data scientists to use graphs within Oracle Database, while Graph Studio in Oracle Autonomous Database removes barriers to entry by automating setup and management, automating graph creation, and by providing step-by-step examples for getting started.

The last quarterly update on Oracle Graph, announced the availability of Oracle Graph Server and Client 23.2. That release included changes to the graph visualization app, updates to PGQL, and integrations of Oracle Graph with other services. The graph visualization app was updated to support SQL property graphs, which are available through Oracle Database 23c Free – Developer Release.   SQL Property Graphs enable creation and query of graphs using new syntax in the SQL 2023 standard. It also included additional functionality through PGQL, and updates that closely align PGQL with the SQL standard. Lastly, there were enhancements to the integrations with PyPi, SQL Developer and OCI Data Science.

Oracle Graph Server and Client 23.3 is now available for download for use with databases in the Cloud (OCI Marketplace image is available) and for databases on-premises. This release includes a number of new features, including the simplified install and use of the graph visualization tool, updates to PGQL, and RDF feature enhancements. The graph visualization REST API was also updated to streamline authentication and run PGQL queries through the JSON body, rather than as an encoded URL. More information on the REST API will be available in a future post.

Simplified Installation and Use of the Graph Visualization Tool


Configuration is now simplified, and there is also a single login screen for visualizing graphs in the database and in the graph server.

Oracle Graph, Oracle Java, Oracle Java Career, Oracle Java Skills, Oracle Java Jobs, Oracle Java Prep, Oracle Java Preparation, Oracle Java Tutorial and Materials, Oracle Java Guides, Oracle Java Learning, Oracle Java Certification, Oracle Java Graph

Once authenticated, on Oracle Database 19c, you will see separate tabs for querying graphs in the Graph Server and PGQL Property Graphs in the database. On Oracle Database 23c Free – Developer Release, you will see separate tabs for the  Graph Server, PGQL Property Graphs in database and SQL Property Graphs in database. This simplifies the transition between running graph queries in the database and in the Graph Server.

Oracle Graph, Oracle Java, Oracle Java Career, Oracle Java Skills, Oracle Java Jobs, Oracle Java Prep, Oracle Java Preparation, Oracle Java Tutorial and Materials, Oracle Java Guides, Oracle Java Learning, Oracle Java Certification, Oracle Java Graph

Oracle Graph, Oracle Java, Oracle Java Career, Oracle Java Skills, Oracle Java Jobs, Oracle Java Prep, Oracle Java Preparation, Oracle Java Tutorial and Materials, Oracle Java Guides, Oracle Java Learning, Oracle Java Certification, Oracle Java Graph

PGQL Updates


The newest updates enhanced support for LATERAL subqueries. LATERAL subqueries allow for passing the output rows of one query into another by projecting any number of columns to be used by the outer query. This release includes the ability to use LATERAL subqueries when running PGQL queries in the database. Lateral subqueries can now be mixed with any number of MATCH clauses per FROM clause and is supported inside EXISTS / scalar subqueries.

Oracle Graph, Oracle Java, Oracle Java Career, Oracle Java Skills, Oracle Java Jobs, Oracle Java Prep, Oracle Java Preparation, Oracle Java Tutorial and Materials, Oracle Java Guides, Oracle Java Learning, Oracle Java Certification, Oracle Java Graph

This release also adds support for LATERAL subqueries in the graph visualization tool, so you can visualize the results of your LATERAL subqueries.

Oracle Graph, Oracle Java, Oracle Java Career, Oracle Java Skills, Oracle Java Jobs, Oracle Java Prep, Oracle Java Preparation, Oracle Java Tutorial and Materials, Oracle Java Guides, Oracle Java Learning, Oracle Java Certification, Oracle Java Graph

RDF Feature Updates


This release adds support for creating a data source with credentials using RDF Server and adds support for GeoJSON. Creating a data source with credentials will allow you to establish secure connections to your data, ensuring efficient access to these resources.

Oracle Graph, Oracle Java, Oracle Java Career, Oracle Java Skills, Oracle Java Jobs, Oracle Java Prep, Oracle Java Preparation, Oracle Java Tutorial and Materials, Oracle Java Guides, Oracle Java Learning, Oracle Java Certification, Oracle Java Graph

With the GeoJSON integration, you will be able to visualize and analyze location-based information from your RDF data.

Oracle Graph, Oracle Java, Oracle Java Career, Oracle Java Skills, Oracle Java Jobs, Oracle Java Prep, Oracle Java Preparation, Oracle Java Tutorial and Materials, Oracle Java Guides, Oracle Java Learning, Oracle Java Certification, Oracle Java Graph

Source: oracle.com

Friday, August 11, 2023

Integrating Helidon and WebLogic Microservices with Oracle MicroTx

Introduction


More and more businesses are adopting microservices. This may be for green field developments where everything can start as a microservice. Or it may be building microservices that need to interact with or leverage existing, typically monolithic applications. Few companies can afford to build completely net new microservice based applications to replace their existing applications. The best alternative is to create new features using microservices and capitalize on the existing application until it can be replaced, in whole or piecemeal. 

In this post, I’ll cover a use case where an existing money management application already exists built using Oracle WebLogic Server. While this example will use JAX-RS and JPA, JDBC as well as EJB or JMS based applications can also be integrated by providing a JAX-RS interface to those applications.

Here is a diagram of the sample application that will be covered in this post:

WebLogic Microservices, Oracle MicroTx, Oracle Database Certification, Oracle Database Tutorial and Materials, Oracle Database Career, Oracle Database Skills, Oracle Database Jobs, Oracle Database Preparation Exam

Understanding the Sample


The basic scenario is an existing WebLogic Server JAX-RS JPA based web application that manages account balances and can have funds deposited to or withdrawn from that balance. A new application is being created using microservices that needs to integrate with this existing WebLogic application. These new microservices are written in Java using Helidon. They provide deposit and withdrawal services.

The issue now is how can one ensure that operations such as transferring funds, to or from, the existing application and the new microservices occur atomically? Fundamentally this is a dual write problem where the write to the source account and the destination account must both succeed or both fail. This is where distributed transactions come into the picture. Normally in WebLogic applications, the internal WebLogic Java Transaction Service is used. It provides XA distributed transaction support across multiple resource managers as well as across WebLogic applications deployed in other WebLogic servers. It can also support transactions spread across other application servers when using SOAP based web services with WS-AtomicTransaction and associated protocols. However, managing transactions that span other technologies, such as Helidon or Node.js or when using REST based services requires another solution.

This is where the Oracle Transaction Manager for Microservices (MicroTx) comes into the picture. MicroTx provides an external transaction coordinator for REST based services. Using MicroTx, the existing WebLogic application with some minor configuration change can be integrated with the new Helidon based microservices while ensuring transactional integrity across the participating systems. 


With MicroTx, a microservice can start a transaction and call other microservices that should be included in the transaction. This sample application shows one Helidon microservice that is acting as a sort of bank teller. The teller microservice allows a user to request that funds be transferred from one account to another account. However, those accounts may be held in different systems using different frameworks or languages. In this case, one account is provided by the WebLogic application, and the other is a new microservice running in Helidon.

For a JPA based application like the WebLogic sample application for MicroTx, no code changes are required, just some additional configuration to include the MicroTx client library and define a single property. 

This diagram shows how filters are used to propagate transaction context from one microservice to another.

WebLogic Microservices, Oracle MicroTx, Oracle Database Certification, Oracle Database Tutorial and Materials, Oracle Database Career, Oracle Database Skills, Oracle Database Jobs, Oracle Database Preparation Exam

Once these configuration changes are made, the application can participate in distributed transactions that are managed by MicroTx.

For the new Helidon teller microservice, which we call the initiator as it’s the one initiating the transaction, all that is required is to include the MicroTx client library and add the @Transactional annotation:

@Transactional(Transactional.TxType.REQUIRED)

on the method handling the transfer function. This annotation tells MicroTx that this method must be part of a transaction and begins a new transaction if one is not already present. In addition, if the method returns successfully, then the transaction is automatically committed by MicroTx. If the method generates an exception, the transaction is automatically rolled-back.

When the teller microservice makes a REST call to withdraw money from one of the participants, the MicroTx client library filters add headers to the outbound REST request to indicate to the participant that it should participate in the transaction. The incoming filters in the participant then enlist the participant in the transaction by calling the MicroTx coordinator and establish a transaction context in the participant.

Once the teller microservice has decided the transaction should be committed, it returns success which causes the MicroTx library to ask for the transaction to be committed by calling the transaction coordinator. The transaction coordination service then calls back to each of the enlisted participants to ask them to prepare. If that succeeds, it then asks all the participants to commit. If one or more of the participants cannot prepare, or the initiator decides to abort the transaction, the transaction will be rolled-back. Otherwise, the transaction will be committed. The initiator can abort the transaction by throwing an exception.

This overall flow is shown in this diagram:

WebLogic Microservices, Oracle MicroTx, Oracle Database Certification, Oracle Database Tutorial and Materials, Oracle Database Career, Oracle Database Skills, Oracle Database Jobs, Oracle Database Preparation Exam

In the transaction flow depicted above, MicroTx manages the details of distributed transaction processing so that the application developer does not have to. The interactions in green are completely handled by the MicroTx library. From a developer point of view, MicroTx makes this easy. Use an annotation within Helidon, and configuration within WebLogic Server, and MicroTX will manage the distributed transactions for you.

Note that this is a bit different than the way XA transactions are normally handled. In the typical XA transaction manager implementation, the transaction manager has its own connections to the resource manager. Which means the transaction manager needs its own credentials as well as the appropriate client library for the resource manager. To allow the MicroTx transaction manager to support any resource manager, it proxies its requests to the participant, which already has a connection to the resource manager. This makes the MicroTx transaction coordinator largely resource manager agnostic.

Source: oracle.com

Friday, August 4, 2023

Introducing the Oracle Database Error Help Portal

In a continuous effort to increase user productivity, we are pleased to introduce the new Error Help Portal for Oracle Database, which will help users gain faster and improved insights into Oracle Database errors.

You can easily access the new portal via https://docs.oracle.com/error-help/db/ and the Oracle Database Documentation landing page:

Oracle Database, Oracle Database Career, Oracle Database Skills, Oracle Database Jobs, Oracle Database Prep, Oracle Database Preparation, Oracle Database Tutorial and Materials, Oracle Database Guides

Normalized URLs


The Error Help Portal utilizes a normalized URL scheme, meaning that each error message can be quickly accessed by typing the correct error message number into the URL itself, for example:


Oracle Database, Oracle Database Career, Oracle Database Skills, Oracle Database Jobs, Oracle Database Prep, Oracle Database Preparation, Oracle Database Tutorial and Materials, Oracle Database Guides

Users will also note that starting with Oracle Database 23c, tools will automatically generate these URLs for errors encountered, making the error message documentation one click away.

Improved overview and reader experience


Unlike the error message book in previous releases of the Oracle Database Documentation, the portal presents each error message on a single web page, providing a better reader/user experience. On each page, users can quickly identify the Oracle Database release that the error message is applicable, when the page was last updated, the error message itself, and its Cause and recommended Action for the user to take.

Oracle Database, Oracle Database Career, Oracle Database Skills, Oracle Database Jobs, Oracle Database Prep, Oracle Database Preparation, Oracle Database Tutorial and Materials, Oracle Database Guides

Previous Releases


Users may note that some error message text and the cause and action appear different in the Error Help Portal than those raised by the current version of Oracle Database. As part of Oracle’s continuous initiative to further enhance user productivity, Oracle also continues to improve the error messages raised by Oracle Database to be more meaningful, actionable, and clear to the end user.

To avoid potential confusion for the end user, the Error Help Portal still shows the error message text as it would appear for the supported Previous Releases:

Oracle Database, Oracle Database Career, Oracle Database Skills, Oracle Database Jobs, Oracle Database Prep, Oracle Database Preparation, Oracle Database Tutorial and Materials, Oracle Database Guides

Error message text parameters


Another improvement overall is that variable values inside error message texts, sometimes referred to as the error message parameters, are also documented, helping users to better understand what the values produced by error messages signify.

Users will notice that some error message texts shown in the portal contain words in italics indicating the use of such error message parameters and the bulleted list below the error message provide further explanation for each of these:

Oracle Database, Oracle Database Career, Oracle Database Skills, Oracle Database Jobs, Oracle Database Prep, Oracle Database Preparation, Oracle Database Tutorial and Materials, Oracle Database Guides

Additional information


For error messages that require additional information or context to the user, a new Additional Information section below the Cause and Action will be shown:

Oracle Database, Oracle Database Career, Oracle Database Skills, Oracle Database Jobs, Oracle Database Prep, Oracle Database Preparation, Oracle Database Tutorial and Materials, Oracle Database Guides

For the savvy user


Savvy users may have already spotted that the normalized URL can be used with the site search feature of popular browsers like Chrome, hence providing a mechanism where you can type in only a shortcut and the error message number in the browser URL field to find the documentation page:

Oracle Database, Oracle Database Career, Oracle Database Skills, Oracle Database Jobs, Oracle Database Prep, Oracle Database Preparation, Oracle Database Tutorial and Materials, Oracle Database Guides

Here is how you do that for Chrome:

1. Head to Settings --> Search engine --> Manage search engines and site search

2. Scroll down to Site search and click the Add button.

Add a new Search Engine with your favorite name, your shortcut (the screenshot above used "err") and paste the following URL into the URL field: "https://docs.oracle.com/error-help/db/%s/"

Oracle Database, Oracle Database Career, Oracle Database Skills, Oracle Database Jobs, Oracle Database Prep, Oracle Database Preparation, Oracle Database Tutorial and Materials, Oracle Database Guides

3. Click Save and close the Settings page.

From now on, when you type "err" (or the shortcut character(s) you have chosen) in the URL bar and click Tab, any error numbers that you type into the URL field will be added to the Error Help Portal URL and bring you straight to the Error Message page.

Feedback wanted!


The Oracle Database Documentation team is actively looking for feedback. If you found something missing, wrong, or something that could be improved, please look for the "Thumbs Up" icon at the bottom of the page, hover over it and click the "Thumbs Up" or "Thumbs Down" icon.

Oracle Database, Oracle Database Career, Oracle Database Skills, Oracle Database Jobs, Oracle Database Prep, Oracle Database Preparation, Oracle Database Tutorial and Materials, Oracle Database Guides

Either button will open a new window with a text box where you can provide further information to the Oracle Database Documentation team. Please take the extra time and fill out the box, as it will help us better understand how to improve the error message and Error Help Portal. We already thank you for your feedback!

Oracle Database, Oracle Database Career, Oracle Database Skills, Oracle Database Jobs, Oracle Database Prep, Oracle Database Preparation, Oracle Database Tutorial and Materials, Oracle Database Guides

The road ahead


Oracle is actively working on enhancing error messages and the Error Help Portal. This will remain a continuous task throughout database releases. Users may find that some error messages still need to reflect all the new Error Help Portal features. Please be patient and use the feedback mechanism to help us prioritize. We strive to provide the best possible experience, which takes time and effort.

Our goal is to expand the portal to other Oracle products too, which is why you see a product name already today inside the normalized URL.

We hope that the new Error Help Portal will aid users in quickly finding the reasons and solutions for the errors they encountered and that it will help them become even more productive.

Source: oracle.com

Wednesday, August 2, 2023

Transforming the organ matching and transplant journey with OCI Data Platform

In 2022, 4,111 heart transplants were performed in the US, averaging 29 transplants in 144 centers. More than 3,500 people wait for a new heart with 1 in 12 deaths. Every transplant is priceless, yet the promise is sacrificed with delayed recovery times, suboptimal matches, inadequate patient data, and transport logistics. The Organ Procurement and Transplantation Network (OPTN) is a public-private partnership that links all professionals, individuals, and volunteers who support the US donation and transplantation system. OPTN membership constitutes transplant centers, organ procurement organizations (OPOs), histocompatibility laboratories, public organizations, medical scientific members, and business and individual members. The United Network for Organ Sharing (UNOS) was awarded the initial OPTN contract on September 30, 1986 and continues to administer the OPTN today.

The OPTN calls for an integrated real-time, dynamic system with the following capabilities and features:

  • Extracts donor and recipient data from electronic health recovery (EHR) provider systems, such as EPIC and Cerner, and other patient-provider registries
  • Standardizes donor and recipient data to form a complete patient longitudinal record
  • Deidentifies the donor and recipient patient data
  • Algorithmic organ data matching, considering only medical and logistical criteria
  • Ensure timely and accurate organ delivery and monitoring
  • Real-time geolocation, rerouting, and organ matching based on organ viability
  • Historical data analytics capabilities for organizations and partners

Achieving all these goals requires a modern healthcare industry-compliant data platform to fulfill and scale these tasks efficiently and effectively.

Oracle Database, Oracle Database Career, Oracle Database Skills, Oracle Database Jobs, Oracle Database Preparation, Oracle Database Guide, Oracle Database Tutorial and Materials

OCI architecture


The following diagram shows the architecture and key components of Oracle Cloud Infrastructure (OCI)’s solution to these issues:

Oracle Database, Oracle Database Career, Oracle Database Skills, Oracle Database Jobs, Oracle Database Preparation, Oracle Database Guide, Oracle Database Tutorial and Materials

Key components


Data acquisition

The correct identification of data sources provides the foundation block for data acquisition, consisting of the following parts:

  • Donor and transplant candidate patient EHR data. The data is usually distributed across multiple providers, EHR systems, and donor registries. OPO donor registries provides the required filtration to pull EHR data for donors only.
  • Transplant candidate or recipient data also follows the same process, but recipient-specific registries might not be maintained.
  • Radiology data sources provides annotated images related to the donor
  • Organ tracking sensors provides real-time streaming geolocation and organ vitality during transport.

This process uses the following data platform features:

  • Encrypted and secured ingestion of data
  • Industry standard complaint data formats, such as HL7 and FHIR
  • Industry standard acquisition protocols, such REST and MQTT
  • Industry standard tools, such as Oracle Integration Cloud (OIC), Oracle streaming, and Oracle internet of things (IOT)

EHR data standardization

Data standardization transforms EHR input data into common representations with a single, consistent view of the patient longitudinal record from data stored across disparate systems. Data standardization has the following key elements:

  • Accurately compare data between systems
  • Parsing individual data elements to a common format
  • Data cleansing
  • Normalization (converting nicknames and short names to standardized names)
  • Data typing standardized into a common data type
  • Phonetic encoding, such as common names based on sound

Common popular standardization frameworks include the following examples:

  • Finite state machine (FSM) framework: Process encompassing multiple states where configurable rules are applied on each state. FSM includes steps like cleansing, tokenization, parsing and ambiguity resolution.
  • Patterns based framework: Process defined in configurable dictionaries enabling detectable patterns by data types. Typical steps include parsing, data type identification, normalization, and patterns resolution.

Published by HL7, Fast Healthcare Interoperability Resources (FHIR) is a standard for healthcare data exchange that supports web exchange standards formats like XML, JSON, HTTP, OAuth with RESTful architectures, and service-based architectures. Oracle Healthcare data repository and Oracle Health Master Person Index (OHMPI) provides a way to use FHIR to create patient longitudinal record efficiently and accurately.

Patient data deidentification

Patient health information (PHI) deidentification is not only required for medical research studies, comparative effectiveness studies, and policy assessments, but also in PHI agnostic matching, such as organ matching. Common industry practices include the following examples:

  • Safe-harbor method: Remove standard PHI attributes (About 18 types) such as names, identifiable numbers such as phone, account, biometric identifiers, full face photos, and license numbers. The process is widely followed and easier to automate and implement.
  • Expert determination: Requires that a healthcare statistical expert can corelate risks associated with identified attributes to justify its removal. This process is more time- and resource-intensive, custom, and provides greater accuracy.

Multiple implementations convert healthcare data into a common FHIR formats before turning it to a deidentification engine that uses the safe-harbor method for deidentification. Typical tools for deidentification consist of data redaction, dateshift, perturb, cryptohash, encrypt, substitute, and generalize.

A different method involves deidentification at the FHIR layer, which is more secure. This process involves deidentification at rest at the database or store level. Open source BERT transformer models like BioBert pretrained models, trained on several medical corpora like journals, medical articles, and publications of medical research, provide context-aware embeddings, and PHI named entity recognition (NER) can be used to clean or mask PHI identifiers.

Typically, OCI Data Science tools like OCI Autonomous Data Warehouse or OCI AI Language services and OCI Data Science platform are geared for open source deidentification processes and customizations to produce the desired outcome.

Organ matching and continuous improvement

Important key factors for matching are not only the medical factors like blood type, height, weight, and organ size but also geolocation distance between the donor and recipient, organ life, and the transport time. The organ matching process must include real-time, automated, and flexible outcomes, matching across many recipients requiring a continuous allocation process instead of a categorical with a few data points. The computation of a real-time predictive matching score must consider between continuously data updates from EHRs, geo-location, and organ vitality data streams and transplant candidate conditions.

Matching involves comparing specific fields in two standardized records and returning a weight that indicates the likelihood of a match between the two records. A higher weight between two records indicates a greater likelihood of a match. Data matching can be either deterministic or probabilistic. In deterministic matching, either record unique identifiers are compared to determine a match or an exact comparison is used between attributes. Because this process has some limitations in a probabilistic matching, several field values are compared between two records and each field is assigned a weight that indicates how closely the two field values match. Custom matching thresholds, optimum or ceiling matching, and un-matching conditional probabilities—m-prob and u-prob—allow the process to specify the range of attributes that match most to least.

You can achieve data matching using two flavors of the OCI infrastructure presented in the architecture. You can implement and tune both to determine the optimal matching. Each process has the following key points:

  • Prebuilt matching using OHMPI
    • Provides generic data matching methodology with a match engine framework with a choice of customizable parameters and weights
    • The setup is low-code, quick, database centric, runs within an Oracle Database application and is configuration-driven.
  • Flexible custom matching at scale using Oracle Container Engine for Kubernetes (OKE) and DevOps containers

Messaging and notifications

With multiple systems like donor data ingestion, deidentification, and geolocation sensing interacting to provide a real-time organ matching scenario, the communication between these systems must be robust, resilient, native to the cloud, and follow a standard unified messaging protocol. OCI Events and Notification services hub and functions provide the necessary infrastructure. These service are compliant with the Cloud Native Computing Foundation (CNCF) industry standard and allow interoperability between systems within OCI and across OPOs and other external systems. Rules defined on OCI services emitting events trigger various workflow steps with OCI Functions and Notification services. Typical scenarios include the following examples:

  • Initiation of the donor or recipient ingestion based on donor organ availability by OPOs
  • Initiation of donor and recipient FHIR standardization process
  • Preparing deidentified data at donor and transplant candidate levels
  • Triggering organ matching process based on organ availability, geo-location, organ viability, and other attributes
  • Status update transplant candidate on organ match
  • Status update operational monitoring of the system

You can use OCI Functions and Notification for the following processes:

  • Customizing OHMPI and IOT ingestion and standardization using the product REST API interface
  • You can also use Functions if using container-based architectures for match runs.

Organ transportation and health monitoring

Real-time organ health monitoring at rest or in motion is essential to validate the actual life of an organ before a transplant. This method aids or eliminates the need for organ viability checks because it reaches the transplant surgeons hands. The delivery is performed with real-time analysis of organ vitality and geolocation data streamed from the organ transport containers. With a short organ vitality window, transplants today are restricted by short geolocation distances between donor and recipient. Also, rematching and rerouting based on organ vitality data aren’t typically performed but highly wanted.

This process requires the following factors:

  • An efficient sensor based container that can stream data to a cloud data lakehouse continuously
  • A cold chain logistics provider responsible for delivery to the last mile
  • An effective and integrated rematching and rerouting system to find the next transplant candidate if needed
  • The streaming system provides established interfaces, such as API, across different cold chain logistics transportation vendors.
  • Transportation firms, such as Fedex and UPS, can provide API-based organ vitality and geolocation data to be quickly consumed.

The IoT service is geared to provide the following benefits:

  • Flexibility in streaming device adaptation, such as a IoT-enabled gateway, directly connected gateway or third-party gateway
  • Ingesting and integrating data from a multitude of payloads and brokers, such as HTTP or MQTT
  • Connect to OCI using Oracle Integration Cloud (OIC) and Oracle Analytics Cloud (OAC) adaptors and REST API
  • Simulation match testing possibility using a digital twin scenario

Transplant research

Transplant research areas aim to understand best practices and improve performance with a goal to increase transplants. Data inputs such as organ offer outcomes, transplant operations benchmarks, Key indicators, compliance, and performance are several key areas outlined by UNOS. However, deidentified patient records, match run outcomes, and the streaming organ vitality attributes provide a unified data platform for the researchers to investigate further. The OCI Data Platform can provide the following features and benefits:

  • A deidentified dataset access for donors and transplant patients for research
  • Patient historical and longitudinal records and geolocation attributes
  • Match run outcomes, match criteria, and match history
  • Any organ vitality attributes of importance, such as temperature and pH
  • Post-transplant outcomes

OCI Data Platform aids researchers with predictive model-based and open source data tools, such as Oracle Data Science, Spark-based real-time analytics tools, such as OCI Data Flow, OCI Streaming, and in-database ML tools within OCI Autonomous Database. This availability facilitates researchers to perform analysis directly on live and current deidentified datasets to develop models, operationalize them to test model drifts and their efficacies, operate between the cloud and local laptops or other on-premises systems, and integrate with other public data sources or pretrained and developed models. OCI CPU, GPU, and high-performance computing (HPC) Compute shapes also facilitate researchers to large, simulated workloads.

Organ transplant analytics

UNOS currently publishes many analytic reports for OPOs and the community, including the following examples:

  • Transplant benchmark reports: Customizable comparative reports providing insights to population listing practices and transplant activity for UNOS members at regional and national levels
  • Organ offer outcomes: A dashboard for visualizing organ acceptance by donor type with transplant and aggregate specific outcomes
  • Transplant compliance and performance reports: Clarifies post-transplant outcomes, waitlist outcomes by transplant and mortality and demographic waitlist by diagnosis, active status, and medical urgency factors
  • Executive level measures: Waitlist additions and management, organ offer characteristics, transplants performed, post-transplant stay, 24-hour high-level indicators, and trends
  • Enhanced staffing survey and analytics: Staffing survey experience in conjunction with transplant administration

However, these reports lack the self-service, scalability, unification, and extensibility features that a modern cloud based data platform provides. OAC with Oracle Autonomous Database on OCI Lakehouse provides the following benefits:

  • Operational dashboard covering the end-to-end organ transplant process
  • Real-time insights from the matching process
  • Customizable predictive match model simulations to aid researchers
  • Descriptive and historical data analysis on transplants
  • Prebuilt and custom reports and automated delivery from a cloud analytics system

Key takeaways of using an enterprise data platform

Implementing an enterprise cloud-based health data platform in OCI offers the following benefits:

  • Tools and integrations: The right combination of prebuilt applications, data platform tools and services, and compute infrastructure is required for successfully operating a complex data platform. OCI offers the following advantages:
    • Health industry-specific, such as HL7, and other industry-standard data source integration support with OIC adapters
    • Streaming provider and device integration flexibility with out-of-the-box adapters with OCI IoT
    • Prebuilt, configurable data-matching algorithm implemented inside the database with OHMPI and Oracle Autonomous Database
    • A flexible platform to quickly deploy code and orchestrate at scale with OCI Kubernetes engine
    • An out-of-the-box cloud based prebuilt event and notification system implementable across the entire organ transplant data fabric
    • A configurable and cloud-based analytic dashboard, reporting, and delivery solution with OAC
    • A unified data catalog to maintain the source of truth across participating data members in the system
  • Prebuilt health industry and government certifications: With a data platform typically operating in a hybrid multicloud environment, healthcare attestations are required at various areas of data residency. OCI Data Platform can provide attestations along the cloud boundaries and inside. OCI provides HIPPA, HITRUST CSF, and FedRamp compliance attestations. 
  • Healthcare data standardizations: Healthcare data standardizations involve more than standardizing healthcare codes. They involve various data normalizations, configuring and customizing standard data quality practices, and evolution over time. Healthy standardization requires a mix of prebuilt, configurable, and customizable platform aspects where you can take on more development by sourcing various open source libraries. OCI provides seamless standardization across healthcare applications, FHIR at EHR data ingestion, and a platform to develop custom Python libraries.
  • Scalability, performance, and cost: The utility value of this system is best realized when it automatically scales maintaining the same or higher performance at a decreasing cost rate. OCI Data Platform offers the following benefits:
    • A unified object storage-based data lakehouse to ingest various types of unstructured data and scalable autonomous data warehouse
    • A customizable data retention and archival features with OCI Object Storage and automatically managed backups and patches with live relational data storage
    • A scalable compute infrastructure with a wide range of CPU and GPU Compute shapes
  • Unified integration of tools and services platform: Most enterprise data platform spans and integrates across EHR data providers and tools to provide for real-time delivery and monitoring needs. OCI provides the following features:
    • A multicloud data platform across multiple EHR providers, healthcare integrations such as HL7 and FHIR, and data access through REST APIs and HTTP.
    • OIC provides necessary data transformations and imputations during ingestion
    • A unified cloud native event and messaging system that can operate independently and securely in isolation and provide for the needed workflow dependencies
Source: oracle.com