DBCollect/Usage: Difference between revisions

From Dirty Cache Wiki
Jump to navigation Jump to search
Line 114: Line 114:


Useful if <code>/tmp</code> freespace is insufficient. {{dbcollect}} will always create a subdirectory such as <code>/tmp/dbcollect_uwfb4li0</code> so it will never overwrite existing files or directories.
Useful if <code>/tmp</code> freespace is insufficient. {{dbcollect}} will always create a subdirectory such as <code>/tmp/dbcollect_uwfb4li0</code> so it will never overwrite existing files or directories.
== user ==
<code>-u USER | --user USER</code>
Normally, {{dbcollect}} will use the owner of the first detected Oracle instance (i.e., running <code>ora_pmon_<instance></code>. Use this option to force using another user.
To work properly, it has to be a user with SYSDBA privileges.
== days ==
<code>-d DAYS | --days DAYS</code>
The number of days for which to generate AWR or Statspack reports. The default is 10 days, so with an AWR interval of 1 hour and long enough AWR retention, about 240 AWR reports will be generated per instance.
Increasing this value will only work if the retention in Oracle is also high enough (and AWR data is actually available).
Note that the Linux SAR/Sysstat reports will always be the entire period of 30 or 31 days (where available).
<code>--end_days END_DAYS</code>
Number of days ago to stop AWR report generation. For example, you want to pick up reports from 20 days ago to 10 days ago:
<code>dbcollect --days 20 --end_days 10</code>
This can be used if you want to pick up a very specific period of time only.

Revision as of 14:07, 28 May 2024

Usage

Verify correct install

# Show version
dbcollect -V

# Show usage
dbcollect -h

# Update to last version (if the system has https access to github)
dbcollect --update

Run with default settings

# Default run
dbcollect

# If you get Error DBC-020 (zipfile already exists), you can overwrite the old zipfile:
dbcollect -o
# or
dbcollect --overwrite


Resolve AWR reporting issues

dbcollect checks for prior AWR usage to make sure it will not trigger Oracle license violations ( More info)

If you get Error [DBC-E021] No AWR or Statspack detected:

# If you are sure you have Diagnostics Pack license:
dbcollect --force-awr

# If you want to ignore databases without AWR usage:
dbcollect --ignore-awr

# If the problem databases are not important, try excluding them:
dbcollect --exclude inst1,inst2

Explanation of all options

help

--help or -h

Shows usage (list of all arguments)

version

-V | --version

Shows detailed version, build and copyright details

debug

-D | --debug

enables debugging. This will result in more logging (sometimes dumping unhandled Python exceptions and traces.

Even without this option, debug info is written to the dbcollect logfile for troubleshooting purposes.

quiet

-q | --quiet

Hides most normal terminal output (except errors). Useful for scripted runs (such as with DBCollect/Ansible)

overwrite

-o | --overwrite

Overwrites the previous dbcollect ZIP file if it exsts.

update

--update

Downloads new version of dbcollect from github and replaces the old version.

Requires https access to github.com

sudoers

--sudoers

Writes sudoers settings to /etc/sudoers.d/dbcollect. This allows dbcollect to run some commands as root, that otherwise would fail.

This retrieves some extra, optional information. Not required, but on HP-UX highly recommended, as otherwise disk devices cannot be properly detected.

filename

--filename FILENAME

Write to the given FILENAME instead of /tmp/dbcollect-<hostname>.zip.

If FILENAME is only an identifier, the new name will be /tmp/<filename>.zip.

If FILENAME is a full path, dbcollect will use it as new location (.zip extension will be added if needed)

tempdir

--tempdir TEMPDIR

Use TEMPDIR as alternative temporary folder (for example /var/tmp.

Useful if /tmp freespace is insufficient. dbcollect will always create a subdirectory such as /tmp/dbcollect_uwfb4li0 so it will never overwrite existing files or directories.

user

-u USER | --user USER

Normally, dbcollect will use the owner of the first detected Oracle instance (i.e., running ora_pmon_<instance>. Use this option to force using another user.

To work properly, it has to be a user with SYSDBA privileges.

days

-d DAYS | --days DAYS

The number of days for which to generate AWR or Statspack reports. The default is 10 days, so with an AWR interval of 1 hour and long enough AWR retention, about 240 AWR reports will be generated per instance.

Increasing this value will only work if the retention in Oracle is also high enough (and AWR data is actually available).

Note that the Linux SAR/Sysstat reports will always be the entire period of 30 or 31 days (where available).

--end_days END_DAYS

Number of days ago to stop AWR report generation. For example, you want to pick up reports from 20 days ago to 10 days ago:

dbcollect --days 20 --end_days 10

This can be used if you want to pick up a very specific period of time only.