AbaPerls is a collection of tools written in Perl that started its life in 1996 to support the development and deployment of the a product known as AbaSec that I worked with at the time - and still do for that matter.
The main focus for AbaPerls is development, configuration-management and installation of MS SQL Server databases with Visual SourceSafe as the version-control system. AbaPerls also includes tools for searching and replacing in SourceSafe that are useful for any SourceSafe user, even if you do not use SQL Server. While designed with the aim to support the development of a specific product, AbaPerls is not hard-wired to AbaSec, but can be used for other development efforts that uses the same environment as AbaSec. But at the same time AbaPerls does not have any the pretention to be full-fledged product. It has been designed as an in-house development tool, with the toolsmith in reach. A primary aim in the development of AbaPerls has been to keep down development time, development time of AbaPerls that is. So in places AbaPerls makes assumptions or imposes limitations that fits well with how we work with AbaSec, but may appear utterly confusing or inconvenient to you. (Hey, even my colleagues thought some of it was funny. They got used to it...)
And just a word of warning if you are expecting nice-looking Windows dialogues: The AbaPerls tools are all command-line tools only. There is no GUI.
AbaSec developers should be aware of that AbaPerls very much is a moving target, and tools are changed or added every now and then.
The prime developer component of AbaPerls is the load tool ABASQL. ABASQL is a wrapper on the AbaPerls file-loading process, which goes far beyond what you get through Query Analyzer or OSQL. Here is a sample of what you get:
-cryptTypically you invoke ABASQL from a external text editor that permits you execute a command-line tool from the editor. In the AbaSec group we use TextPad.
To build an empty database AbaPerls provides the tool DBBUILD. DBBUILD finds the SQL files in a SourceSafe project and its subprojects and load these into database in a well-defined order. DBBUILD loads all files with the AbaPerls file-loading process, thus everything you get with ABASQL, you get with DBBUILD. Since the log from a database build can become huge, AbaPerls offers LISTERRS that extracts the interesting part of the log, that is the errors and warnings.
DBUPDGEN compares two SourceSafe versions of a project tree, and from the differences it generates an update script, that will update the database from one version to the other. These upgrade scripts use the AbaPerls file-loading process, so again the full power of ABASQL is available.
To facilitate things for DBBUILD, DBUPDGEN as well as other tools, there is the AbaPerls SQL directory structure, which maps file to various directories depending on their file extension.
The product I work with consists of several modules, some large and some small, and each costumer typically has his configuration. Unless there is some special reason, all modules reside in the same database, as high-level modules typically refer to tables and stored procedures in the base modules.
These modules are in AbaPerls called subsystems. A subsystem is set of database objects – types, tables, stored procedures etc – that you build or update together. A database can consist of one or more subsystems. You define the subsystem configuration for a database in a configuration file (or config-file for short). The config-file does not only define which subsystems to include in the database, but you can also specify configuration options, either on database level or on subsystem level.
Provided that you include the ABAPERLS subsystem (which includes the AbaPerls system tables) in the database, DBBUILD saves the configuration options in the database. Then ABASQL and the update scripts generated by DBUPDGEN read these, and acts as if these options had been specified on the command line. For instance, in the config-file you can specify that all stored procedures, triggers and views are to be stored encrypted, and then ABASQL will automatically add WITH ENCRYPTION when it loads the objects.
DBUPDGEN can also work with a config-file and generate an update script for many subsystems. When you run the update script, it checks the database for available subsystems, and ignores the subsystems in the script not present in the database.
Sometimes you may want to see what a config-file maps to. To this end there is the tool LISTCONFIG.
In many databases, there are tables into which you need load with data, before the application can start working. AbaPerls includes the tool INSFILGEN which reads an Excel workbook and from this generates INSERT-files.
Two very handy tools for finding things in SourceSafe:
AbaPerls has its own set of tables to keep track of versions of subsystems and objects loaded in the database. These tables, and the stored procedures that goes with them, constitute a subsystem of its own, called ABAPERLS. The use of these tables are not mandatory; you need to explicitly include the ABAPERLS subsystem in your database to make use of them. But without them, you will miss some of the functionality of AbaPerls. For instance, in a database which has the ABAPERLS subsystem installed, you can use the stored procedure ap_sob_report_suspects_sp to see if anyone has loaded files outside the regular installation scripts.
AbaPerls runs on Windows and supports SQL Server versions 2000 and later and Visual SourceSafe versions 6 and 2005. You need Perl 5.8 to run AbaPerls, but Perl is free software. For further information, see Downloading and installing AbaPerls.
Over the years, more and more features and concepts have been added to AbaPerls, so it does take more than a coffee break to learn it. The good news is that you don't have to learn everything to start using some of the AbaPerls tools. Here I try to outline three different "tracks" to get started with AbaPerls.
The tools SSGREP and SSREPLACE are powerful enough to themselves be interest for shops that do not use MS SQL Server, or are not interested in the developer and CM support offered by AbaPerls. For this track you may want to read:
This track is for SQL developers who write stored procedures and such, but themselves do not build or update databases. They will in many cases use only ABASQL Occasionally they may use SSGREP, SSREPLACE, INSFILGEN and RUNSPS.
The recommended documents for this track are:
This far, you are ready to use ABASQL. Later on, you may also want to read these documents:
This track includes the full set of AbaPerls tools and concepts. Even a DBA or a CM person should probably start with the plain-developer track, and play a little with ABASQL before moving on.
Here is a complete suggestion of a reading order for a DBA or a CM-person which mainly goes into topics first, before arriving at the command descriptions.
This far, this is mainly an extended developer track. We now move to more central topics for a DBA/CM-person.
As for the remaining commands, I have not listed them in any reading-order; explore them at your own pace.
Through the years, several of my co-workers have provided valuable input and ideas, and I particularly like to mention Leif Jettman and Jan Afrell who have suffered from bugs due to quick check-ins, less ideal design decisions etc.
And of course, due credit should go to Larry Wall who originally designed Perl. Without this powerful language AbaPerls would not have been possible.
Perl is free software, available under the http://www.perl.com/pub/a/language/misc/Artistic.html.
Erland Sommarskog, esquel@sommarskog.se.