Discussion:
Python for Oracle Database
Balwanth B
2018-06-29 01:37:10 UTC
Permalink
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
Steve Harville
2018-06-29 13:23:41 UTC
Permalink
This post might be inappropriate. Click to display it.
n***@gmail.com
2018-06-29 13:55:46 UTC
Permalink
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?
Post by Balwanth B
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
Balwanth B
2018-06-29 15:31:10 UTC
Permalink
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
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?
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 Kerber
2018-06-29 15:57:20 UTC
Permalink
Now I am curious if management gave a reason for no .sh/ksh any more?
Post by Balwanth B
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
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?
Post by Balwanth B
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.'
n***@gmail.com
2018-06-29 16:13:15 UTC
Permalink
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.
Post by Andrew Kerber
Now I am curious if management gave a reason for no .sh/ksh any more?
Post by Balwanth B
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
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?
Post by Balwanth B
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
p***@gmail.com
2018-06-29 21:47:32 UTC
Permalink
This post might be inappropriate. Click to display it.
p***@gmail.com
2018-06-29 21:41:00 UTC
Permalink
Best bet is to make sure each script has a shbang in it, rename them all to .py and then use the time you free up to find a new employer. I am kidding (almost not however) of course.



From: oracle-l-***@freelists.org <oracle-l-***@freelists.org> On Behalf Of Balwanth B
Sent: Friday, June 29, 2018 10:31 AM
To: ***@gmail.com
Cc: ORACLE-L <oracle-***@freelists.org>
Subject: Re: Python for Oracle Database



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, ***@gmail.com <mailto:***@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 <***@gmail.com <mailto:***@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
Loading...