FAQ
I'm looking for a common scripting language for system administration
and Oracle administration. I have lots of shell scripts that work fine
on Linux but I need something that works unchanged on Windows too. I
want to rewrite the shell scripts and the new scripts should be easy
to read and comprehend.
Any pros, cons or tips would be appreciated.

Steve Harville

http://www.linkedin.com/in/steveharville

Search Discussions

  • Anonymous at Sep 15, 2010 at 1:32 pm

    I'm looking for a common scripting language for system administration
    and Oracle administration.
    Perl?

    I'm not a guru myself, in fact,. I hardly understand it! Jarred
    (Apologies if I've spelt your name wrong!) on this list is a guru and
    uses Perl quite extensively for Oracle duties I believe.

    I even think that an Oracle install installs Perl
  • Matthew Zito at Sep 15, 2010 at 9:53 pm
    I will say, I ran into some stupidity on the part of the Ruby Oracle
    driver once - something about incorrectly passing in character encoding
    or something - the maturity is definitely not there like it is for perl
    or python.



    Matt



    From: Jared Still
    Sent: Wednesday, September 15, 2010 5:51 PM
    To: steve.harville_at_gmail.com
    Cc: Matthew Zito; oracle-l
    Subject: Re: Anyone using Ruby for scripting?



    On Wed, Sep 15, 2010 at 9:33 AM, Steve Harville
    wrote:
    In any case, trying to do team programming with perl can be annoying,
    because you need to really get people to agree on common practices and
    conventions, because otherwise you have six different ways of doing the same
    thing, and your code turns into a mess.
    This is why I was looking at Ruby.

    --

    If you're working with Oracle, Perl is the #1 choice.

    The DBI and DBD::Oracle modules cannot be beat for Oracle access.

    As Cary said, Perl can do anything.

    Jared Still
    Certifiable Oracle DBA and Part Time Perl Evangelist
    Oracle Blog: http://jkstill.blogspot.com
    Home Page: http://jaredstill.com

    --
    http://www.freelists.org/webpage/oracle-l
  • Vishal Gupta at Sep 15, 2010 at 10:03 pm
    How about jython?

    Cheers,
    Vishal

    On 15 Sep 2010, at 22:52, "Jared Still" wrote:

    On Wed, Sep 15, 2010 at 9:33 AM, Steve Harville < steve.harville_at_gmail.com> wrote:

    In any case, trying to do team programming with perl can be annoying,
    because you need to really get people to agree on common practices and
    conventions, because otherwise you have six different ways of doing the same
    thing, and your code turns into a mess.


    This is why I was looking at Ruby.


    --


    If you're working with Oracle, Perl is the #1 choice.

    The DBI and DBD::Oracle modules cannot be beat for Oracle access.

    As Cary said, Perl can do anything.

    Jared Still
    Certifiable Oracle DBA and Part Time Perl Evangelist
    Oracle Blog: <http://jkstill.blogspot.com> http://jkstill.blogspot.com
    Home Page: <http://jaredstill.com> http://jaredstill.com
  • Octavian Rasnita at Sep 16, 2010 at 6:56 am
    I recommend Perl.

    Not only that it is very flexible and you can use Oracle very easy with it,
    but you will also have access to the dozens of thousands of Perl modules you
    can install from CPAN that might also help you to do many things even
    easier.

    A program that access an Oracle database could look like:

    use DBI;

    my $dbh = DBI->connect("dbi:Oracle:host=10.10.10.10;sid=orcl", "username",
    "password");

    my $sth = $dbh->prepare("insert into users(name, email) values(?, ?)");

    $sth->execute('John', 'me_at_host.com');
    $sth->execute('Brian', 'b_at_host.net');

    my $sth2 = $dbh->prepare("select name, email from users where locality=?");
    $sth2->execute('Erevan');

    while (my $row = $sth2->fetchrow_hashref) {
    print $row->{NAME}, "|", $row->{EMAIL}, "\n";
    }

    Or you will be able to use an ORM like DBIx::Class and after generating the
    Perl classes for your database schema say... MyDB::Schema using a command,
    you will need to use a code like:

    use MyDB::Schema;

    my $schema = MyDB::Schema->connect("dbi:Oracle:host=10.10.10.10;sid=orcl",
    "username", "password");

    my $users = $schema->resultset("Users");

    $users->create({
    name => 'john',
    email => 'me_at_host.com',
    });

    my $users_from_erevan = $users->search({locality => 'Erevan');

    Then you will be able to use related data from other tables without doing
    other queries using something like:

    while (my $user = $users_from_erevan->next) {
    print $user->name, "|", $user->email, "\n";
    print $user->supervisor->name;

    my $clients = $user->clients;

    while (my $client = $clients->next) {
    print $client->name;
    }
    }

    --Octavian

    Original Message -----
    From: "Steve Harville"
    To: "Oracle-L Group"
    Sent: Wednesday, September 15, 2010 3:58 PM
    Subject: Anyone using Ruby for scripting?
    I'm looking for a common scripting language for system administration
    and Oracle administration. I have lots of shell scripts that work fine
    on Linux but I need something that works unchanged on Windows too. I
    want to rewrite the shell scripts and the new scripts should be easy
    to read and comprehend.
    Any pros, cons or tips would be appreciated. >
    Steve Harville >
    http://www.linkedin.com/in/steveharville
    --
    http://www.freelists.org/webpage/oracle-l
    --
    http://www.freelists.org/webpage/oracle-l
  • David Mann at Sep 17, 2010 at 2:28 pm
    Cary Millsap wrote
    In my completely biased opinion: Perl.
    - Its' everywhere.
    This is a big reason why Perl wins in my environment. I have 400 databases
    spread on dozens of *nix-like servers. For 10g and 11g instances I can count
    on the Perl that is installed with Oracle (it already has DBI and
    DBD::Oracle) to get 95% of what I need. Its not the most up to date, but it
    works and is already there so the most complex part of the scripting
    environment is checking paths and making the shebang line at the top of the
    Perl scripts reference the binaries I am using.

    I do miss out on being able to leverage CPAN - I wouldn't recommend trying
    graft any CPAN modules on the Perl that comes with Oracle, just seems too
    risky and I am in healthcare - sysadmins would have a cow if I started
    asking for more permissions than I have now so I can compile things :)

    -Dave

    --
    Dave Mann
    www.brainio.us
    www.ba6.us - Database Stuff - http://www.ba6.us/rss.xml

    --
    http://www.freelists.org/webpage/oracle-l
  • Blanchard, William G at Sep 20, 2010 at 1:29 pm
    I would gladly use ruby or python for scripting but they're just not
    included in most installs by default. Rather than try to fight with the
    UNIX/Linux teams, I just use bash, ksh or perl. My chief complaint with
    perl is the kludgy way perl has of editing a file. I can write a perl
    one-liner that edits a file but can't, from within a perl script,
    directly edit a file.





    WGB



    From: oracle-l-bounce_at_freelists.org
    On Behalf Of Connor McDonald
    Sent: Monday, September 20, 2010 8:24 AM
    To: oracle-l@freelists.org
    Subject: Re: Anyone using Ruby for scripting?



    I still love the old maxim:

    "If you have a problem, you can use Perl....Now you have two problems"

    :-)

    --
    Connor McDonald
    ===========================
    email: connor_mcdonald_at_yahoo.com
    web: http://www.oracledba.co.uk

    "Semper in excremento, sole profundum qui variat"

    _____________

    The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you.
    _____________

    --
    http://www.freelists.org/webpage/oracle-l
  • Crisler, Jon at Sep 20, 2010 at 3:15 pm
    Are there any performance implications for Active Dataguard (DG)
    compared to standard DG? I am thinking primarily in the areas of
    transport time and bandwidth, and somewhat in disk i/o. Thanks in
    advance.
  • Radoulov, Dimitre at Sep 20, 2010 at 6:16 pm

    On Mon, Sep 20, 2010 at 6:29 AM, Blanchard, William G
    wrote:
    I can write a perl one-liner that edits a file but can’t, from
    within a perl script, directly edit a file.
    You can:

    {

    local ($^I, _at_ARGV) = ('', 'your_file');
    while (<>)

    {
    s/current/new/;
    print;
    }

    }

    Regards
    Dimitre

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouporacle-l @
categoriesoracle
postedSep 15, '10 at 12:58p
activeSep 20, '10 at 6:16p
posts9
users9
websiteoracle.com

People

Translate

site design / logo © 2022 Grokbase