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.

Tuesday, September 9, 2025

How to set echo in a SQL script executed in psql

›
Use one of two options 1. in the sql file, add the following directive \set ECHO queries 2. execute the script using the -e flag psql -...
Monday, September 8, 2025

Syntax for drop/recreate of constraints in PostgreSQL

›
1. Find the constraints belonging to a specific table: SELECT conname FROM pg_constraint WHERE conrelid = 'mytable'::regclass; ...
Friday, September 5, 2025

Query equivalent to SELECT * FROM USER_OBJECTS in PostgreSQL

›
SELECT schema_name, object_name, object_type FROM ( -- Tables, Views, Indexes, etc. SELECT n.nspname AS schema_name, ...
Thursday, August 28, 2025

Spool out all parameters from a datafile to a file

›
psql -h postgres01.oric.no -U mysuperuser postgres -c "COPY (SELECT name || '=' || setting FROM pg_settings ORDER BY name) TO...
Wednesday, August 27, 2025

List a table, its partitions and the number of rows it contains

›
SELECT s.schemaname, s.relname AS table_name, s.n_live_tup, s.last_analyze, s.last_autoanalyze FROM pg_stat_all_ta...
Thursday, July 31, 2025

How to check if a PostgreSQL streaming replicate server is up-to-date with the primary

›
On the primary, run SELECT pg_current_wal_lsn(); -- On the primary In my case, the result was pg_current_wal_lsn -------------------- ...

Basic postgres connect syntax

›
psql -h hostname -U username -d database Options: Option Description -h <host> Hostname or IP address of the PostgreSQL server -p...
‹
›
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.