Tuesday, February 10, 2015

How to identify Oracle sessions consuming CPU time

Identifying sessions consuming CPU time is a common task in Oracle performance tuning. However, as simple as it sounds, it is not that straightforward. Oracle recommends using Enterprise Manager or Automatic Workload Repository for that. The problem is that in real-life situations Enterprise Manager is often not installed, or you may not have access to it. You may not also have necessary privileges to run AWS. Besides, running AWS reports for such a simple task sounds like overkill.

Oracle database reports each session's CPU usage in V$SYSSTAT performance view. However, it only indicates a total CPU time used since the session's log in. And because different sessions may have logged in at different times, you can't compare the reported figures as they are. After all, it is obvious that a session logged in a few days ago cumulatively may have used more CPU time than a session started just a few minutes ago.

However, there is a workaround.

I wrote a script which accurately measures CPU time consumed by Oracle sessions within the given period (30 seconds by default). It works by taking a snapshot of CPU stats at the beginning of the interval, and then another one at the end. It then calculates the CPU time used during the interval and presents the sorted list.

It prints the result into dbms_output in the following CSV format:
sid, serial#, cpu_seconds

Once you identified the top CPU consuming sessions, you can use a script like this one to find out what they are doing.

You can download cpu_usage.sql script from my GitHub page.

Tuesday, January 20, 2015

Show Oracle sessions

Here is a small script which shows information about running Oracle sessions. You can use commented lines to filter by an Oracle instance (in case you have a RAC), OS user, session ID, process ID or an application name.

Wednesday, December 31, 2014

OzBsidian dark colour scheme for Oracle SQL Developer

I recently switched to Oracle SQL Developer for my PL/SQL development needs. I have mixed feeling about SQL Developer: it's been in development for nearly a decade, and it still feels very raw. Nonetheless, it has a comprehensive set of features, a fully functional PL/SQL debugger, and you can't beat a free price tag.

However, one thing I wasn't happy about is the default colour scheme. I've grown quite fond of dark colour schemes, notably I like Obsidian by Morinar. It was originally created for Eclipse, but then became massively popular and got cloned into just about every single IDE and text editor... Except for SQL Developer, that is.

I was surprised nobody cloned it for SQL Developer, so I went ahead and did it myself.


The colours are mostly match Obsidian scheme, although not exactly. For instance, the background is a bit darker. Hence the name is OzBsidian to differentiate it from the original scheme.

You can download the colour scheme with the installation instruction from my GitHub account.
Enjoy!

Saturday, November 1, 2014

MIDI routing in FL Studio via a MIDI loopback device

This tutorial explains how to record the output of one MIDI track (for example, arpeggiator’s output) into another MIDI track.

Although FL Studio allow internal MIDI routing, it is not possible to record MIDI information which is being internally routed from one MIDI track into another. I.e. you can have an arpeggiator in one MIDI track transmitting notes into another track, where a synth would play it, but you won’t be able to record the notes arppegiator transmits. Fortunately, there is a workaround that allows us to do just that.

Tuesday, August 27, 2013

How to get size of all tables in an Oracle database schema


If you ever wanted to know how what's taking space in an Oracle database, or how large is the table you're working on, here's a script which answers these questions. It shows the size of all the database objects large than 10 Mb in a particular database schema.

Wednesday, January 30, 2013

Music production for masses - iOS to the recscue!


Some time ago I wrote my thoughts on the modern state of PC music-making applications.
In the nutshell, I reckon that niche became too overpriced and overcomplicated. All the existing digital audio workstations are targeted towards professional users, with the price tags to match. At the same time, the area of casual music production remains a no-man’s land.

Since then I got an iPad and discovered that simple and cheap music apps which I missed so much are plentiful there. I am excited about the emerging phenomenon of music production on iOS. There are already all-in-one DAWs for iOS such as NanoStudio and BeatMaker2, and even multitrack recording DAWs such as Auria. Moreover, while virtual synths for PCs & Macs cost circa $100 or more on average, synths of comparable quality for iOS are about 5 times cheaper. If you doubt, take a look at AniMoog, WaveGenerator, or nLogSynth.

Since its appearance the iOS music scene is expanding rapidly. Large companies start to realize that iPad is not just a toy, and the recent inflow of software from Korg, Moog, Akai, and the most recent, Steinberg and Yamaha is the proof of that.

Indeed, I reckon we are witnessing a rise of a new music making platform. The platform which is simple and accessible enough for beginners yet has a potential to become powerful enough for professionals.

Wednesday, October 24, 2012

Troubleshooting eth0 in Oracle Linux

A few days ago I installed Oracle Linux in an Oracle VirtualBox VM. Once it was installed I found that eth0 interface wasn't starting upon boot.


That was unusual. I am myself a Linux enthusiast, and I regularly download and install lots of distributions, and, by and large, network works in them out of the box.

Today I finally got around to troubleshooting this problem. It took me a couple of hours digging through the scripts, setting trace points, and reading logs; and here's what I found.


What Is a Data Warehouse?

All database applications can be divided into 2 classes: OLTP and data warehouses.

OLTP stands for Online Transactions Processing. It’s easier to explain by an example.

Thursday, September 27, 2012

My New Track - Destination Zero

Writing this track was my last assignment for Berkleemusic's Composing and Producing Electronic Music course.

Destination Zero by Ozmoroz

Cost and Complexity of Making Electronic Music

The Composing and Producing Electronic Music course is finally over. I learned a lot over the past 12 weeks on topics like sound design, harmony, song composition and sound mixing. It was a great experience.

However, this is what concerns me.
I found that making music is:
1.    Terribly expensive
2.    Terribly unproductive

It may make perfect sense for someone aiming to make professional recordings. But what about someone for whom it is just a hobby? It looks like we can’t even start doing anything without spending hundreds and hundreds of dollars on MIDI controllers, DAWs and plugins. All that stuff is expensive and it looks like there is no other option.

In 1997 when I started playing with digital audio, I had a Yamaha sound card that had few hundreds instrument samples in it and a software that allowed me to tweak the parameters of every single one of them. I paid $200 for it. It had samples of real pianos, guitars, organs, you name it, as well as built-in subtractive and FM synthesizers.

If I want to get anything like that now, what are my options? $500 NI Komplete? If anything, in these 15 years it got more expensive. For one of my projects I needed a sound of a steel guitar. I discovered that it was not easy to get. Kontakt is awesome but it is expensive. It comes with 50 Gb of samples. I wanted something that had a couple of hundreds multisampled instruments in maybe 5-6 Gb for the quarter of that price. And I couldn't find it. That choice had to be available 10 years ago, now it just disappeared.

Is there an option to even start doing good music on the cheap?

Then comes complexity. It is uncommon for an EDM artist to spend hundreds of hours on a 5-minute song. On something that will be enjoyed for 5 minutes. Of all the arts this must be one of the most unproductive. During the course we learned to program drums, write bass lines, layer, synths, etc. What looks odd to me that for each new song we have to do all that from the scratch – we need to put all these tiny little pieces together bit by bit. There seem to be no way to reuse, to build on top of what’s already done. Again, this may be fine for someone doing EDM full time. But if I have a couple of hours here and there, it looks like I need to give up without even trying.

There are some entry-level DAWs such as Garage Band and Cubase LE. But my impression is they are just stripped-down versions of the fully-functional DAWS. They don’t make anything easier. If anything, they actually make music making harder because they maintain the same attitude as the fully-functional DAWs but remove critical pieces of functionality. What’s the point paying $100 less for a DAW that is not capable of running VSTs? That is not a kind of "simplification" I’d like to get. And all the modern fully-functional DAWs grew into multi-headed hydras. Compare Cakewalk 10 years ago and now. I know some people who tried to do anything in Ableton Live and immediately felt intimidated by its complexity.

I don’t like where it is all going. I reckon that electronic music will benefit by bringing more people into it, by making producing EDM more accessible. Everyone can be an artist, but not everyone needs to be a professional artist. However, I see exactly the opposite. Computers became cheaper and more accessible, but over the last 10 years the complexity and cost of making electronic music skyrocketed. And I don’t think that is right.

If tomorrow one of my friends wants to get into EDM and asks me how, what should I say: "Don't bother. If you are not prepared to spend big bucks, then leave your job and make music full time, it's not even worth trying?" It is ridiculous. But is looks like that because all the software and the process that software enforces are tailored for professional producers.

Nonetheless, it doesn’t have to be like that.

Let's take photography. It used to be complex to make photos. Now everyone can do it. Professinal use Photoshop for photos processing. And it suits them. I'm not a professional and I use Picasa. Instead of hundreds of sliders like in Photoshop, Picasa has button "adjust photo automatically". Which works for me 90% of times.

Now, if I want to make music, I have no alternative but to use a DAW equivalent of Photoshop with all its cost and complexity. Why my DAW doesn't have "make sound awesome" button? You say it's impossible? I don't think so. For example, professional mastering plugin iZotope Ozone retails for $250 in its basic configuration. Although it has tens of sliders and knobs, a pretty common way to use it is to start with a preset and then made tiny adjustments. So why not make it simpler - drop all the knobs and sliders and leave just 20 presets. Then sell in for the quarter of the price. It will make it accessible to a lot more people, and will be enough for 80% of them. Making something simple does not mean making it less sophisticated. Think iPhone. It is a masterpiece of sophistication in a beautifully simple form.

I think a current state of music making art is wrong, and it is due for a change. Everyone should be able to make music. And all the software should make it more accessible to everyone, not just for a bunch of professional music producers. The message that should be out there is that making music is simple, and it is fun. But at the moment it is neither of those.

I don't know why. Maybe because software companies just aren't interested. Maybe it is beneficial for them in some way to create an aura of music making as something accessible only to chosen ones. It is wrong. It needs to change.

Who knows, may be one day it will be my job to change that. Everything is possible in this world.

Monday, July 23, 2012

My new track: Chaos Engine

It is a scientific fact that the amount of entropy in the universe increases all the time. One day it may break the hell lose on our world, leading to a new Big Bang.

Entropy is the Engine of Chaos, and this is its song of destruction.

Chaos Engine by Ozmoroz

Sunday, July 8, 2012

Composing and Producing Electronic Music week 2


The assigmnent for week 2 of Composing and Producing Electronic Music was to make a drum groove for a Drum'n Bass track. Here's how I did it.

Sunday, July 1, 2012

My first ever remix

Here's my first ever remix made as an assignment for Composing and Producing Electronic Music course.

Thursday, November 24, 2011

Databases Matter


Databases are at the core of virtually all modern information technology systems. Sometimes these databases are exposed, for example, as in data warehouse systems. The centrepiece of a system like that is a powerful industrial database such as Oracle, or Sybase, or Microsoft SQL Server, or something similar. The presence of a database is pretty obvious in that case – only these powerful databases can crunch the immense amounts of data processed by data warehouses. In other cases databases are hidden. For example, Apple iTunes uses a SQLite database to store the details of music tracks on your computer. That database is not obvious; it does not advertise itself, but it's there. It makes sure that the ratings you assigned to songs are saved and can be synchronised between all your iPhones and iPads. It counts the number of times every song was played so that you don't listen to the same song twice when you put your iPhone on shuffle. Databases are everywhere. They all serve the same purpose – to store data and make its retrieval as easy and fast as possible – but they are also vastly different from each other.

Let's take another example. When you log into your Google account and bring up your Gmail inbox, all the emails you see are actually stored in the remote database. That database is called BigTable, and it contains not only your emails, but all the emails of all Gmail users in the world, and also virtually all of Google's data. While your iTunes SQLite database may be about 50 megabytes in size (and that's assuming you have A LOT of songs), Google's BigTable contains petabytes of data. That's your iTunes database times one billion.

If you think about it, it becomes obvious that these databases require vastly different approaches to the way the data are stored and retrieved: You can fit an iTunes database into memory and query it whichever way you like without a performance penalty. At the same time, no machine has been built yet that could apply the same approach to Google's BigTable.

Unfortunately, not all software developers understand that. Databases once were an inspiring topic but in recent years they went out of fashion. Software developers are geeks; they like new toys; they all want to work on something latest and greatest and cutting-edge. So many new exciting things are happening in the area of Information Technology – Web 2.0, HTML5 and Apple iOS to name just a few – that databases just fade in comparison, despite the fact that they make all these new shiny things tick. Most of the developers these days take a database just as generic data storage: “We'll just stuff the data in and we don't care what's inside.” 10 years ago SQL language was a necessary skill for database application developers. Nowadays the majority of programmers don't know SQL. They rely on frameworks such as Hibernate to produce SQL statements for them. They think that all databases are the same and therefore, if necessary, they can take one system that uses MS SQL Server as a backend and put it onto Oracle and it will work just fine.

Well, that may be true for very simple applications. The myth that all databases are the same is flawed, especially when it comes down to performance. Today cloud computing is a buzzword, and Google is the patriarch of the cloud. Google's servers process billions of requests every day, crunching petabytes of data. Yet, every request made to a Google search engine is served within seconds. This places such a high demand on the Google's database layer, that Google's engineers couldn't afford using even the most powerful of industrial databases, and they had to develop their own – the aforementioned BigTable. If you told these guys that “all databases are the same”, they would laugh into your face, and rightfully so, because Google knows that performance matters and they try to squeeze every bit of performance out of their systems.

Databases matter, and if you consider yourself a decent software developer, you need to learn how to tame them. Learn the differences between them. Learn what they are, what makes them tick, and the most importantly, how to make them tick faster, because writing applications that are slow is just bad taste.

Tuesday, February 15, 2011

Nokia+MSFT: Power of Incentives

Considering that the present Nokia's CEO Stephen Elop is one of the largest individual shareholders of Microsoft, no wonder they tied a knot.

And it'snot a surprise he tries to talk the Nokia's share price down. He doesn't currently have any Nokia shares, but he will have to buy some soon. And the cheaper Nokia shares are, the less he will pays for them.

As Charlie Munger puts it:
'I think I've been in the top 5% of my age cohort all my life in understanding the power of incentives, and all my life I’ve underestimated it. And never a year passes but I get some surprise that pushes my limit a little farther.'

Monday, February 14, 2011

Make your life happen

Jason Fitzpatrick quit Lifehacker. Here's what he has to say:

The only commodity we have is time. Somewhere—in your mind, on a notepad, stashed in a virtual notebook—you have a list of things you'd like to be doing with your time before it all slips away. Do what you have to do to take those ideas out of storage and make them happen. You can trade and barter for a lot in life but you can never buy back time. Go live.

These Are the Last Words I Have to Say; That’s Why This Took So Long to Write by Jason Fitzpatrick

Wednesday, February 9, 2011

Freediving in the Philippines. Epilogue

Some people asked me why I needed that. Here's why.

I do not know where to start... Perhaps I should start by telling how a long time ago, when I was a kid, I watched a movie called "The Big Blue", and it forever imprinted in my memory, somewhere between the French cartoon "Time Masters" and the Bratislavan TV series "She Came Out of the Blue Sky".

Freediving in the Philippines. Day 12


Here I was writing this diary
Everything comes to an end. It was time for me to say goodbye to the Philippines, that hospitable place, which gave me so many new impressions over the last few days. At eight in the morning, a taxi was to pick me up and take me to the airport. Three hours in the car, then an airport, a plane, and three and a half hours to Singapore. Mark, Michael and I met for breakfast. Last conversation, goodbye. Then I went to say goodbye to the sea. I looked at the bright blue surface stretching to the horizon, and tears rolled down my cheeks. Then I jumped into the car and set off for the airport. On the way, I asked the driver to drop in at Club Serena, but having arrived there, I found out that everyone else had already left.

Airport, customs, passport control... All of those necessary attributes of travel are the same every time. They take a lot of time, but there's no way to go around them. And when yet another door closes behind you, you realise that something is over, finished. And something new begins.

Tuesday, February 8, 2011

Freediving in the Philippines. Day 11

A restaurant at "Blue Orchid"
Back when I was preparing for the trip, I got in touch with Julia, and she told me that I had a choice to stay in one of two hotels: Club Serena or Blue Orchid. I looked at the Blue Orchid's website and, to my surprise, in a left-side menu found a link labelled "Aikido". Since I am a black belt in aikido, I was interested. The link itself did not lead anywhere, but after a little research, I discovered that the owner of Blue Orchid, the Englishman Michael McCavish, was a fifth dan of Tomiki aikido. I contacted him, explained who I was, and asked if I could book a room at his hotel. Michael replied that he was glad that I would stay at his hotel, but he at that time would be in Japan on business.

When we first saw him in the evening after returning from Badian Resort, the first thing he said to me was: "I came back a day earlier than planned. I felt that I had to talk to you." I did not even know what to think about it. Another coincidence in the chain of random events? Maybe. Maybe not.

Freediving in the Philippines. Day 10


A view fon the roof of "Blue Orchid"
Surprisingly, I did not have a hangover next morning. Either I did not drink as much as I thought I did, or the quality of the local rum was much better than I expected. Therefore I, as usual, appeared by the pool of Club Serena at 10 a.m.

Popular Posts