You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Star0 (0)You must be signed in to star a repository
About
Code of the book Oracle Database 26ai SQL and PL/SQL: The Complete Developer's Guide by Vinish Kapoor: 677 SQL and PL/SQL examples with their real output, and the Nimbus Air sample schema.
Oracle Database 26ai SQL and PL/SQL: The Complete Developer's Guide
The example code of the book Oracle Database 26ai SQL and PL/SQL: The Complete Developer's Guide by Vinish Kapoor — 677 examples,
each with the output it produced in Oracle AI Database 26ai Free (release 23.26), and the scripts
that install the book's sample schema, Nimbus Air, a fictional airline.
setup/nimbus/ — the NIMBUS schema: create-user.sql (run as a DBA), install.sql (run as
NIMBUS: tables, data, comments, statistics), uninstall.sql, and files/, the sample files
that the examples of BFILEs, UTL_FILE, and external tables read.
setup/login.sql — the SQLcl and SQL*Plus settings the examples ran with (Chapter 3).
setup/netlab/server.mjs — a small local HTTP and SMTP test server for the networking examples of
Chapter 54 (Node.js 18 or later). It sends no real e-mail.
examples/ — one folder per topic. Each name.sql is an example as the book prints it, and
name.out the output it produced.
Installing the Sample Schema
Chapter 5 of the book describes the steps. In short, with the container of Chapter 2:
Connect to the pluggable database as a DBA and run setup/nimbus/create-user.sql, which asks for
a password for NIMBUS and creates the user, its privileges, and the directory NIMBUS_FILES.
Copy setup/nimbus/files to the directory's folder on the database server, for example:
docker exec db26ai mkdir -p /opt/oracle/nimbus_files, then
docker cp setup/nimbus/files/. db26ai:/opt/oracle/nimbus_files/.
Connect as NIMBUS and run setup/nimbus/install.sql from the setup/nimbus folder.
For the embedding examples of Chapters 21 and 61, download Oracle's prebuilt
all_MiniLM_L12_v2_augmented.zip (linked from the AI Vector Search User's Guide), unzip it,
and copy all_MiniLM_L12_v2.onnx to the same folder as the sample files. The example
vectors/11-load-onnx-model.sql loads it.
Running the Examples
Connect as NIMBUS with SQLcl, in the folder that contains setup/login.sql (or with SQLPATH
pointing to it), and run an example with @examples/folder/name.sql, or paste it.
Lines that start with -- @ are instructions for the program that ran the examples for the
book, and are not printed in it:
-- @setup statement prepares the example (for example, drops a table it creates) — run it first.
-- @cleanup statement tidies up after the example — run it afterwards.
-- @connect sysdba means the example runs as SYS (sql / as sysdba), in the pluggable
database FREEPDB1 (alter session set container = FREEPDB1).
-- @client sqlplus means the example ran in SQL*Plus instead of SQLcl.
-- @expect-error marks an example that shows an error on purpose.
The examples of a chapter can depend on earlier ones of the same chapter; run them in order. Some
output depends on when and where you run an example — the current date, generated identifiers,
timings — and differs from the book's (Chapter 1 lists the cases).
Code of the book Oracle Database 26ai SQL and PL/SQL: The Complete Developer's Guide by Vinish Kapoor: 677 SQL and PL/SQL examples with their real output, and the Nimbus Air sample schema.