Minimalistic Oracle

Minimalistic Oracle contains a collection of practical examples from my encounters with Oracle technologies. When relevant, I also write about other technologies, like Linux or PostgreSQL. Many of the posts starts with "how to" since they derive directly from my own personal experience. My goal is to provide simple examples, so that they can be easily adapted to other situations.

Thursday, November 20, 2025

How to unload rows in an Oracle database to disk using sqlcl

›
In sqlcl, execute these lines to unload SCOTT.EMP to disk: set arraysize 200 set load batch_rows 200 UNLOAD TABLE SCOTT.EMP DIR /datadisk1/...

Find total size of all databases in PostgreSQL cluster

›
SELECT database, size FROM ( SELECT datname AS database, pg_size_pretty(pg_database_size(datname)) AS size, 0 AS sort_o...
Monday, November 17, 2025

Find the number of columns in a table in postgreSQL

›
SELECT count(*) FROM information_schema.columns WHERE table_name = 'mytable' AND table_schema = 'jim';
Tuesday, November 11, 2025

Exchange all occurences of a string in all files in a sub-directory structure

›
find /var/lib/pgsql/cities/aberdeen/schema -type f -exec sed -i 's/aberdeen/glascow/g' {} +

List all files containg a string in a subdirectory structure

›
grep -Rl 'aberdeen' /var/lib/pgsql/cities/aberdeen/schema Result: /var/lib/pgsql/cities/aberdeen/schema/grants/grant.sql /var/li...
Monday, November 10, 2025

Generate truncate table statements in PostgreSQL

›
To generate a script in postgreSQL, equivalent to the Oracle-style shown below: select 'truncate table ' || table_name || ' ca...

Do I need special privileges to create temporary tables in a database in PostgreSQL?

›
To verify if your user has the privilege to create temporary segments in a postgreSQL database, use this check: psql -h localhost -d mydb ...
›
Home
View web version

About Me

My photo
Name: Vegard Kåsa
My career as an Oracle DBA startet in 2001, when I acceptet a request to take on the responsibility as my current employer's DBA. From that point and onwards, managing Oracle databases has kept me busy and engaged. I enjoy my work, and particulary appreciate the constant learning and devlopment that comes with the job. From 2014, I am self-employed through my company Oric Consulting AS (Norway), and from 2024 Oric Consulting AB (Sweden) I currently live in Göteborg, Sweden, with my family.
View my complete profile
Powered by Blogger.