DBCollect/Install: Difference between revisions

From Dirty Cache Wiki
Jump to navigation Jump to search
No edit summary
Tag: Manual revert
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Category:Tools]]
[[Category:Tools]]
[[Category:DBCollect]]


= DBcollect Install =
= Summary =
 
== Summary ==


Installing DBCollect is pretty simple: download the latest dbcollect zipapp, put it somewhere in $PATH, and make it executable.
Installing DBCollect is pretty simple: download the latest dbcollect zipapp, put it somewhere in $PATH, and make it executable.


== Downloading DBcollect ==
= Prerequisites =
 
The latest release is always available on the releases page:
[https://github.com/outrunnl/dbcollect/releases/latest DBcollect package]


On the releases page, go to the latest release, open Assets and download dbcollect.
* Python 2.6 or higher
* Python-argparse (is usually included in the Python distribution except for very old versions)
* Enterprise Linux 6, 7 or 8 (RHEL, Oracle Linux, etc), Solaris 11, IBM AIX 7
* Some free space in /tmp (or elsewhere, use --tempdir)
* Oracle RDBMS 11g or higher (optional)
* Diagnostics pack license OR statspack configured on the database(s)
* Access to the 'oracle' special user or dba privileges ('root' not required)
* Database instances up and running (opened read/write required for AWR/Statspack)
* SYS credentials (hence the 'oracle' or dba user requirement)


== Scripted install ==
= Downloading DBcollect =


To make life a bit easier, the github page provides a simple script that downloads the latest dbcollect release, puts it in /usr/local/bin and makes it executable.
The latest release is always available on the releases page:


This requires the host on which you run this to have internet access. If you run this as root, all works as expected. If you run this as other user (i.e., oracle), you need to move it yourself to the right location.
[https://github.com/outrunnl/dbcollect/releases/latest DBcollect releases (GitHub)] On the Github releases page, go to the latest release, open Assets and download dbcollect.


<syntaxhighlight lang=bash>
[https://dblytics.dirty-cache.com/download DBCollect Download (application page, not always working)] is a direct link to the latest version.
# This requires internet access via https
# Inspect downloader (optional)
curl https://raw.githubusercontent.com/outrunnl/dbcollect/master/scripts/download | less


# Download using downloader
= Easy Install =
curl https://raw.githubusercontent.com/outrunnl/dbcollect/master/scripts/download | python


# Move it to /usr/local/bin
If your system has internet (https) access, see [https://dblytics.dirty-cache.com/dbcollect dbcollect install]
sudo mv dbcollect /usr/local/bin
for an easy way to install {{dbcollect}}


# Or move it to the current user's $HOME/bin (if it exists, usually user 'oracle'):
== Warning ==
mv dbcollect $HOME/bin/
</syntaxhighlight>


'''WARNING'''
== DBCollect location ==


Do NOT put dbcollect in non-standard locations such as /tmp, /root etc. The user dbcollect runs as (usually oracle) needs to have access to the dbcollect file (hence it does not work in /root).
Do NOT put dbcollect in non-standard locations such as /tmp, /root etc. The user dbcollect runs as (usually oracle) needs to have access to the dbcollect file (hence it does not work in /root).
It also may not work on mounted paths that have execute disabled (/tmp, /var/tmp, ...)
It also may not work on mounted paths that have execute disabled (/tmp, /var/tmp, ...)
== Cloning Git Repository ==


Do NOT clone the git repository and run it from there (it will result in an error). This to prevent tampering, and weird problems (the zipapp package ensures all required files are contained in a predictable location).
Do NOT clone the git repository and run it from there (it will result in an error). This to prevent tampering, and weird problems (the zipapp package ensures all required files are contained in a predictable location).


= Other requirements =
= Other requirements =
== Linux ==
On Linux (EL7+) both Python 2 and 3 may be installed. To set the preferred version globally on the system, use <code>alternatives</code>
<syntaxhighlight lang=bash>
alternatives --set python /usr/bin/python3
</syntaxhighlight>
== AIX ==
On IBM AIX, you need to install Python first. You can get python for AIX from
[https://www.ibm.com/support/pages/aix-toolbox-linux-applications-overview AIX Toolbox (IBM)]
Make sure it is executable and available in $PATH.
Simply running <code>python</code> should work.
== Solaris ==
On Solaris, Python should be already available. It may be an older version.
Make sure you can run <code>python</code> from the command line.
== HP-UX ==
HP-UX has experimental support. Some OS commands require sudo access, run <code>dbcollect --sudoers</code> to install the sudoers file
before proceeding. This will allow {{dbcollect}} to pick up required stuff like CPU model, disk capacities and more.
<code>sudo</code> must be installed for this to work.
== Windows ==
{{dbcollect}} does not yet support Windows. Let me know if you need it.


== Python ==
== Python ==


The dbcollect app runs using a shebang (<code>#!/usr/bin/env python</code>). This means Python needs to be available in the environment. Some systems do not have this by default. Enable it using
The dbcollect app runs using a shebang (<code>#!/usr/bin/env python</code>). This means Python needs to be available in the environment to run <code>dbcollect</code>. Some systems do not have this by default.
 
On UNIX (AIX, Solaris) you may have to create a symbolic link or run {{dbcollect}} like this:
 
<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
alternatives --set python /usr/bin/python3
python3 /usr/local/bin/dbcollect
</syntaxhighlight>
 
If all else fails, you can run {{dbcollect}} from python directly:
 
<syntaxhighlight lang=bash>
python /usr/local/bin/dbcollect
# or
/usr/bin/python /usr/local/bin/dbcollect
# or
python2 /usr/local/bin/dbcollect
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 14:09, 20 July 2024


Summary

Installing DBCollect is pretty simple: download the latest dbcollect zipapp, put it somewhere in $PATH, and make it executable.

Prerequisites

  • Python 2.6 or higher
  • Python-argparse (is usually included in the Python distribution except for very old versions)
  • Enterprise Linux 6, 7 or 8 (RHEL, Oracle Linux, etc), Solaris 11, IBM AIX 7
  • Some free space in /tmp (or elsewhere, use --tempdir)
  • Oracle RDBMS 11g or higher (optional)
  • Diagnostics pack license OR statspack configured on the database(s)
  • Access to the 'oracle' special user or dba privileges ('root' not required)
  • Database instances up and running (opened read/write required for AWR/Statspack)
  • SYS credentials (hence the 'oracle' or dba user requirement)

Downloading DBcollect

The latest release is always available on the releases page:

DBcollect releases (GitHub) On the Github releases page, go to the latest release, open Assets and download dbcollect.

DBCollect Download (application page, not always working) is a direct link to the latest version.

Easy Install

If your system has internet (https) access, see dbcollect install for an easy way to install dbcollect

Warning

DBCollect location

Do NOT put dbcollect in non-standard locations such as /tmp, /root etc. The user dbcollect runs as (usually oracle) needs to have access to the dbcollect file (hence it does not work in /root). It also may not work on mounted paths that have execute disabled (/tmp, /var/tmp, ...)

Cloning Git Repository

Do NOT clone the git repository and run it from there (it will result in an error). This to prevent tampering, and weird problems (the zipapp package ensures all required files are contained in a predictable location).

Other requirements

Linux

On Linux (EL7+) both Python 2 and 3 may be installed. To set the preferred version globally on the system, use alternatives

alternatives --set python /usr/bin/python3

AIX

On IBM AIX, you need to install Python first. You can get python for AIX from AIX Toolbox (IBM)

Make sure it is executable and available in $PATH.

Simply running python should work.

Solaris

On Solaris, Python should be already available. It may be an older version. Make sure you can run python from the command line.

HP-UX

HP-UX has experimental support. Some OS commands require sudo access, run dbcollect --sudoers to install the sudoers file before proceeding. This will allow dbcollect to pick up required stuff like CPU model, disk capacities and more. sudo must be installed for this to work.

Windows

dbcollect does not yet support Windows. Let me know if you need it.

Python

The dbcollect app runs using a shebang (#!/usr/bin/env python). This means Python needs to be available in the environment to run dbcollect. Some systems do not have this by default.

On UNIX (AIX, Solaris) you may have to create a symbolic link or run dbcollect like this:

python3 /usr/local/bin/dbcollect

If all else fails, you can run dbcollect from python directly:

python /usr/local/bin/dbcollect
# or
/usr/bin/python /usr/local/bin/dbcollect
# or
python2 /usr/local/bin/dbcollect