Oracle Database Examples
repository·main·Indexed 23 days ago
https://github.com/oracle-samples/oracle-db-examplesA comprehensive collection of code examples for the Oracle Database ecosystem. Includes Oracle APEX REST Source Plug-Ins, APEX_DATA_EXPORT API implementations, C language samples using Oracle Call Interface (OCI) for connectivity and session pooling, and Exadata Exascale lab scripts for managing PDB states, services, and storage in RAC environments.
What's inside oracle-db-examples
- This project provides a small demonstration showing how expression statistics can be used to improve cardinality estimates within an Oracle Database environment. It is intended as an educational resource to illustrate the impact of expression statistics on the optimizer.
Overview of 23c-springboot3-jpa-ucp
mainThis project provides a demonstration of implementing Java Persistence using Spring Boot 3, Spring Data JPA with Hibernate, and the Oracle Database 23c Free (Developer Release). It is designed to show how these technologies integrate to manage data within an Oracle Database environment.Overview of Exadata Monitoring Dashboards
mainThe provided dashboards use Prometheus Query Language (PromQL) to visualize Exadata metrics. Note that these are example dashboards and are not fully supported.
Included dashboards:
- Exadata Cluster: A cluster-wide view for compute nodes and storage servers; serves as a navigation hub.
- Compute: Focuses on CPU and network utilization for compute nodes.
- Storage Server: Focuses on storage server CPU, I/O metrics, and Exadata-specific metrics (Smart Flash Cache, Smart Flash Log, and Smart I/O).
- Cell Disk: Displays cell disk I/O metrics on the storage server.
- Flash Cache: Displays flash cache metrics on the storage server.
- Smart Scan: Displays smart scan metrics on the storage server.
- Network: Focuses on network throughput.
Limitation: When viewing network statistics, Oracle Linux KVM guests do not show RDMA traffic. RDMA traffic is only available on bare metal and KVM hosts.
Overview of Oracle Machine Learning for R (OML4R)
mainOracle Machine Learning for R (OML4R) is a feature of Oracle Autonomous Database designed for scalable in-database data exploration, preparation, and machine learning. It allows users to use native R syntax to build and score models directly within the database, leveraging high-performance, parallel, and scalable in-database implementations of machine learning algorithms.
Key capabilities include:
- In-Database Processing: Perform data exploration, preparation, and model building using R syntax without moving data out of the database.
- Cross-Language Integration: Invoke user-defined Python functions from R, SQL, and REST APIs using database-spawned R engines.
- Scalability: Access over 30 parallel, scalable in-database machine learning algorithms.
- Scripting Support: Support for Python, R, SQL, and PL/SQL scripting languages.
Overview of Oracle Exadata Real-Time Insight
mainStarting with Oracle Exadata System Software 22.1, the Oracle Exadata Real-Time Insight feature enables real-time monitoring of Exadata systems. It provides the following capabilities:
- Categorize: Specific metrics can be marked as fine-grained, allowing collection as frequently as every second.
- Stream: Fine-grained metric observations can be streamed to user-defined locations using either a push (upload) or pull (download) transmission model.
- Integrate: Exadata metrics can be integrated with observability platforms, time-series databases, and visualization applications.
Overview of Streaming DBMS_OUTPUT
mainStandard
DBMS_OUTPUTin Oracle has a limitation where all output is buffered and only becomes available after the PL/SQL procedure completes. This project provides a 'streaming' alternative that allows for real-time message output, which is useful for debugging or testing PL/SQL procedures as they execute.The solution consists of two components:
- A replacement for the
DBMS_OUTPUTpackage. - A Perl listener script that captures and outputs the messages in real time.
- A replacement for the
Overview of Data Redaction Demo Scenarios
mainThis demo explores several advanced capabilities of Oracle Data Redaction in Oracle Database 23ai. The script is organized into the following functional sections:
- Basic Redaction Policy: Creating policies on tables (e.g.,
HR.EMPLOYEES) that redact data for all users except the schema owner. - Mathematical and Set Operators: Applying redaction to numeric columns (e.g.,
SALARY) and observing the impact on aggregate queries likeGROUP BY. - Redaction with GROUP BY and ORDER BY: Demonstrating how redaction affects query results, totals, and ordering for different user roles.
- Redacting Virtual Columns & Function-Based Indexes: Applying redaction to virtual columns and function-based indexes (e.g., on
PHONE_NUMBER) and managing default redaction values (e.g., replacing numbers with0or characters withX). - Redaction in Views with Expressions: Using redaction within views that contain calculated columns, including using regular expression replacement to redact fields like
EMAIL.
- Basic Redaction Policy: Creating policies on tables (e.g.,
Overview of Oracle Machine Learning for Spark (OML4Spark)
mainOracle Machine Learning for Spark (OML4Spark), also known as ORAAH, is a suite of R packages and Java libraries designed for scalable machine learning on big data. It allows users to perform distributed computations across a Hadoop cluster using R or Java/Scala.
Key capabilities include:
- Data Manipulation: An R interface for managing data from local File Systems, HDFS, HIVE, Impala, or JDBC sources, and creating Distributed Model Matrices across Hadoop nodes.
- Distributed Computation: A framework for invoking parallel MapReduce jobs from R, allowing users to write custom mappers and reducers in R while utilizing CRAN packages.
- Scalable Machine Learning: Parallel and distributed ML algorithms optimized for Spark parallel execution using R formula objects. OML4Spark's custom LM, GLM, and MLP NN algorithms are designed to scale better and run faster than open-source Spark MLlib, though interfaces to MLlib are provided.
- Java/Scala Integration: Core analytics functionality is available as a standalone Java library for direct use in Java or Scala environments without requiring R.
Overview of python-oracledb Notebook topics
mainThe notebooks in this directory demonstrate best practices for using
python-oracledbin its default 'Thin' mode. Topics covered include:- Connecting
- Queries
- DML
- Data loading and unloading (CSV Files)
- JSON
- PL/SQL
- Objects
Overview of the HR Web Application
mainThe HR Web Application is a lightweight Java-based web application designed for managing employee data within an Oracle Database (specifically tested with Oracle Database 12c Release 2). It follows the MVC (Model, View, Controller) architecture and utilizes the following technologies:
- Backend: Java, Oracle JDBC, Universal Connection Pool (UCP), and Oracle Java in the Database (OJVM).
- Frontend: HTML, JavaScript, jQuery, and CSS.
- Controller: Servlets communicating with the database via Java Beans.
- Build Tool: Maven.
- Database Schema: Leverages the
HRschema and theEmployeestable.
The application provides different access levels for two user roles:
HRStaffandHRAdmin.Overview of Oracle Machine Learning (OML) components
mainOracle Machine Learning (OML) is a suite of components for Oracle Database and Oracle Autonomous Database designed to perform machine learning within the database kernel. This approach follows the principle of "move the algorithms, not the data," eliminating the need to extract data to external engines.
OML provides over 30 in-database algorithms accessible via multiple language interfaces and no-code user interfaces. It is included with Oracle Autonomous Database subscriptions and Oracle Database licenses.
Overview of Oracle TxEventQ Connectors
mainThe Oracle TxEventQ Connectors facilitate data movement between Apache Kafka and Oracle Transactional Event Queues (TxEventQ).
Workflow Pattern:
- Sink Flow: A Kafka client produces messages to a Kafka topic. The Oracle TxEventQ Sink Connector consumes these messages and enqueues them into a specified TxEventQ.
- Source Flow: The Oracle TxEventQ Source Connector dequeues messages from the TxEventQ and produces them into a specified Kafka topic. A Kafka client consumer then reads from that topic.
Prerequisites:
- Apache Kafka: Version 3.1.0 or higher.
- Oracle Database: Version 21c or higher (required for Transactional Event Queue support).
- Connector Library:
com.oracle.database.messaging:txeventq-connector(available via Maven).