Making the alert log just a little more readable

One of the most valuable sources of information about what the Oracle database has done and is currently doing is the alert log. It's something that every Oracle Database professional should be familiar with. So what can you do to improve you chances of not missing important pieces of info? The obvious answer is that you should use a tool like Enterprise Manager. This is particularly true if you are looking after hundreds of databases.

But what if you are only looking after one or two or just testing something out? Well the most common solution is to simply tail the alert log file.

The only issue is that it's not the most exciting thing to view, this of course could be said for any terminal based text file. But there are things you can do to make it easier to parse visually and improve your chances of catching an unexpected issue.

The approach I take is to push the alert log file through python and use the various libraries to brighten it up. It's very easy to go from this (tail -f)

Screenshot of ScreenFloat (20-03-2018, 08-25-26)

To this

Screenshot of ScreenFloat (20-03-2018, 08-25-58)

The reason this works is that python provides a rich set of libraries which can add a little bit of colour and formatting to the alert file.

You can find the code to achieve this in the gist below



Just a quick note on installing this. You'll need either python 2.7 or 3 available on your server.

I'd also recommend installing pip and then the following libraries

pip install humanize psutil colorama python-dateutil

After you've done that it's just a case of running the script. If you have $ORACLE_BASE and $ORACLE_SID set the library will try and make a guess at the location of the alert file. i.e

python alertlogparser.py

But if that doesn't work or you get an error you can also explicitly specify the location of the alert log with something like


python alertlogparser.py -a $ORACLE_BASE/diag/rdbms/orcl/orcl/trace/alert_orcl.log


This script isn't supposed to be an end product just a simple example of what can be achieved to make things a little easier. And whilst I print information like CPU load and Memory there's nothing to stop you from modifying the script to display the number of warnings or errors found in the alert log and update it things change. Or if you really want to go wild implement something similar but a lot more sophisticated using python and curses

The age of "Terminal" is far from over….
Comments

New build of swingbench... Testers needed!!

I've just finished a new build of swingbench 2.6 and it has a lot (and I mean a lot) of under the cover changes to try and take advantage of some Java8 features. Most of the changes are to simplify the code and make sure that some of the more complicated concurrent code works as expected. I'd really appreciate it if you get a chance to try this version out and provide me with some feedback.

Change log

  • Reverted back to the old chart engine rather than JavaFX to ensure charts now render on Linux as well as Mac and Windows
  • Improvements in code to ensure that results are always written to a results file or the screen
  • Charbench now has the option of producing a simple human readable report at the end of the run via the "-mr" command line option
  • Users can now update the meta data at the end of a run with the sbutil utility to ensure it reflects the changes that have taken place
  • Better handling of errors when attempting to start graphical utils on server without an output device to render to (headless)

As always you can download it from here
Comments

Installing Python 2.7 in local directory on Oracle Bare Metal Cloud

I know there will be Linux and Python specialist spitting feathers about this approach. But if you're in need of an up to date python environment then the following approach might be of help.It's worth nothing that this technique will probably work on most Oracle Enterprise Linux or Red Hat Platform releases.

#make localdirectory to install python i.e.
mkdir python

#make sure latest libs needs for python are installed
sudo yum install openssl openssl-devel
sudo yum install zlib-devel

#Download latest source i.e. Python-2.7.13.tgz and uncompress
tar xvfz Python-2.7.13.tgz

cd Python-2.7.13
#configure python for local install 
config --enable-shared --prefix=/home/opc/python --with-libs=/usr/local/lib
make; make install

#python 2.7.13 is now installed but isn't currently being used (2.6 is still the default)

#get pip
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
#install pip (this will still be installed with 2.6)
sudo python get-pip.py
#install virtualenv
sudo pip install virtualenv
#create a virtualenv using the newly installed python
virtualenv -p /home/opc/python/bin/python myvirtualenv
#activate it
source myvirtualenv/bin/activate
#install packages…
pip install cx_Oracle
Comments

Sharding videos on Youtube

I've uploaded 3 videos on installing and configuring sharding in Oracle Database 12c Release 2. I use Virtual Box running Oracle Linux to create a sharded database and run a swingbench workload against it. In part 3 I then add a new shard online and monitor the database as the data is rebalanced across the cluster. You can see them below but I reccomend running them full screen because there's quite a lot going on.

Part 1






Part 2






Part 3


Comments

Yet another minor update to swingbench 2.6

This release fixes an annoying issue where some smaller dimension tables weren't populated in the TPC-DS benchmark. It also significantly increases the speed that result files are parsed with the "results2pdf" utility. You can download it from here. Let me know if you have any problems
Comments