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.

Wednesday, March 11, 2026

How to dump the entire schema's DDL into a file

›
pg_dump -d mydb \ --schema-only \ --no-owner \ --no-privileges \ -n myschema \ -f create_schema.sql The flag "--no-owner...

Some examples of how to use the function pg_partition_tree

›
From PostgreSQL 11, the fuction pg_partition_tree has been available Usage, in its simplest form: SELECT * FROM pg_partition_tree('ld...

Find active queries in PostgreSQL

›
SELECT pid, state, now() - query_start AS duration, left(query, 80) AS query FROM pg_stat_activity WHERE state != 'idle' AND usena...
Thursday, March 5, 2026

Identity columns vs free-standing sequences in PostgreSQL

›
Are the columns typically used in primary key columns, defined as IDENTITY columns, or as standalone columns with a default value generated...

How to find the current value for a PostgreSQL sequence

›
SELECT last_value FROM myschema.mysequence; or SELECT nextval('myschema.mysequence'); Note: nextval() advances the sequence — us...
Friday, February 20, 2026

How to find triggers in a PostgreSQL schema

›
Execute the SQL below as a user with ownership to the schema. To verify that you have schema privileges, execute: SELECT has_schema_privil...
Wednesday, February 18, 2026

Useful query against v$archived_log in recovery situations

›
SELECT thread#, COUNT(*) AS cnt, MIN(sequence#) AS min_seq, MAX(sequence...
›
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.