Database

Fault tolerant PostgreSQL cluster with automatic failover using Repmgr and Barman. Part 1. Introduction.

Right off the bat, this is what you’ll get in the end: Synhronous standby server using repmgr Repmgr daemons running not on db servers No need of witness server with own PostgreSQL instance Split-brain tolerant auto-failover High available configuration without additional utils, such as HAProxy Backup server using barman Asynchronous WAL streaming Became synchronous, if …

Fault tolerant PostgreSQL cluster with automatic failover using Repmgr and Barman. Part 1. Introduction. Read More »

Oracle DB. Changing and fixing query execution plan using dbms_spm.

Oracle Query Optimizer generally works well, but sometimes it makes your fast and polished queries slow down. Often, you can not simply add hints and recompile them on production environment. In such case be ready to use dbms_spm package. Don’t forget about appropriate grants.grant select on V_$SESSION to test;grant select on V_$SQL_PLAN to test;grant select …

Oracle DB. Changing and fixing query execution plan using dbms_spm. Read More »

Oracle DB. Using dbms_alert for queuing and parallel data processing.

Oracle has an interesting package to provide an event-based logic named dbms_alert. In this article I will use it to create a classic queue processing. First, we need to create a simple table, which store queue message ID and creation time. create table t_queue ( id_queue number primary key, d_add timestamp default systimestamp not null …

Oracle DB. Using dbms_alert for queuing and parallel data processing. Read More »

Oracle DB. Run OS command from database itself using Java stored procedure.

There are some cases, when you need to access an OS running your database. You need it just right now, but you don’t have an accees or permissions. Let’s do it from database using java stored procedure. If you want to run following commands under non-system user, don’t forget to grant appropriate permissions to your …

Oracle DB. Run OS command from database itself using Java stored procedure. Read More »

Oracle DB. Advanced Queuing. Simple subscriber example.

In this article I will show you how to create Oracle queues, pull messages and push them using subscriber. Before we begin, please, grant dbms_aqadm and dbms_aq execute privileges to user. Queue table use an object data type to transfer message data. Let’s create it first. create or replace type tp_queue as object(n number); Second, …

Oracle DB. Advanced Queuing. Simple subscriber example. Read More »