อาจารย์ตี๋ที่สอน Oracle

English edition Lab setup

Lab setup

Oracle 26ai SQL Tuning

The SQL scripts for the hands-on labs in the book — 13 files, one per chapter, so you can keep the book open beside the terminal and run along.

Download the scripts

One .zip file. No sign-up, no account needed.

Before you run it

  • Oracle Database 26ai or 23ai, with a PDB open
  • SYSDBA rights
  • Three values in the script have to match your machine. Each one is marked with the comment -- CHANGE THIS

The three values

PDB namethe example uses prod
Datafile and tempfile pathspoint them at real paths on your server
Password for user TUNEyour choice

How to run it

cd /u03/LABS/tune_script
sqlplus / as sysdba @setup_lab.sql | tee setup_lab.log

The script sets WHENEVER SQLERROR EXIT, so if anything goes wrong it stops right there instead of leaving you a half-built schema to puzzle over later. You can run it again — the head of the script drops the old objects first.

What the script creates

TUNE.PRODUCTS5,000 rows
TUNE.CUSTOMERS200,000 rows
TUNE.SALESabout 5,000,000 rows
If your company blocks GitHub

Plenty of corporate firewalls block github.com. If the download above does not work from your office, fetch it from a machine outside the network and copy it across, or email me and I will send the .zip to you.

Something not working

If a script fails, or you found a mistake in the book, email me at pornchai.krong@gmail.com. Corrections are collected on the English edition page.