orac_Oracle.pm - the Oracle module to the Orac tool
This code is a database object that can be created by the Orac tool. It inherits from orac_Base, which has all the basic data and methods. Some of those are called from here, some are overridden, most are inherited and used as is.
&new() &init1() &init2() &dba_user()
This constructor method basically sucks up the orac_Base functions to create the orac_Oracle object.
This sets some environmental variables that DBD::Oracle requires to get to the right database.
Picks up a few values used again and again by the rest of the orac_Oracle object (eg: block size).
Works out if anything is waiting in the database and then produces the relevant report.
This function gives you two differing reports which measure the Shared Pool disk reads for various SQL statements in the library.
Works out who is holding whom, so we can unblock needless locking. Gives you various options for trying to view the blocking SQL. Gives a schematic report to try and pinpoint the offending program.
Takes particular PL/SQL statements, and generates DDL to recreate ALL of a particular object in the database.
Generates a script with which you can completely regenerate the skeleton of your database (files, users, etc).
Pumps out information on a particular error. This error comes from the pick-list error screen, which detects invalid objects in the database.
A complex function for generating on-the-fly Forms for viewing database information. This examines DBA tables, and works out how to build the form. Then it asks the user to input SQL, and order the way it comes back.
Once this is done, Orac goes off and fills the on-the-fly data viewer with the required information.
User may wish to narrow search for info with universal form, down to a particular set of rows, and order these rows. This function helps univ_form() and allows them to do that.
Now we've built up our full SQL statement for this table with selector(), fill a Perl array with everything and display it in the univ_form(), on-the-fly viewer.
This whizzes backwards and forwards through the univ_form() records' array, displaying up the required information.
Work out which row of information to display, and then display it. The name of this function comes from a very bad 80's TV show, hosted by Henry Kelly :)
It all gets a bit nasty here. This works out the user's intentions on how to order their required information for the univ_form() set of functions.
This helps build up the ordering SQL string.
Picks up everything finally reqd. to build up the DDL for index creation. It then works out the exact DDL, including INITIAL and NEXT sizes, to create a particular index, on a particular database object.
Small helper function for working out Index DDL.
Here lies the end of sanity. Welcome! This function drove me mad when I first wrote it. It basically takes several lines of radiobuttons, and makes sure only one of the is set in each column. This is used to help the user select the correct ordering for their table selections. There must've been an easier way than this, but it worked at the time, looked nice, and still works now, so I'm leaving it alone. I'll let you work out what j_inri stands for.
Works out new Y-coordinate positions for various simple canvas graphs called by Orac.
Produces rectangular bar line on canvas for simple charts.
Works out File/IO and produces graphical report.
Another small helper function to increment the Y-coord values on simple Canvas line graphs.
Prints out lines required for File/IO graphical report.
Creates Viewer window, for selecting invalid database objects. Once this is done, all the reported compilation errors on the object are printed in the main screen.
Creates DBA Viewer window, for selecting various DBA_XXXX tables, which can then be selected upon.
Produces a list of all the PADDR addresses in the database, to help a DBA examine what's running. Useful info for deciding what to kill off in a locked up database.
Produces a list of all the SIDs in the database, to help a DBA examine what's running. Useful info for deciding what to kill off in a locked up database.
Produces Rollback report.
Produces Rollback Statistics report.
Produces reports trying to determine shared pool fragmentation, etc.
Produces a scrolling box, with which to view all of the SQL code in the database library. If the user is the logged-on user, gives Orac user opportunity to "Explain Plan". Alternatively, Orac user can clear screen and input their own new SQL to "Explain".
Takes the SQL statement directly from the screen and tries an 'Explain Plan' on it. I'm leaving the SQL hard-coded here so you can see EXACTLY what's going on, particularly as we're dipping our toes into DML.
Whizz backwards and forwards through the v$sqlarea records, picking up the right ones to put into the SQL Browser.
Takes a DBI information array, and takes out the correct required line from it, and pastes it onto the screen. What fun! :)
Check if the currently logged on DBA user has a valid PLAN_TABLE table to put 'Explain Plan' results to insert into.
Reads storage of the required Block Size value from a package variable, and then gives it back to the caller.
One of my most life-saving functions. This works out which user is blocking which user is nasty lockup situations. Kill, is usually the answer.
Report for finding MTS statistics, and providing secondary button to reveal further stats.
On the final level of an HList, does the actual work required.
Takes the final PL/SQL function, runs it, and then splatts out the results into a DialogBox for the User to peruse.
Produces simple graphical representations of complex percentage style reports.
Creates various tuning pies and inserts them into a pop-up screen.
Creates various graphs and inserts them into a pop-up screen.
Creates DBA Viewer window, for selecting various tablespace, which can then be selected upon.
A support function of tabsp_hlist, DO NOT CALL DIRECTLY!!!
This is called when an entry is double-clicked. It decides what to do. Basically ripped off from the "Adv. Perl Prog." book. :-)
A support function of generic_hlist, DO NOT CALL DIRECTLY!!!
show_or_hide calls this when it needs to add new items. Here is where the SQL is called.
This subroutine is called with the results from show_sql() to allow DB modules to "post process" the output, if required, before it is analyzed to be shown. This is useful for turning numeric flags into words, and other such DB dependent things. This generic one does NOTHING!
To install orac_Font, copy and paste the appropriate command in to your terminal.
cpanm
cpanm orac_Font
CPAN shell
perl -MCPAN -e shell install orac_Font
For more information on module installation, please visit the detailed CPAN module installation guide.