Even today, on many projects I can still find that many developers are still using bash & Korn shell or even Pro*C as a main tool for developing scripts that will be executed as part of batch job in one of the following ways:

  • Unix/Linux cron
  • Oracle’s dbms_job / dbms_scheduler
  • commercial enterprise job scheduling software like Automic / UC4, IBM Workload Automation or similar

This is a clear indicator that you are on a wrong way, as you are still using technology that belongs to 20th century.

To avoid twisting my words, I have nothing against shell scripting or Pro*C.

Shell scripting is still fundamental way to communicate with Unix/Linux systems.

Problem is that in IT everything is moving fast, meaning what was a good solution to solve some problem yesterday, today it is not.

I already wrote before about choice of architecture and technology on the following post:

https://www.josip-pojatina.com/en/plsql-vs-java-vs-c-vs-python-for-cpu-intensive-tasks-architectural-decision/

The article is currently partly outdated, although originally I wrote it a few years back as PoC,

and can serve as reminder of how technology is moving fast ahead.

This is one typical example of old fashion coding:

sqlplus -s ${CONNECTION} <<END

    set feedback off;
    set verify off;
    set heading off;
    set serveroutput on size 1000000;

        VARIABLE SQL_RETURN_CODE    NUMBER;
        VARIABLE GV_script_error  VARCHAR2(2000);

        EXEC :SQL_RETURN_CODE := 0;

WHENEVER SQLERROR EXIT 288

DECLARE
counter number;

BEGIN
...
<PL/SQL block of code>
...

Code from above is combination of bash and PL/SQL code that connects to Oracle database in silent mode and execute some tasks.

Code is usually called from *nix cron task or dbms_scheduler or some enterprise job scheduling software.

It’s difficult to count all issues with such code like:

  • unreliable exception handler
  • difficult to maintain
  • difficult to debug
  • impossible to profile
  • no threading and multiprocessing
  • only manual parallelism possible, usually by using for loop and put the process in background
  • no object oriented programming
  • lack of development tools (text editor instead of modern IDE)
  • lack of svn / git integration

In the next post I’ll explain how to replace bash and Pro*C code with Python.


Comments

There are no comments yet. Why not start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.