Oracle

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 »

Oracle DB. Simple AWR report generation from the database itself.

From the version 10g, Oracle database let you to use AWR for system performance analisis.I will show you how to generate AWR report fast and simple. All commands are running under SYS user, but you can use another one with appropriate privileges. First, let’s compile simple report generation function. create or replace function AWR_HTML(in_begin_point in …

Oracle DB. Simple AWR report generation from the database itself. Read More »