The Fusion of Perl and Oracle
by Andy DuncanSeptember 04, 2002
Andy Duncan is the co-author of Perl for Oracle DBAs.
My coauthor, Jared Still, and I had the task of writing a book, Perl for Oracle DBAs, about two of our favorite subjects, Perl and Oracle. Our goal was to link Perl and ready-canned Perl applications to the job of making an Oracle DBA's life both easier and better. Besides covering the entire spread of Perl, and in particular, relating the examination and control of Oracle databases, we also created a wide-ranging, open source Perl Toolkit for Oracle DBAs. The toolkit contains all the Perl scripts we've used as DBAs for the past decade, wrapped up into a single, object-oriented project for both Unix and Win32, and which forms the heart of our book. We've also included a comprehensive guide to all of the Perl Oracle DBA tools already out there, including Orac, Oracletool, DDL::Oracle, StatsView, Senora, Apache::OWA, and many more.
I thought that in this article, we'd go beyond our passionate and committed belief that Perl is simply the finest scripting language ever invented for helping Oracle DBAs in their daily working lives, and question just why Perl possesses such a good symbiosis with the Oracle database. We'll also try to explain how the answers to this question helped us construct our Perl DBA Toolkit.
|
Related Reading
|
Objectivism
At first glance, Perl and Oracle seem like strange bedfellows, so how can they be linked so well to each other? We think there's is perhaps even a philosophical link stretching between Perl and Oracle, all the way back to Aristotle and Athens, the first state in the world to champion the rights of the individual. This link, we believe, is "Objectivism." This most modern of philosophies was created by Ayn Rand, an escapee of 1920s Leningrad, who is more famous as the author of Atlas Shrugged. It remains perhaps one of the most influential books of the past 100 years, in the same league as Brave New World, Animal Farm, and 1984; it is also the fictional representation of Objectivism.
Ayn Rand's ideas form a philosophy in defense of the individual and his or her rights, which spring principally from an individual's right to life, and the pursuit of his or her own happiness, within the rule of law. To demonstrate this, in a dramatic sense, Ayn Rand's books portrayed what she later called "Ideal" men. In one of her earlier books, The Fountainhead, Ayn Rand's hero was Howard Roark, a maverick architect, and the best of his generation, who insists on clean, simple, and strong design. Virtually everyone else is stuck in ornament and the nineteenth century, whereas Roark creates great soaring towers of glass and steel that take one's breath away. Although Roark often takes payment and credit, he is so dedicated to his craft that he often misses out on both, handing them on to other, lesser architects just so he can see his bold designs completed.
Roll the clock forward 50 years, and if Ayn Rand were to write The Fountainhead now, it would be surprising if she didn't replace her building architect with a computer language architect, perhaps someone like Larry Wall. Howard Roark's architecture brings joy to millions of ordinary, hard-working people. In the same way, Perl has increased the productivity and creative expression of Oracle DBAs and system administrators everywhere because it is so deliberately tailored toward the individual. It is all things to all people, and you can blend it with any architecture to create exactly the software you want. You are limited only by your system administrator's disk quota for DBA users. Similarly, with our toolkit, we have tried to keep it free from adornment and left it highly configurable for your own individual needs. We've also tried to aid the construction of further solutions, and keep this as simple as possible by providing ready-built modules that you can plug right into your own designs and interfaces. Our main architectural modules are summarized below, in Table 1.
Table 1. Main PDBA Toolkit Supporting Modules
| Module | Description |
|---|---|
PDBA::CM |
Connection manager that simplifies Perl-to-Oracle connectivity. |
PDBA::ConfigFile |
Finds and opens configuration files. |
PDBA::ConfigLoad |
Finds, opens, parses, and loads configuration files into memory. |
PDBA::DBA |
Designed for DBA-specific tasks; many methods are data- dictionary related. |
PDBA::Daemon |
Runs Perl script daemons on Unix. |
Win32::Daemon |
This module, by Dave Roth, is included (with permission) because it is so important to toolkit daemon services on Win32 systems. |
PDBA::GQ |
Generic Query module that simplifies single tables queries. |
PDBA::LogFile |
Creates and locks log files; used by many scripts in the toolkit to perform logging actions. |
PDBA::OPT |
Processes command line arguments unhandled by calling scripts. |
PDBA::PWC |
Password client module. |
PDBA::PWD |
Password server module. |
PDBA::PWDNT |
Password server modules for Win32. |
PDBA::PidFile |
Used to control script execution. |
PDBA |
Modular collection of widely used methods. |
With architecture, as with Perl, what you see is what you get, and it is impossible to hide steel and glass constructions from rival architects. However, your inspiration and artistic ability are your own, and it is your signature at the bottom of the blueprints, just as it is Larry Wall's copyright name on the Perl Artistic License. So if Larry Wall is an "Ideal" man in Ayn Rand's Objectivist mold, what about the other Larry in our story, Mr. Ellison of Redwood Shores?
Proprietary Technology
In Atlas Shrugged one of the main "Ideal" men is Hank Rearden. Using his own capital, determination, and research ability, Hank Rearden creates a proprietary super-strength metal, of which the whole world is unable to get enough. It is used in fast trains, speeding bullets, and tall buildings. This entirely new metal is cheaper, lighter, and stronger than any other known type of steel or alloy; Rearden Metal is a product that transforms the world. Once again, rolling forward a couple of generations and modernizing the names, if Ayn Rand were to replace the key productive technology of 1950s America with that of early twenty-first century America, she would probably choose to write about databases. Her hero, Larry Rearden, would be a rugged individualist running a database corporation that creates cutting-edge products used throughout the world in a thousand different industries. Remind you of anyone?
We think Oracle and Perl work together so well because they were both created by incredible individuals for other individual businesses, individual Oracle DBAs, and individual Perl programmers. With both there are no imposed limits, and just as much help as you might need, from either Oracle support, or the worldwide Perl community. And of course, Perl for Oracle DBAs.
Pages: 1, 2 |


