Installation |
The following instructions assume that all requirements mentioned in the
Requirements section of this documentation are
met. Especially: an Oracle Database Server up and running.
|
Installing OSPRep and Oracle StatsPack by script |
If you have not yet installed the StatsPack (as delivered by Oracle) into
your database - no problem: We make this easy for you providing a script
doing all the needed work, including the installation of the OSPRep extensions
you wish to use. To do so, the following steps are required:
|
- Change to the install/ directory (below the place where you unpacked
OSPRep into)
- Open the file
spcreate.sh with your favorite editor
- In the configuration section, adjust the settings to reflect your needs
- Save and execute the script
|
To verify the successfully execution, a few logfiles will be created: One
explicitely by spcreate.sh , and a few more implicitely by the
Oracle scripts called.
|
If you already had the StatsPack installed, you may want to add some of the
extensions manually. Please obey the order of execution in those places, where
multiple scripts are to be run for one extension:
|
- File Statistics:
install/database/fileobj.sql and
install/database/getfilestat.sql
- Session Statistics:
install/database/get_sesstat.sql
- Wait Statistics:
install/database/waitobj.sql and
install/database/getwaits.sql
|
Furthermore, make sure the needed data are collected after
each snapshot is taken (again, the spcreate.sh will set this
up for you if you used it). In the database job creating your snapshot, you
need to add the appropriate lines after the call to
statspack.snap :
|
- File Statistics:
get_fileinfo
- Session Statistics:
get_sesstat
- Wait Statistics:
get_waitevents
|
Using the AWR compatibility layer |
Starting with OSPRep v0.4.5, a basic "compatibility layer" to the AWR (Auto
Workload Repository) of Oracle 10g was added. So if you are running Oracle 10g,
and do not want to install StatsPack in addition to the already included AWR,
this may be an option for you.
|
There are still some restrictions and limitations (see the introductional
comments in install/database/awr_setup.sql ), but many things are
already covered.
|
In order to be able to generate OSPRep reports based on AWR data, you first
need to establish the compatibility layer. That is, in general, emulating
the StatsPack tables by creating corresponding views, plus the minimal PL/SQL
stuff. For this, you need to complete the following steps:
|
- Create a new database user with at least the same privileges as PERFSTAT
usually gets. Of course you may also use an existing one matching these
conditions, but take care NOT to have ANY StatsPack objects installed with
this user (especially not running
spcreate.sql and the like),
for those are conflicting with the compatibility layer.
- Change to the
install/database directory of the extracted OSPRep sources
- Use SQL*Plus to connect to the user created in step 1, and execute the script
@awr_setup.sql – you should see the progress of creating the
layer, but no error messages.
- Remember to configure OSPRep (in the
config file, or later using command
line options) to connect to this user
- While in the configuration (the
config file), check the settings against
the "problematic ones" mentioned in awr_setup.sql as e.g. "not yet working",
and make sure to disable them. Otherwise, report generation will most likely fail.
|
Setting up OSPRep |
Now we can go to setup OSPRep itself:
|
- Create a directory where the generated reports shall be stored in.
This directory should be somewhere below your web servers
DOCUMENT_ROOT , if you intend to serve the reports using an
IntraNet or InterNet web site.
- Create the directories for the Web-Includes. They must be located
directly below (i.e. "in") the one created in step 1 and must be named
help (for the Online Help pages) and inc for
the code snippets.
- Create a directory for the scripts. This directory must NOT
be below your web servers document root but in a somehow safe place, only
accessible by authorized users. This directory is referenced to as
"
~/scripts " from now on.
- Unpack the archive into the
~/scripts directory. Make sure
to retain the directory structure inside the archive. A safe way to do so
is to copy the osprep*.tgz file to the target directory,
change into this directory and run the command tar xzf osprep*.tgz .
- Edit the configuration file to reflect your systems settings. The
default configuration file is named
config and to be found
within the ~/scripts directory. For details on this step, see
the chapter on configuration.
- Create the Web-Includes. To do so, change to the
~/scripts/install directory and run the mkhelp.sh
script located there. This will process the template (*.tpl )
files and generate the HTML help pages out of them, which will be placed
into the help/ directory created in step 2. Other files needed
there (as e.g. the help icon) will be copied to their location as well as
the code snippets. Optionally set up the
Collector Plugins from this directory.
- In six days G*d created the heavens and the earth (see Gen 1+2) - the
seventh day is Shabbat, and He rested. So get yourself a cup of coffee,
tea, or whatever drink you like, and relax for a moment - your
(installation) work is done!
|
OSPRep Addons |
And finally: The AddOns. Starting with v0.4.x, the AddOns are already
converted from "anonymous blocks" to "stored procedures" - which means, in
order to use them, you need to install the osprep package into the database.
If you did not install them with the spcreate.sh script
described above, this can be done as follows:
|
- Change to the install/database/ subdirectory of your OSPRep installation
- Invoke Sql*Plus and connect as the statspack user (perfstat)
- Run the following command:
@pkg_osprep.sql
|
Further Readings |
Now that you succeeded up to this point, continue with the
usage page to read important things about how to
call the ~/scripts/sreport.sh , ~scripts/charts.sh and
~/scripts/fts_plans.sh scripts. Maybe after a while you want to
fine-tune your setup: read more about that on the
configuration page.
|