Top 60 Oracle Blogs

Recent comments

March 2016

DBaaS RESTful API Cook Book

Having a GUI tool like Enterprise Manager Cloud Control to manage your entire data center is an imperative for most enterprises these days. But in the cloud paradigm, you must also have a uniform API that can be used to tailor the cloud to your business processes and economic models. That API is known as the REST API, and services based on that are known as RESTful services.

OUG Ireland 2016


Early tomorrow morning I will start my journey to Ireland for the OUG Ireland 2016 conference.

I’ve got back-to-back sessions in the afternoon on database consolidation and analytic functions. I was invited to a panel on the Friday also, but I had already booked my flights before that invite, so sadly I had to decline.

This year is going to be another day trip for me, with the flight costing a gigantic £27 on ChavAir. :)

See you there!


FOLLOWS clause

In early Oracle releases, you could have 1 trigger per type of trigger per table (eg if you had a before-row-insert trigger, you could have only 1). Now there is no limit. But that does raise the question – if I have “n” BEFORE ROW triggers on a table, in which order do they fire ? Let’s look at the following example:

SQL> drop table t1 purge;

Table dropped.

SQL> create table T1 ( x int, y int, z int );

Table created.

SQL> create or replace
  2  trigger trg1
  3  before insert on t1
  4  for each row
  5  begin
  6    :new.y := :new.x;
  7  end;
  8  /

Trigger created.

SQL> create or replace
  2  trigger trg2
  3  before insert on t1
  4  for each row
  5  begin
  6    :new.z := :new.y;
  7  end;
  8  /

Trigger created.

Seems simple enough…Copy ‘x’ into ‘y’, and then copy ‘y’ into ‘z’. So lets see what happens

EM13c DBaaS, Part 1 On-Premise and the Test Master

With EM13c, DBaaS has never been easier.  No matter if you’re solution is on-premise, hybrid, (on-premise to the cloud and back) or all cloud, you’ll find that the ability to take on DevOps challenges and ease the demands on you as the DBA is viewed as the source of much of the contention.

Oracle Cloud – About buttons, icons, links and other stuff…

While scrolling to the DBaaS interface pages, I realized that I was spending a lot…

Is a year a leap year ?

This post seems timely given that yesterday was Feb 29. 

In almost every case I can think of, you should be relying on native Oracle date functions to perform any kind of date arithmetic.

This is perhaps one of the very very few exceptions Smile

SQL> set timing off
SQL> create or replace
  2  function is_leap_year1(y number) return boolean is
  3    x date;
  4  begin
  5    x := to_date('2902'||y,'ddmmyyyy');
  6    return true;
  7  exception
  8    when others then return false;
  9  end;
 10  /

Function created.

SQL> create or replace
  2  function is_leap_year2(y number) return boolean is
  3  begin
  4    return mod(y,4)=0 and ( mod(y,100) != 0 or mod(y,400) = 0 );
  5  end;
  6  /

Function created.


Loading LOB from a file

I observed this idiosyncracy recently when loading some lob from external files using PL/SQL:

First we’ll create a file to be loaded, and ‘wc’ tells us it is 75 bytes in size 

SQL> !echo "This is line 1" > /tmp/lobfile
SQL> !echo "This is line 2" >> /tmp/lobfile
SQL> !echo "This is line 3" >> /tmp/lobfile
SQL> !echo "This is line 4" >> /tmp/lobfile
SQL> !echo "This is line 5" >> /tmp/lobfile
SQL> !wc /tmp/lobfile
       5      20      75 /tmp/lobfile

Then create a standard routine to load it into the database