Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Scripting language for DBAs
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  25 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Mladen Gogala  
View profile  
 More options Apr 9 2012, 5:42 pm
Newsgroups: comp.databases.oracle.server
From: Mladen Gogala <gogala.REMOVETHISmla...@google.com>
Date: Mon, 9 Apr 2012 21:42:13 +0000 (UTC)
Local: Mon, Apr 9 2012 5:42 pm
Subject: Scripting language for DBAs
For a very, very long time indeed, Perl ruled supreme among the languages
to interface with a DB, be it Oracle, MySQL, Postgres or MS SQL. DBI was
(and still is) a polished and useful interface which can do practically
anything, from extracting query result and producing a quick little report
using formats to complex things like copying Oracle to MySQL and doing it
fast. Convenient things with Perl were:

1) Easy handling of piping and the ability to open commands by using
   stuff like open(LPR,"|lpr")
2) Multitude of modules available on CPAN
3) Regular expressions, still unsurpassed in their versatility
4) Availability of tools like perltidy or perlcritic and Perl
   syntax being well understood by both editors like Vim and operating
   systems like Emacs.
5) The fact that everybody knew it.

I am now working for a company where everybody keeps telling that Perl is
"old", Perl doesn't have an object model, it has a zoo instead, and that I
should learn Python. I tried. God and Larry Ellison know that I have tried
and gave it my best. The problem is, however, that I don't need a fully OO
language to extract result of a query and mail it to my PHB. I need the
"format" command and MIME::Lite. I was able to write the script both in
Perl and Python and lo and behold, Perl was shorter and more elegant.

So, at risk that I am called a dinosaur, I am asking the respected
colleagues from this group what do you you use? Is there anything even
remotely akin to Perl "format" command in Python? Why is that guy van
Rossum not on the FBI's most wanted list?

--
http://mgogala.freehostia.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
TheBoss  
View profile  
 More options Apr 9 2012, 7:06 pm
Newsgroups: comp.databases.oracle.server
From: TheBoss <TheB...@invalid.nl>
Date: 09 Apr 2012 23:06:53 GMT
Local: Mon, Apr 9 2012 7:06 pm
Subject: Re: Scripting language for DBAs
Mladen Gogala <gogala.REMOVETHISmla...@google.com> wrote in
news:jlvl3l$3fq$2@solani.org:

Oh, but I just LOVE Python!
Here's some pointers that surely will convince you:

 < http://www.youtube.com/watch?v=anwy2MPT5RE >
 < http://www.youtube.com/watch?v=-v1OLMjG52I >
 < http://www.youtube.com/watch?v=IqhlQfXUk7w >
 < http://www.youtube.com/watch?v=xToPCaNxaow >
 < http://www.youtube.com/watch?v=T70-HTlKRXo >

--
Jeroen


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
joel garry  
View profile  
 More options Apr 10 2012, 12:02 pm
Newsgroups: comp.databases.oracle.server
From: joel garry <joel-ga...@home.com>
Date: Tue, 10 Apr 2012 09:02:00 -0700 (PDT)
Subject: Re: Scripting language for DBAs
On Apr 9, 2:42 pm, Mladen Gogala <gogala.REMOVETHISmla...@google.com>
wrote:

Neither, although I've intended to become conversant in Perl since the
last century.  I do most stuff in the sillly 4GL that the ERP system I
deal with is written in, and the rest in ksh and SQL, unless Oracle
makes me debug their Perl code.

Yesterday I was poking about on the tubes in a fog, and somewhere
someone blogged about Perl 6, and how it was so different than 5 that
it would lose all the institutional memory 5 and 5.10 has accumulated,
so everyone should go to bash.  Everyone has their shibboleths, I
guess.  (And looking the term up in Wikipedia, I learned something
new: 'The term originates from the Hebrew word
"shibbólet" (שִׁבֹּלֶת), which literally means the part of a plant
containing grains, such as an ear of corn or a stalk of grain[3] or,
in different contexts, "stream, torrent".'  Streams and BitTorent from
the ancients, who knew?)

jg
--
@home.com is bogus.
“did not realize what he was doing was in violation of the law.”
http://www.nytimes.com/2012/04/08/technology/text-message-spam-diffic...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
onedbguru  
View profile  
 More options Apr 10 2012, 7:01 pm
Newsgroups: comp.databases.oracle.server
From: onedbguru <onedbg...@yahoo.com>
Date: Tue, 10 Apr 2012 16:01:36 -0700 (PDT)
Local: Tues, Apr 10 2012 7:01 pm
Subject: Re: Scripting language for DBAs

I guess the IT community has never learned their lessons... there are lots of languages out there, scripting, 3GL, 4GL, OO, blah, blah, blah. Right now, everone is SOOO enamored with JAVA (piece-o-crap) and it's OO abilities.  There are things I have done in C that made JAVA look like "B".  I once took a JAVA app that just created a CSV output stream that was fed into SQLLoader and re-wrote it in C. The JAVA version could only get up to about 60K records/second ingested into the database. My "C" program did >1.8M records/sec.  The original was Perl/MySQL - it did approximately 20K/min.  (yes... per minute).  Moral of the story:

QUIT THINKING YOU KNOW WHAT IS THE BEST TOOL AND TEST TO MAKE SURE YOU ARE USING THE BEST TOOL FOR THE JOB - REGARDLESS OF WHAT IS "COOL".

There was one more thing really bugs me... and that is the script kiddies that copy all of these "frameworks" to make their job easy, when all it does is show  their laziness and ignorance. Yes, some them do cool stuff - but most perform like a PC/AT-286 with 16MB of main memory and 2 floppy disks trying to run Window7. Computer languages are really not that hard to figure out.  They all do the same thing, they just do them differently.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mladen Gogala  
View profile  
 More options Apr 10 2012, 7:52 pm
Newsgroups: comp.databases.oracle.server
From: Mladen Gogala <gogala.mla...@gmail.com>
Date: Tue, 10 Apr 2012 23:52:53 +0000 (UTC)
Local: Tues, Apr 10 2012 7:52 pm
Subject: Re: Scripting language for DBAs

On Tue, 10 Apr 2012 16:01:36 -0700, onedbguru wrote:
> QUIT THINKING YOU KNOW WHAT IS THE BEST TOOL AND TEST TO MAKE SURE YOU
> ARE USING THE BEST TOOL FOR THE JOB - REGARDLESS OF WHAT IS "COOL".

OK, I got it, no need for capital letters. So, how would you rate
scripting languages for a DBA? What would be the criteria to determine
the best tool for the job?

--
http://mgogala.byethost5.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
EricF  
View profile  
 More options Apr 10 2012, 10:37 pm
Newsgroups: comp.databases.oracle.server
From: e...@invalid.com (EricF)
Date: Wed, 11 Apr 2012 02:37:19 GMT
Local: Tues, Apr 10 2012 10:37 pm
Subject: Re: Scripting language for DBAs

So how often are they used and how fast do they need to be? Using a 3GL like C
or Java you can get things running fast, but coding and debugging - and
maintaining code - take time. Writing a 1 off with a script can make a lot of
sense. But if you have a high volume system and coe that needs to be run again
and again, I agree with you.

Eric


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pól  
View profile  
 More options Apr 10 2012, 11:51 pm
Newsgroups: comp.databases.oracle.server
From: Pól <eff.off.if.you.think.youre.getting.my.em...@anon.com>
Date: 11 Apr 2012 04:51:51 +0100
Local: Tues, Apr 10 2012 11:51 pm
Subject: Re: Scripting language for DBAs

Perl is a write-only language.

Paul...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mladen Gogala  
View profile  
 More options Apr 10 2012, 10:56 pm
Newsgroups: comp.databases.oracle.server
From: Mladen Gogala <gogala.mla...@gmail.com>
Date: Wed, 11 Apr 2012 02:56:47 +0000 (UTC)
Local: Tues, Apr 10 2012 10:56 pm
Subject: Re: Scripting language for DBAs

On Wed, 11 Apr 2012 04:51:51 +0100, Pól wrote:

> Perl is a write-only language.

Runs well, too.

--
http://mgogala.byethost5.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
onedbguru  
View profile  
 More options Apr 12 2012, 5:48 pm
Newsgroups: comp.databases.oracle.server
From: onedbguru <onedbg...@yahoo.com>
Date: Thu, 12 Apr 2012 14:48:14 -0700 (PDT)
Local: Thurs, Apr 12 2012 5:48 pm
Subject: Re: Scripting language for DBAs

On Tuesday, April 10, 2012 7:52:53 PM UTC-4, Mladen Gogala wrote:
> On Tue, 10 Apr 2012 16:01:36 -0700, onedbguru wrote:

> > QUIT THINKING YOU KNOW WHAT IS THE BEST TOOL AND TEST TO MAKE SURE YOU
> > ARE USING THE BEST TOOL FOR THE JOB - REGARDLESS OF WHAT IS "COOL".

> OK, I got it, no need for capital letters. So, how would you rate
> scripting languages for a DBA? What would be the criteria to determine
> the best tool for the job?

> --
> http://mgogala.byethost5.com

;)  It really depends.

1) sql
2) pl/sql
2) shell script (bash, ksh, c)
3) perl, python or php  
4) DCL
5 (in no particular order) c, FORTRAN, COBOL, BASIC

it really depends on the end goal and the platform needed and what is available.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Klemme  
View profile  
 More options Apr 15 2012, 7:48 am
Newsgroups: comp.databases.oracle.server
From: Robert Klemme <shortcut...@googlemail.com>
Date: Sun, 15 Apr 2012 13:48:13 +0200
Local: Sun, Apr 15 2012 7:48 am
Subject: Re: Scripting language for DBAs
On 04/11/2012 01:01 AM, onedbguru wrote:

> I guess the IT community has never learned their lessons... there are
> lots of languages out there, scripting, 3GL, 4GL, OO, blah, blah,
> blah. Right now, everone is SOOO enamored with JAVA (piece-o-crap)

_That statement_ is crap.  If Java would actually be that bad usage
would be far less than it actually is.
I do agree though that people should think for themselves and not follow
all the published fashions.  Ironically in that context your statement
just constitutes another published piece of advice which begs to be
followed thoughtlessly.

> and it's OO abilities.  There are things I have done in C that made
> JAVA look like "B".  I once took a JAVA app that just created a CSV
> output stream that was fed into SQLLoader and re-wrote it in C. The
> JAVA version could only get up to about 60K records/second ingested
> into the database. My "C" program did>1.8M records/sec.  The original
> was Perl/MySQL - it did approximately 20K/min.  (yes... per minute).

Well, you can create such examples at will - they prove nothing: without
any details they are worthless.  We know nothing about your Java program
and JVM used so nobody can judge whether you used the tool properly.
For _any_ tool it takes time to master it and part of the equation is
not only the tool itself but also the environment (i.e. people and their
skills) in which it is used.

> QUIT THINKING YOU KNOW WHAT IS THE BEST TOOL AND TEST TO MAKE SURE
> YOU ARE USING THE BEST TOOL FOR THE JOB - REGARDLESS OF WHAT IS
> "COOL".

+1

Cheers

        robert


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Klemme  
View profile  
 More options Apr 15 2012, 7:56 am
Newsgroups: comp.databases.oracle.server
From: Robert Klemme <shortcut...@googlemail.com>
Date: Sun, 15 Apr 2012 13:56:44 +0200
Local: Sun, Apr 15 2012 7:56 am
Subject: Re: Scripting language for DBAs
On 04/11/2012 01:52 AM, Mladen Gogala wrote:

> On Tue, 10 Apr 2012 16:01:36 -0700, onedbguru wrote:

>> QUIT THINKING YOU KNOW WHAT IS THE BEST TOOL AND TEST TO MAKE SURE YOU
>> ARE USING THE BEST TOOL FOR THE JOB - REGARDLESS OF WHAT IS "COOL".

> OK, I got it, no need for capital letters. So, how would you rate
> scripting languages for a DBA? What would be the criteria to determine
> the best tool for the job?

My criteria would be how difficult it is to get a simple program working
which establishes a connection to the database in question and feed data
back and forth.

I usually use Ruby for my day to day scripting so I would turn to Ruby's
DB support as a first choice.  One very nice thing is the CSV lib which
comes as part of the standard library.  You also have a lot of useful
tools for interacting with processes (IO.popen, Open3.popen3).
Unfortunately I haven't done serious DB work in a while so I cannot tell
you off hand about the current state of affairs with regard to Oracle
connection support; but I am pretty sure that it exists:
http://ruby-oci8.rubyforge.org/en/

You should be able to get it with

$ gem install ruby-oci8

Apparently you need an Oracle client on the machine so you have oci lib
installed.

Kind regards

        robert


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Hurley  
View profile  
 More options Apr 15 2012, 5:17 pm
Newsgroups: comp.databases.oracle.server
From: John Hurley <johnthehur...@gmail.com>
Date: Sun, 15 Apr 2012 14:17:40 -0700 (PDT)
Local: Sun, Apr 15 2012 5:17 pm
Subject: Re: Scripting language for DBAs
I agree with these parts ...

1) sql
2) pl/sql
3) shell script (bash, ksh, c)

For almost anything in a unix/linux system shell scripts with some sed/
awk sprinkled in work well.

To me that mixture is somewhat more maintainable than perl/python etc
but sure it depends on the knowledge base or lack thereof at the
site.  Use some c when necessary for performance or low level stuff
( but I have not written anything in c in a real long time ).

I miss my old PL1 compiler a little that thing had everything
including the kitchen sink included.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Noons  
View profile  
 More options Apr 15 2012, 9:14 pm
Newsgroups: comp.databases.oracle.server
From: Noons <wizofo...@gmail.com>
Date: Sun, 15 Apr 2012 18:14:29 -0700 (PDT)
Local: Sun, Apr 15 2012 9:14 pm
Subject: Re: Scripting language for DBAs
On Apr 13, 7:48 am, onedbguru <onedbg...@yahoo.com> wrote:

> ;)  It really depends.

> 1) sql
> 2) pl/sql
> 2) shell script (bash, ksh, c)
> 3) perl, python or php
> 4) DCL
> 5 (in no particular order) c, FORTRAN, COBOL, BASIC

> it really depends on the end goal and the platform needed and what is available.

Yes indeed.  In Windows nowadays I like Small Basic a lot - in a
nutshell: a 3-gl on top of the Windows Scripting Host that I knew and
loved.  Works a treat.
Although C# can be wicked!

For Unix, nothing beats the C-ksh-PL/SQL combo.  Yes, I know perl can
do a lot. I just don't have time to learn all its nuances and I
already know the other three like the back of my hand.

As for all the other net-age languages -
Python, ruby and such, just too niche for my taste.
PHP is not bad. Same for javascript.

Java?  I'm sorry, what was the question?  Surely not common sense and
ease of use!  Great income building language, though: I've known
projects run by its "eminences" which have lasted for over 10 years
and produced nothing! Can't beat that for income!

Yes, I know: Oracle did bet the farm (stupidly!) on java nearly 10
years ago.
I hear there are a billion coders in that language in 3rd world
countries: I'm sure that's excellent value for money.  Provided it's
not my money!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Klemme  
View profile  
 More options Apr 16 2012, 3:26 am
Newsgroups: comp.databases.oracle.server
From: Robert Klemme <shortcut...@googlemail.com>
Date: Mon, 16 Apr 2012 09:26:18 +0200
Local: Mon, Apr 16 2012 3:26 am
Subject: Re: Scripting language for DBAs
On 16.04.2012 03:14, Noons wrote:

> As for all the other net-age languages -
> Python, ruby and such, just too niche for my taste.

Why "too niche"?  Are you referring to functionality, code base,
community or what else?

> PHP is not bad. Same for javascript.

PHP does not even have proper OO, no thank you.

> Java?  I'm sorry, what was the question?  Surely not common sense and
> ease of use!  Great income building language, though: I've known
> projects run by its "eminences" which have lasted for over 10 years
> and produced nothing! Can't beat that for income!

Well, Java is not a scripting language although there are scripting
languages available on the JVM.  But Scala is way more niche than Python
or Ruby I'd say.

Kind regards

        robert

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Noons  
View profile  
 More options Apr 16 2012, 6:00 am
Newsgroups: comp.databases.oracle.server
From: Noons <wizofo...@yahoo.com.au>
Date: Mon, 16 Apr 2012 20:00:00 +1000
Subject: Re: Scripting language for DBAs
Robert Klemme wrote,on my timestamp of 16/04/2012 5:26 PM:

> On 16.04.2012 03:14, Noons wrote:
> Why "too niche"? Are you referring to functionality, code base, community or
> what else?

Niche because they were created for a subset of functionality of the net and
most net technology is a niche when it comes to databases.
So is ebay, Amazon and many such others.  Although of course the net folks like
to agrandish themselves "because they use the same technologies".
Funny reality of course is: they don't.  Neither ebay nor Amazon, google or many
others use such.  From my days of dealing with google's own traffic, they used a
lot of perl.  And specially modified - Ccode - Apache.  And that was it.
Couldn't care less about community, or how many flog it.

>> PHP is not bad. Same for javascript.

> PHP does not even have proper OO, no thank you.

OO is useless for any quick database work.

> Well, Java is not a scripting language although there are scripting languages
> available on the JVM. But Scala is way more niche than Python or Ruby I'd say.

Sorry, can't comment: never met Scala.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Klemme  
View profile  
 More options Apr 16 2012, 7:18 am
Newsgroups: comp.databases.oracle.server
From: Robert Klemme <shortcut...@googlemail.com>
Date: Mon, 16 Apr 2012 13:18:55 +0200
Local: Mon, Apr 16 2012 7:18 am
Subject: Re: Scripting language for DBAs
On 16.04.2012 12:00, Noons wrote:

> Robert Klemme wrote,on my timestamp of 16/04/2012 5:26 PM:

>> On 16.04.2012 03:14, Noons wrote:

>> Why "too niche"? Are you referring to functionality, code base,
>> community or
>> what else?

> Niche because they were created for a subset of functionality of the net

Hmm...  First of all Python, Ruby and Perl are general purpose
programming languages.  Perl is extremely strong in text processing but
Ruby's regular expression engine is not far behind since 1.9.* version
of the language.  I cannot judge Python.  What makes you say they were
created for the net only / mostly?

> OO is useless for any quick database work.

It might depend on the overhead.  I find it very convenient to create
classes with a set of properties on a single line in Ruby:

Person = Struct.new :forename, :surname, :born

You can even add methods easily

Person = Struct.new :forename, :surname, :born do
   def age_days; (Date.today - born).to_i end
end

I find myself often using a few self defined classes (and of course a
lot of classes from the standard library) even in short ad hoc scripts.
  Personally I find it very helpful to use proper OO abstractions of
entities of the problem domain.  I wouldn't script in Java though where
the syntactic and other overhead is significantly higher.

Btw., another feature which makes Ruby code quick to write and easy to
read is the feature that every method can accept an anonymous callback
function which helps separating iteration from processing and makes
iterations and generally visitor like things very concise.

users = [...] # an array
users.each {|pers| puts pers.surname if pers.age > 18}

Plus, with that block pattern resource cleanup is simple and cannot be
forgotten:

File.foreach ".bash_history" do |line|
   puts line[0...10] # first 10 chars
end # implicit file close, even with exception

http://blog.rubybestpractices.com/posts/rklemme/001-Using_blocks_for_...

OK, 'nuff advertising. ;-)

Kind regards

        robert

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mladen Gogala  
View profile  
 More options Apr 16 2012, 8:33 am
Newsgroups: comp.databases.oracle.server
From: Mladen Gogala <gogala.mla...@gmail.com>
Date: Mon, 16 Apr 2012 12:33:50 +0000 (UTC)
Local: Mon, Apr 16 2012 8:33 am
Subject: Re: Scripting language for DBAs

On Mon, 16 Apr 2012 09:26:18 +0200, Robert Klemme wrote:
>> PHP is not bad. Same for javascript.

> PHP does not even have proper OO, no thank you.

No? How comes? PHP 5.3+ has classes, with all the proper member
protection, namespaces, inheritance, interfaces and everything else that
comprises OO. What does it mean that "PHP doesn't have the proper OO"?

As for the question "why not python", here is a little story: I upgraded
my home desktop box from F15 to F16, 64bit. As a part of the upgrade, I
decided to move my CD's into my home directory. When that was done, I
issued the following command:

perl -i.bak -pe 's|^/misc/|/home/mgogala|;' *.m3u

Voila. All my playlists have been fixed immediately. That's the sort of
stuff that still only Perl can do. And OO is not always the answer. OO is
a great thing, if used properly. Used as a religion, it is debilitating
and harmful.

As for the "proper OO", you are probably referring to the fact that in
PHP, as opposed to Python, the basic types are not objects, they don't
have methods, so in PHP I would write something like

if (preg_match('/^\w+ 123/',$string)) {....}

instead of

import re
if re.search('^\w+ 123',string)

Here, you would have PCRE function called as a method of the "re" object.
Evaluating regular expressions is a traditional procedural task, you
describe it as a process: "please check if this string matches the regex".
There is no benefit from expressing this as an object notation, that is
why PHP is still immensely popular. I can write procedural tasks in
procedural fashion, like displaying an output of a query, mixing in OO
techniques where I need them. OO was invented to help people collaborate
on writing large programs, by hiding complexity of the operations on
objects into the classes and have other programmers. Unfortunately,
people have also invented agile methodology, so now people are creating
their own sets of undocumented classes, which nobody understands and is
making things far less maintainable than a good procedural script. If I
have to present an output from a select as an HTML table, why would I
even want to mix in OO?

--
http://mgogala.byethost5.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mladen Gogala  
View profile  
 More options Apr 16 2012, 8:39 am
Newsgroups: comp.databases.oracle.server
From: Mladen Gogala <gogala.mla...@gmail.com>
Date: Mon, 16 Apr 2012 12:39:17 +0000 (UTC)
Local: Mon, Apr 16 2012 8:39 am
Subject: Re: Scripting language for DBAs

On Mon, 16 Apr 2012 13:18:55 +0200, Robert Klemme wrote:
> I find myself often using a few self defined classes (and of course a
> lot of classes from the standard library) even in short ad hoc scripts.

Hopefully, I will never have to maintain your script, without you being
around. Your methodology doesn't have to resemble mine and understanding
your classes would probably be a significant problem for me. Those
classes aren't very well documented, are they?
In that case, I prefer standardized types like integer, float or string
to do my evil deeds. The person who will have to untangle my scripts
after me will find them much easier to understand.

--
http://mgogala.byethost5.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Klemme  
View profile  
 More options Apr 16 2012, 9:10 am
Newsgroups: comp.databases.oracle.server
From: Robert Klemme <shortcut...@googlemail.com>
Date: Mon, 16 Apr 2012 15:10:55 +0200
Local: Mon, Apr 16 2012 9:10 am
Subject: Re: Scripting language for DBAs
On 16.04.2012 14:33, Mladen Gogala wrote:

> On Mon, 16 Apr 2012 09:26:18 +0200, Robert Klemme wrote:

>>> PHP is not bad. Same for javascript.

>> PHP does not even have proper OO, no thank you.

> No? How comes? PHP 5.3+ has classes, with all the proper member
> protection, namespaces, inheritance, interfaces and everything else that
> comprises OO. What does it mean that "PHP doesn't have the proper OO"?

I wasn't aware that they added it.  Thanks for the education!

> As for the question "why not python", here is a little story: I upgraded
> my home desktop box from F15 to F16, 64bit. As a part of the upgrade, I
> decided to move my CD's into my home directory. When that was done, I
> issued the following command:

> perl -i.bak -pe 's|^/misc/|/home/mgogala|;' *.m3u

> Voila. All my playlists have been fixed immediately. That's the sort of
> stuff that still only Perl can do.

Not true.

sed -i.bak -e 's|^/misc/|/home/mgogala|' *.m3u
ruby -i.bak -pe 'sub %r{^/misc/}, "/home/mgogala"' *.m3u

> And OO is not always the answer. OO is
> a great thing, if used properly. Used as a religion, it is debilitating
> and harmful.

I am not using it as a religion.  It's just a very nice way to abstract
things if you can add functionality to them as well.

> I can write procedural tasks in
> procedural fashion, like displaying an output of a query, mixing in OO
> techniques where I need them. OO was invented to help people collaborate
> on writing large programs, by hiding complexity of the operations on
> objects into the classes and have other programmers. Unfortunately,
> people have also invented agile methodology, so now people are creating
> their own sets of undocumented classes, which nobody understands and is
> making things far less maintainable than a good procedural script.

Well, you can't take a badly written script in an OO language or fashion
as argument against OO in general.  We all know that it is very possible
to write spaghetti code in *any* programming language.

> If I
> have to present an output from a select as an HTML table, why would I
> even want to mix in OO?

Well, if for example, you need to manipulate the query result before
writing it to the table then it might come handy if you have a record
type with specific methods which receives your records.  But there are
often several ways to do things.  Everybody should use what suits him.
If it comes natural to do the HTML formatting in an OO style then do it,
if not then don't.  Nobody forces you to use OO.  I am using OO because
I feel very at home with it and it helps me write the code I need in a
convenient way.  That doesn't mean all my Ruby scripts only contain OO
code - of course there is a lot of procedural code as well (actually
every method is a procedure).  If you don't like OO or do not see the
benefit then don't use it.  But please do not disqualify it based on bad
examples.

Kind regards

        robert

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Klemme  
View profile  
 More options Apr 16 2012, 9:15 am
Newsgroups: comp.databases.oracle.server
From: Robert Klemme <shortcut...@googlemail.com>
Date: Mon, 16 Apr 2012 15:15:40 +0200
Local: Mon, Apr 16 2012 9:15 am
Subject: Re: Scripting language for DBAs
On 16.04.2012 14:39, Mladen Gogala wrote:

> On Mon, 16 Apr 2012 13:18:55 +0200, Robert Klemme wrote:

>> I find myself often using a few self defined classes (and of course a
>> lot of classes from the standard library) even in short ad hoc scripts.

> Hopefully, I will never have to maintain your script, without you being
> around. Your methodology doesn't have to resemble mine and understanding
> your classes would probably be a significant problem for me. Those
> classes aren't very well documented, are they?

I did not post any documenting comments in those quickly made up
examples.  But choosing proper names for things (classes, methods) goes
a long way already.

> In that case, I prefer standardized types like integer, float or string
> to do my evil deeds. The person who will have to untangle my scripts
> after me will find them much easier to understand.

Only if you have documented them properly because an int itself does not
tell you whether it is an age or seconds since the epoch.  One advantage
of classes over using standard collection types (arrays, hash tables) is
that you can give them names.  I have waded through script code which
uses nested arrays and hashes a few levels deep which was certainly as
impenetrable as the short Ruby snippets I posted must occur to you.
Please do note, that things like look significantly different if you
knew the language and std lib.

Kind regards

        robert

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Noons  
View profile  
 More options Apr 17 2012, 1:15 am
Newsgroups: comp.databases.oracle.server
From: Noons <wizofo...@yahoo.com.au>
Date: Tue, 17 Apr 2012 15:15:36 +1000
Local: Tues, Apr 17 2012 1:15 am
Subject: Re: Scripting language for DBAs
Robert Klemme wrote,on my timestamp of 16/04/2012 9:18 PM:

> Hmm... First of all Python, Ruby and Perl are general purpose programming
> languages. Perl is extremely strong in text processing but Ruby's regular
> expression engine is not far behind since 1.9.* version of the language. I
> cannot judge Python. What makes you say they were created for the net only /
> mostly?

Because both Python and Ruby are widely used in that context and date mostly
from past the .net explosion of the 00s.
Perl is an exception, granted.

Interesting.  I'll have a second look at Ruby, can think of a couple of areas
where that'd be of use.

> OK, 'nuff advertising. ;-)

Nothin' wrong with directed advertising!  :-)

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Klemme  
View profile  
 More options Apr 17 2012, 4:38 am
Newsgroups: comp.databases.oracle.server
From: Robert Klemme <shortcut...@googlemail.com>
Date: Tue, 17 Apr 2012 10:38:24 +0200
Local: Tues, Apr 17 2012 4:38 am
Subject: Re: Scripting language for DBAs
On 17.04.2012 07:15, Noons wrote:

> Robert Klemme wrote,on my timestamp of 16/04/2012 9:18 PM:

>> Hmm... First of all Python, Ruby and Perl are general purpose programming
>> languages. Perl is extremely strong in text processing but Ruby's regular
>> expression engine is not far behind since 1.9.* version of the
>> language. I
>> cannot judge Python. What makes you say they were created for the net
>> only /
>> mostly?

> Because both Python and Ruby are widely used in that context and date
> mostly from past the .net explosion of the 00s.

Aha, understood.  Btw. Ruby is mid 1990s:
http://en.wikipedia.org/wiki/Ruby_%28programming_language%29
http://en.wikipedia.org/wiki/Ruby_MRI

> Interesting. I'll have a second look at Ruby, can think of a couple of
> areas where that'd be of use.

>> OK, 'nuff advertising. ;-)

> Nothin' wrong with directed advertising! :-)

:-)

If you want to get an overview of Oniguruma (Ruby 1.9.*'s regexp engine)
there's a page at
http://www.geocities.jp/kosako3/oniguruma/doc/RE.txt

In section 9 you'll see that you can even match nested expressions which
are non regular (i.e. context free); this can be used for example to
match math expressions with arbitrary nesting of pairs of brackets.

Kind regards

        robert

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gerard H. Pille  
View profile  
 More options Apr 19 2012, 1:41 pm
Newsgroups: comp.databases.oracle.server
From: "Gerard H. Pille" <g...@skynet.be>
Date: Thu, 19 Apr 2012 19:41:55 +0200
Local: Thurs, Apr 19 2012 1:41 pm
Subject: Re: Scripting language for DBAs
I use ksh with one or more sqlplus co-processes.

Communication happens with "print -p"  and "read -p", there are no limits to what you can
achieve this way.

Apart from world peace.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Klemme  
View profile  
 More options Apr 20 2012, 9:22 am
Newsgroups: comp.databases.oracle.server
From: Robert Klemme <shortcut...@googlemail.com>
Date: Fri, 20 Apr 2012 15:22:30 +0200
Local: Fri, Apr 20 2012 9:22 am
Subject: Re: Scripting language for DBAs
On 04/19/2012 07:41 PM, Gerard H. Pille wrote:

> I use ksh with one or more sqlplus co-processes.

> Communication happens with "print -p" and "read -p", there are no limits
> to what you can achieve this way.

If conditions permit (i.e. appropriate software is installed on all
systems I'd have to work with regularly) I still prefer a language which
allows for definition of data types and has good integration of RDBMS
communication.  Granted, aforementioned precondition is not really a low
bar - especially when working on a large set of different systems - so
your approach might be more practical.

> Apart from world peace.

:-)

Ruby is no better at that:

irb(main):002:0> class Planet; end
=> nil
irb(main):003:0> world = Planet.new
=> #<Planet:0x85cfb2c>
irb(main):004:0> world.peace!
NoMethodError: undefined method `peace!' for #<Planet:0x85cfb2c>
        from (irb):4
        from /usr/local/bin/irb19:12:in `<main>'

Kind regards

        robert


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gerard H. Pille  
View profile  
 More options Apr 21 2012, 9:59 am
Newsgroups: comp.databases.oracle.server
From: "Gerard H. Pille" <g...@skynet.be>
Date: Sat, 21 Apr 2012 15:59:22 +0200
Local: Sat, Apr 21 2012 9:59 am
Subject: Re: Scripting language for DBAs

I once read a collection of ways to shoot oneself in the foot, using different
programming languages.  Probably in the BJ era.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »