ashplot

NAME
SYNOPSIS
OPTIONS
EXAMPLES
BUGS
COPYRIGHT
SEE ALSO

NAME

ashplot − Create a plot of ash data

SYNOPSIS

ashplot [options] -l u/p@c ashplot.rwl

ashplot [options] -l u/p@c ashplot.rwl title text

The ashplot command is used to create a plot of ash data in any of three possible formats:

1.

Output using X-Windows when DISPLAY is properly set.

2.

Create an image file in png format.

3.

Create an image file in svg format potentially with the svgmouse option.

All output is generated using the gnuplot which therefore must be installed.

The data used to generate the graphs is retrieved from either live data in gv$active_session_history or from the awr repository in dba_hist_active_sess_history. The former is used by default, the latter is used if you provide the --dbid option.

If you do not provide one of the output options, no graph is created, but you will be shown a date interval (with minute resolution) for which data is available. If your goal is to graph data from the awr repository, you are suggested to first use awrreport to identify the databases, instances and snapshot ranges available. This is particularly useful if you are working with an awr repository that contains awr imports from other databases.

OPTIONS

-l u/p
-l u/p@c

Compulsory option to provide the username, password, and potentially connect string for a database connection that provides access to the necessary gv$ and dba_hist views. If you omit /p, ashplot will prompt for the password.

--dbid=<dbid>

Without this option, data in gv$active_session_history will be used. With this option, data in dba_hist_active_sess_history from the database with the provided dbid will be used.

--fromtime=YYYY.MM.DDTHH24:MI
--totime=YYYY.MM.DDTHH24:MI

The output will be limited to the specified date/time range. Note that dates must be in the exact format shown, which is also the format used when outputting the available data range. You can omit : and the MI part or T and the entire time part.

--output-X

Output the graph using X-Windows; this requires a properly set DISPLAY environment variable.

--output-png=file.png
--output-svg=file.svg

Create output as an image file in either png or svg format.

--output-image=file

Create output as an image in both png and svg formats; the file names will be suffixed with .png and .svg respectively.

--svgmouse

If an svg file is being output, embed mouse javascript code in the file; this allows clicking the file when shown in a browser.

--include-sys

By default, data from anything running under SYS (i.e. with userid of 0) is excluded; if you include this option SYS data will be included.

--maxsessions=N

By default, the y-axis will cover the range from 0 to the largest number of sessions. If there are a few large spikes, this implies the bulk of the data is shown in only a small part of the y-axis. You can use this option to decrease the range of the y-axis such that the bulk of the data is represented on a larger part of the axis.

--w-pixels=N
--h-pixels=N

Provide the width and/or height of the image in pixels; the default is 640x480.

--boxwidth=N

By default, gnuplot "widens" each plotted bar (box in gnuplot terms) such that it touches the next bar, which ensures a plot that has no holes along the x-axis. If the range is short or you otherwise only have few data points available, you can alternatively make a plot that has holes at missing data points if you set a fixed boxwidth using this option. You need to experiment until you find a proper value starting with the value 1; values above 3 or 4 are unlikely to produce nice plots.

title text

If there are positional arguments in addition to options, they will be used as the plot title, which otherwise will have a generated default including the start date and time of the plot.

EXAMPLES

This example shows how you can progressively narrow down a certain database and period for which you create the ash plots. Start by listing all available databases and instances in some repository:

awrreport -l system/{password}@tnsalias

which may generate an output like:

dbid con snap cnt instance list
----------- --- -------- -------------
607296874 / 400 1,2
957347207 P 2 1,2
4001460110 12321 1,2,3,4,5,6,7,8

This tells that there is data from three databases available in the repository. Assume the last one is the interesting one, so first create a plot using X-Windows covering the whole available range:

ashplot --output-X --dbid=4001460110 -l system/{password}@tnsalias

which first will show the actual available range and then (potentially after some time) create the plot:

Data available between 2022.03.21T00:47 and 2022.04.02T23:59

You may then want to narrow down the actual time for which the plot it produced:
ashplot --output-X --fromtime=2022.04.01T12 --totime=2022.04.02T12 --dbid=4001460110 -l system/{password}@tnsalias

And finally, you may want to reduce it further, also create image files, and also include SYS sessions:
ashplot --svgmouse --output-image=/var/www/html/myash/myplot --include-sys --fromtime=2022.04.01T17:30 --totime=2022.04.01T20:30 --output-X --dbid=4001460110 -l system/{password}@tnsalias

The image files will be put in the directory /var/www/html/myash, and will be named myplot.png and myplot.svg respectively; if you view the latter in a browser, it will be clickable. You can see an actual sample image at https://github.com/oracle/rwloadsim/blob/master/docs/sample-ash.png.

This final example shows how you can plot all available live data (i.e. from gv$active_session_history):
ashplot --include-sys --output-X -l system/{password}@tnsalias

BUGS

If there are many ash samples, generating the data and subsequently using gnuplot takes a long time.

COPYRIGHT

Copyright © 2023 Oracle Corporation
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl

SEE ALSO

rwloadsim(1rwl), awrreport(2rwl), utilities(2rwl)