Oracle Database Examples

repository·main·Indexed 23 days ago

https://github.com/oracle-samples/oracle-db-examples

A 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.

Tokens
111.5K
Snippets
192
Records
618
Agent score
81%

What's inside oracle-db-examples

  1. Overview of Exadata Monitoring Dashboards

    main

    The 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.

  2. Overview of Oracle Machine Learning for R (OML4R)

    main

    Oracle 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.
  3. Overview of Oracle Exadata Real-Time Insight

    main

    Starting 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.
  4. Overview of Streaming DBMS_OUTPUT

    main

    Standard DBMS_OUTPUT in 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:

    1. A replacement for the DBMS_OUTPUT package.
    2. A Perl listener script that captures and outputs the messages in real time.
  5. Overview of Data Redaction Demo Scenarios

    main

    This 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 like GROUP 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 with 0 or characters with X).
    • Redaction in Views with Expressions: Using redaction within views that contain calculated columns, including using regular expression replacement to redact fields like EMAIL.
  6. Overview of Oracle Machine Learning for Spark (OML4Spark)

    main

    Oracle 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.
  7. Overview of the HR Web Application

    main

    The 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 HR schema and the Employees table.

    The application provides different access levels for two user roles: HRStaff and HRAdmin.

  8. Overview of Oracle Machine Learning (OML) components

    main

    Oracle 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.

  9. Overview of Oracle TxEventQ Connectors

    main

    The Oracle TxEventQ Connectors facilitate data movement between Apache Kafka and Oracle Transactional Event Queues (TxEventQ).

    Workflow Pattern:

    1. 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.
    2. 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).