# oracle-db-examples: twenty-one directories of Oracle sample code, and a licence contradiction

> Oracle's examples repository is an index rather than a project, with PL/SQL, Oracle Text, spatial, APEX and machine learning samples side by side. It is also the one repository where the licence metadata and the licence file disagree.

**oracle-samples/oracle-db-examples** — Code Examples for Oracle AI Database

- Repository: https://github.com/oracle-samples/oracle-db-examples
- Website: https://www.oracle.com/database/technologies/
- Stars: 1,441 · Forks: 879
- Language: Java
- License: NOASSERTION
- Published: 2026-10-07 · Updated: 2026-10-07 · Language: en
- Canonical page: https://hysenlabs.com/projects/oracle-samples-oracle-db-examples

## An index of features, not a runnable project

There is no build system here, and looking for one is the mistake most people make with this repository. The top level holds no package manifest, no pom.xml, no Makefile and no CI configuration. What it holds is a README that is essentially a table of twenty-one directories, each with a one-line description, and six non-directory files: `.gitignore`, `.gitmodules`, `CONTRIBUTING.md`, `LICENSE.txt`, `README.md` and `SECURITY.md`.

So the correct way to read this repository is as a catalogue. Oracle splits its examples by database feature area, and each directory is a self-contained demonstration of one area, written in whatever language or client that feature needs. The README's own summary is a sentence: it stores a variety of examples demonstrating how to use the Oracle Database.

The language spread in the tree is telling. There are directories for `C`, `java`, `javascript`, `python`, `ruby`, `plsql` and `precompilers`, which covers the Pro*C and Pro*COBOL precompiler path as a category of its own. Alongside them sit feature directories that are language independent in practice: `sql/`, `optimizer/`, `spatial/`, `text/`, `security/`, `sql-firewall/`, `txeventq/`, `sagas/` and `machine-learning/`. GitHub reports Java as the primary language, which is a reasonable summary of volume even though PL/SQL is the one most examples are written in.

The topics are worth reading closely for a different reason. Alongside the expected database and oracle tags sit `oracle-11g` and `oracle-19c`, which are considerably older releases than the current database line. That tells you some samples here target long-supported older versions rather than the newest one, which is the right thing for a sample repository to contain and the wrong thing to assume when you copy a script into a new project.

## The sample schemas arrive as a submodule

One row of that table is different from the rest. The `db-sample-schemas` entry is not a directory in this repository, it is a link to a separate project, github.com/oracle/db-sample-schemas, and the tree confirms the distinction because the directory does not appear there. The `.gitmodules` file at the root is what wires it up.

This is the single most practical thing to know about cloning the repository. A plain clone leaves that directory empty, and a large share of the examples will not run because they assume tables that were never created. The sample schemas are the HR and ORDER schemas that Oracle has used as teaching data for two decades, so an example about analytic functions or a spatial query that refers to employees or order lines is depending on data that lives in the other repository.

LiveSQL exists precisely because of this friction, and the README points at it directly. It says some of the examples in this repository can be executed in the free web-based tool at livesql.oracle.com, and calls it an excellent resource for getting started with Oracle Database. Since LiveSQL has the sample schemas pre-loaded and needs nothing installed, the sensible workflow for most of these scripts is to read the example here and paste the interesting statement there.

## Where Oracle points you after the repository

The README's remaining sections are all redirects, and knowing what they are lets you skip them when you already know what you need.

Documentation goes to docs.oracle.com/en/database/. That is the full Oracle Database documentation set, and the repository is not a substitute for it. Nothing in the twenty-one directories explains the feature it demonstrates in prose; the code is the documentation, which is why the product docs matter more here than they would for a project with a manual.

Dev Gym at devgym.oracle.com is the practice side: quizzes, workouts and classes, offered as a way to test yourself. The README frames it as optional challenge material rather than part of the examples.

SQL Developer has its own directory, `sqldeveloper/`, which is worth noting because SQL Developer is a GUI client rather than a database feature. Having a directory for it means the repository also collects tooling examples, not only SQL and PL/SQL. The Multicloud directory sits alongside, covering multi-cloud scenarios rather than a single feature.

Two of the directories describe capabilities rather than products, and both are the sort of thing that is hard to find documented elsewhere. `json-relational-duality/` is the model where JSON documents and relational tables are two views of the same data, with either representation usable without conversion. `sagas/` covers the Saga pattern for distributed transactions, which Oracle supports in the database rather than only in application frameworks. `txeventq/` covers transactional event queues. If you arrive looking for a specific name and it is not in this table, it is probably not in the repository either.

## The licence file and the licence metadata disagree

Here is a concrete contradiction inside the repository, and it is the kind that matters if you intend to copy code out of it.

The README's licence section reproduces the Apache License, Version 2.0 in full and points to `LICENSE.txt` for the authoritative text. That is unambiguous. But GitHub's own detection of the repository's licence returns no recognised value, which means the licence field in the repository metadata is unset rather than set to Apache 2.0. Anyone automating a licence check against repository metadata will read this project as having no licence, and any tooling that gates on that will block or flag it incorrectly.

Both facts are in the repository at the same time and there is no way to tell from the outside which one the project intends as controlling. The practical resolution is the boring one: read `LICENSE.txt`, which the README explicitly identifies as the copy of the licence, and treat Apache 2.0 as the terms. Apache 2.0 is permissive and grants patent rights explicitly, which is friendlier to commercial reuse than GPL would be, but it carries a notice obligation, so if you lift a script into a product you need to carry the attribution and the licence text.

The other two short files are the conventional ones. `CONTRIBUTING.md` holds the contribution guide that pull requests are asked to review first, and `SECURITY.md` holds the responsible disclosure process.

## Getting the code without a database

Cloning is straightforward, and the submodule is the part people miss:

```bash
git clone https://github.com/oracle-samples/oracle-db-examples
cd oracle-db-examples
```

Once you have it, there is nothing to build. For the SQL and PL/SQL directories, your next step is not a compile step but a database: either a local Oracle instance, or LiveSQL, which needs nothing and already has the sample schemas. For the client-language directories, `java/`, `python/`, `ruby/`, `javascript/` and `C/`, each will carry its own build tooling inside its own directory rather than at the repository root, which is one of the practical costs of a catalogue-style repository.

The last push to this repository was on 2026-09-11, so it is being worked on. The repository has no GitHub releases, so there is no version history to read and no upgrade path to follow; you take the current state of `main`. For a sample repository that is the normal arrangement, since nothing here is versioned as a library you would pin.

What the repository is not is a framework, a driver, or a migration tool. If you are looking for those, the relevant part of the tree is `precompilers/`, which shows how Oracle's own precompiled client interfaces work from C and COBOL, and `sqldeveloper/` for the GUI tooling. Everything else is a demonstration of a database feature you would otherwise have to learn from documentation alone.

## Conclusion

Treat oracle-db-examples as a shelf you reach into rather than a codebase you depend on. There is no build, no package manifest and no test suite, and the useful signal is the directory names: if `optimizer/`, `sql-firewall/` or `json-relational-duality/` matches a problem you have, the sample inside is written by Oracle against the real product, which is the thing you cannot get from a blog post. Two checks are worth doing before you rely on it. Read `LICENSE.txt` rather than trusting the repository's licence field, since they do not agree. And confirm the submodule actually populated, because the HR and ORDER schemas most examples assume arrive through `db-sample-schemas`, and LiveSQL at livesql.oracle.com already has them loaded, which is the fastest way to try a script before you install anything.

## FAQ

### Is Oracle DB a SQL DB?

Yes. Oracle Database is a relational database and SQL is its primary query language, which is why `sql/` and `plsql/` are the two largest areas of the sample repository alongside the client directories. The `plsql/` examples show the procedural extension that adds control flow, packages and cursors on top of standard SQL.

### What is the db-sample-schemas submodule in oracle-db-examples?

It is a link to the separate oracle/db-sample-schemas project, wired in through the `.gitmodules` file at the repository root, which is why the directory is absent from the repository tree listing. Those schemas are the HR and ORDER datasets that many examples query, so a clone that leaves the submodule empty will have scripts that reference tables which do not exist.

### What licence applies to the code in oracle-db-examples?

The README reproduces the Apache License, Version 2.0 in full and points to `LICENSE.txt`, while GitHub's licence detection for the repository returns no recognised value. Read `LICENSE.txt` as the authoritative text. Apache 2.0 is permissive but requires you to carry the notice and licence text when you redistribute the code.

## Sources

- [Issues](https://github.com/oracle-samples/oracle-db-examples/issues)
- [oracle-samples/oracle-db-examples on GitHub](https://github.com/oracle-samples/oracle-db-examples)
- [Project website](https://www.oracle.com/database/technologies/)
- [README](https://github.com/oracle-samples/oracle-db-examples/blob/main/README.md)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/oracle-samples-oracle-db-examples
