Python for the Oracle DBA – Outline/Intro

I want to put together a talk about how useful the Python programming language is for an Oracle database administrator or DBA. I thought that I would start by putting my thoughts down in a blog post as a possible starting point for a speech. I think the best way to organize this post is around a series of questions.

First off, why does an Oracle DBA need a programming language? We are not developers. DBAs do backup and recovery, performance tuning, installations, upgrades and patching, etc. We may write the occasional small script or program to help with our work but we are not full-time heads down 40 hours a week plus programmers. A lot of what I do uses simple SQL scripts that I run through Oracle’s SQL*Plus command line utility. A handful of these scripts include Oracle’s PL/SQL programming language so I have done some programming but it is not my full-time job. Our database servers have Unix and Linux shell scripts that do things like exports and trace file cleanups. In addition I have graphical tools like Toad or Oracle Enterprise Manager that I use in my job. I can do most of my job with SQL, PL/SQL, shell scripts, and GUI database tools. Why do a need a general purpose programming language like Python in my role as an Oracle DBA?

A language like Python helps me in my DBA job because it is easy to use and connects to a lot of things.

Why would a smart Oracle database administrator need a programming language that is easy to use? We are very technical people, are we not? I think DBAs need an easy to use programming language because they are not full-time developers. I don’t know about you, but I can only hold so many details in the front of my mind. I have a lot of Oracle database syntax and details rolling around in my head. I know how to join V$SESSION and V$PROCESS without looking it up. That’s not surprising after using Oracle for 20 plus years. But, I can only remember so much. Since programming is not my primary focus I do not think I can remember a language’s details very well. So, I think it makes sense for a DBA to have an easy to use programming language like Python. I can quickly look up details that I forget if it has been a while since I wrote a Python program, so I don’t need all the details in the front of my brain.

What do I mean when I say that Python connects to a lot of things? There are all kinds of libraries or modules that you can use with Python. One of Python’s claims to fame is that you can use it as the glue to tie varies components together. I use a graphics module that helps me make plots of Oracle performance metrics. I get the data using an Oracle database module. My SQL*Plus and Unix shell scripts did not let me connect to a client side graphics library. Plus, I use Python to connect to SQL*Plus and to ssh into Unix systems to run shell scripts. So, Python can connect to pretty much any type of system or resource that I could need in my job as a database administrator. On top of all that, cloud providers such as Amazon Web Services use Python. I have used Python to connect to AWS. Also, I have tested Python with the cloud based Snowflake database. I have also connected Python to a MySQL database. It connects to a lot of stuff! Contrast Python to PL/SQL. PL/SQL is great for Oracle database programming. But it doesn’t connect to other stuff very easily. You aren’t going to connect to Amazon Web Services or to a client side graphics library through PL/SQL. It is easy to connect to these things with Python.

So, to summarize my two points for why Python is a good programming language for Oracle DBAs :

  1. Python is easy to use and DBAs are not full-time programmers.
  2. Python connects to everything a DBA uses.

In my talk I want to go into more depth on each point. What makes Python easy to use? What are some things it connects to? It would be helpful for an audience to see evidence to support each point. I could include code examples or quotes from web sites.

Maybe to keep this post from being excessively long I can make this one an intro or outline and delve into the supporting material in follow-up posts. If anyone reading this has questions or criticisms of this material I would be happy to hear it. I’m presenting my own thoughts about Python’s usefulness in my job based on my experience. If other people have good reasons why Python is not so useful to an Oracle DBA or see problems with my reasoning I would be happy to hear your opinion.



About Bobby

I live in Chandler, Arizona with my wife and three daughters. I work for US Foods, the second largest food distribution company in the United States. I have worked in the Information Technology field since 1989. I have a passion for Oracle database performance tuning because I enjoy challenging technical problems that require an understanding of computer science. I enjoy communicating with people about my work.
This entry was posted in Uncategorized. Bookmark the permalink.

16 Responses to Python for the Oracle DBA – Outline/Intro

  1. Sumeet says:

    Bobby ,

    Nice intro and argument about Python usefulness for Oracle DBA . I agree !
    I myself wanted to delve into this area and that’s why read your post in less than 5 mins.
    I’m interested to know more about this , how to use Python with Oracle database and what can we achieve bu putting these 2 together.
    Looking forward to more posts on the topic.

    Keep writing !

  2. Karl says:

    I’m not a DBA, but I’m similar in the way that I need to write glue scripts or utility scripts, and you’re inspiring me to improve my Python abilities!

  3. I am also a long time Oracle DBA with some development capabilities (plsql mostly).While I learned basics of Java and Python in the past to do some simple data retrieval, I forgot most of it as I don’t use it on a regular basis. I was able to find shell/plsql to meet my scripting demands.
    I am looking forward to your articles on use cases for Python, like graphs and multi-database connections ( I can foresee a need to transfer data from say Oracle to Postgres ).

    • Bobby says:

      Thanks for your reply. It sounds like we have a similar background. Years ago I tried to use Java in a similar way to what I am doing with Python now but I changed jobs and got away from it. I was thinking of talking about my experience with Java compared to Python. Time will tell if I will stick with Python or if I will give up on it as I did Java. One difference today is how the cloud providers use Python so that provides additional motivation that I didn’t have with Java.

  4. Pingback: Python for the Oracle DBA – Easy to use | Bobby Durrett's DBA Blog

  5. Neena Joshi says:

    Thanks for sharing the descriptive information on Python course. It’s really helpful to me since I’m taking Python training. Keep doing the good work and if you are interested to know more on Python, do check this Python tutorial.

  6. diptanu bhowmik says:

    Hi,I am an Oracle DBA for 10+ years now and looking forward to learn Python from very basic. Can you please guide me to right source?

  7. Akansha says:

    Hi Bobby ,

    I have planning to make a decision about what is the scope of Oracle database in the coming time and started learning python as it interests me. I am an ORACLE DBA for past 6 years now and want to know its a right move to switch to python completely or still DBA has upper edge over learning a new language and implementing it ?

    • Bobby says:

      I do not know what would be best for your career. There is a lot to know about Oracle or any other SQL based database including SQL Server, PostgreSQL, and MySQL, etc. I think that today people try to minimize the importance of understanding database internals and think that they can develop applications without a detailed understanding of how the database works. That may work for small systems but large, complex, heavily used systems need people who can dive deep into the details of how the database works. So, people may advise you to focus on learning programming in Python or other languages and to not learn database internals but I think that is a mistake.

      Oracle may be slowing down as the top database with competitors catching up so I do not know if you should do Oracle or something else. But, I think it can only help you to understand more about how databases work, if that is something you enjoy working on. You may be very different from me so I do not know for sure what would be good for you. I just know that there is value in understanding database technology.


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.