Re: Python for Oracle Database

From: <niall.litchfield_at_gmail.com>
Date: Fri, 29 Jun 2018 17:13:15 +0100
Message-ID: <CABe10sY1SG4LuLztP0WbUYjC6kD9XFMS_jvJDfW_jb48HLAZbA_at_mail.gmail.com>



Andrew

There are plenty of reasons why we might pick a modern(ish) language such as python (or perl or ruby or go or ...) for scripting/automation. I'm surprised that it would be mandated to go around all the existing scripts and rewrite them, that seems somewhat like make work (and make bug) to me.

Balwanth

 As well as the popen call referenced earlier, I'd imagine you'd want to make use of the Python logging facility (rather than print :( ) https://docs.python.org/2/library/logging.html and cx_oracle https://oracle.github.io/python-cx_Oracle/ for database access.

You'll also need to choose (or work with whatever has been mandated) between Python2 and Python3 - don't assume scripts written for 2 will work unchanged and in the same way in Python3.

On Fri, Jun 29, 2018 at 4:57 PM Andrew Kerber <andrew.kerber_at_gmail.com> wrote:

> Now I am curious if management gave a reason for no .sh/ksh any more?
>
> On Fri, Jun 29, 2018 at 10:31 AM, Balwanth B <balwanthdba_at_gmail.com>
> wrote:
>
>> Thanks Steve - will look into that .
>>
>> HI Niall- Yes thats correct. My management says no for SH or KSH anymore.
>> We need to make some changes in the current RMAN script, so I was asked to
>> rewrite and push new RMAN script written in python.
>>
>>
>> Sent from my iPhone
>>
>> On Jun 29, 2018, at 7:55 AM, niall.litchfield_at_gmail.com wrote:
>>
>> What do you mean by "rewrite our RMAN backup script"?. Do you mean
>> replace a working shell script with a python script, or something else?
>>
>> On Fri, Jun 29, 2018 at 2:40 AM Balwanth B <balwanthdba_at_gmail.com> wrote:
>>
>>> I am trying to learn some Python and rewrite our RMAN backup script in
>>> Python. Can someone guide me where I can get this started ?
>>>
>>>
>>> Thanks,
>>>
>>> Balwanth
>>>
>>
>>
>> --
>> Niall Litchfield
>> Oracle DBA
>> http://www.orawin.info
>>
>>
>
>
> --
> Andrew W. Kerber
>
> 'If at first you dont succeed, dont take up skydiving.'
>

-- 
Niall Litchfield
Oracle DBA
http://www.orawin.info

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Jun 29 2018 - 18:13:15 CEST

Original text of this message