Retrieve and visualize ASM Disk Group Usage per database with R

If you are using Oracle Enterprise Manager and ASM, then you may already be familiar with the following page that displays the Disk Group Usage per database for a particular Disk Group:

And it is most likely that you don’t need to read this little post, as it provides a R script to achieve more or less the same result ;-).

But if you are not using Oracle Enterprise Manager, then you may find this post useful.

I created a R script “graph_asm_dg_usage.r ” (You can download it from this repository) that provides:

  1. A graph similar to the OEM one.
  2. A pdf file that contains the graph.
  3. A text file that contains the values used to build the graph.

The graph is available from both outputs (X11 and the pdf file). In case the X11 environment does not work, the pdf file is generated anyway.

Let’s launch it to see the result:

Building the thin jdbc connection string....

host ?: bdt_host
port ?: 1521
service_name for ASM ?: +ASM
sys as sysasm password ?: dontreadthis
Display which disk group (no quotation marks, no +) ?: ARCHIVE
Loading required package: methods
Loading required package: DBI
Loading required package: rJava
Please enter any key to exit:

The output is the following:


As you can see you are prompted for:

  • jdbc thin “like” details to connect to the ASM instance (You can launch the R script outside the host hosting the ASM instance).
  • oracle sys user password.
  • The ASM disk group you want to focus on.


  • It has been tested on a asm instance.
  • If you want to install R, you should begin to read  “Getting Starting” from this link.

One thought on “Retrieve and visualize ASM Disk Group Usage per database with R

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.