Wednesday, August 18, 2010

VoraX 2.1 released

Finally, VoraX 2.1 is available for download! You may have a look at the changelog for what's new.

In this post I want however to talk a little bit about the new features this version brings in. The most important one, in my opinion, is the fuzzy search feature. The idea came from a practical need. I don't know about you but, personally, I have troubles remembering various package names, tables, views etc. You may say: okey, but you can use code completion, right? Yes, of course, but what if you don't know how the object name starts? For example, let's say I want to query the AWR snapshots. Frankly, I don't know exactly where these snapshots resides, but I (fuzzy) remember that it's something with "snapshot". So, I am in the middle of:

SELECT * FROM |<-- cursor here in insert mode

Now, I can invoke vorax fuzzy search. While in insert mode type <Leader> vl (vl stands for vorax locate). A prompt will be shown at the top and you can type there: snapshot. Pay attention that the list with the candidate items will start to be populated after you type at least three characters. You should see in the list the view you are looking for: DBA_HIST_SNAPSHOT. Oooh, yea I remember... that's it! Just select it, press ENTER and DBA_HIST_SNAPSHOT will be inserted at the current cursor position. Nice!
Another scenario when this feature may prove to be quite handy is when you have to change a system parameter. Suppose you want to increase the size of your flash recovery area. You are in the middle of:

ALTER SYSTEM SET |<-- cursor here in insert mode

Ookey, now what? I think the name of the parameter is something with recovery... Yeap, it's time for a fuzzy search. Invoke it and type: recovery. Ups, a lot of items are there: views, synonyms, tables. You can narrow down and refine your search knowing that you're actually looking for a parameter. So, you further type ;:param. Now your search pattern looks like: recovery;:param. That's nice: I have now just the parameters which contain the word recovery:

- recovery_parallelism
- db_recovery_file_dest
- db_recovery_file_dest_size


Now, it's clear that we want db_recovery_file_dest_size.
This feature depends on FuzzyFinder plugin so don't forget to install it if you want to have this new vorax feature. You can also customize the search-able database items by modifying the search.sql script located at: &rt/vorax/sql.

Another improvement is the possibility to invoke describe commands directly from the DbExplorer. It was proposed by Shaun and it makes a lot of sense.

VoraX 2.1 comes also with new syntax files for sql and plsql which means your oracle code will look much better. The sqlplus keywords like ACCEPT, PROMPT etc. are also highlighted in sql buffers.

That's it for now! Enjoy!

Friday, August 6, 2010

VoraX 2.0

VoraX has changed its major version number. Ieeei... waves please! :) It feels a little bit more mature, doesn't it? Joking apart, this new release addresses a few nasty bugs and it has some nice new features.

The first one is the ability to store passwords for your Oracle connection profiles. For those of you who's working with a lot of databases and users this feature may prove to be a life saver. Shaun Batterton came up with this idea and he proposed the using of PGP protocol. However, in ruby PGP is not very well supported. There is a project called OpenPGP but I found difficult to use it on windows because of its dependency on Open4 which is not supported on Windows. In the end I gave green light to the RSA keys implementation and you may find additional details about this here.

Shaun also noticed that the fact that after a connection you have to set the [no name] buffer to an sql buffer type it's quite annoying. And he's right, that's why in VoraX 2.0 a scratch.sql buffer is opened on the first connection.

Then Spratek had also a nice improvement idea. Instead of the flat DESC output he (he I guess :D) came up with the idea of a more verbose describe. The idea is to have also comments for columns, constraints, foreign keys and other such critical information for database developers. So, VoraX 2.0 has also this feature. For a table or a view you may invoke a verbose describe using <Leader> vdv mapping.

Also, in VoraX 2.0 you may invoke describe and "go to definition" directly within the results window. This might be handy if you query dictionary stuff and you want to describe a definition directly from that output.

That's it for the moment! Have fun guys!

Monday, August 2, 2010

VoraX and Oracle Documentation Offline Search

Lately, I found myself using VoraX a lot. However, one feature that I miss is searching through the oracle documentation. For example, let's say I've just queried the v$session view and there's a column there called PDML_ENABLED. Okey, what does it mean that? I want to know more about this column. That's not such a big problem... it basically boils down to:
1. open your favorite browser;
2. go to the oracle official documentation and enter the text you want to search. This link should guide you directly to the search facility.
Okey, so is not such a big deal but it can be annoying especially when the Oracle site is slow... and from my experience this happens quite often. You may think that an offline search might help... just download the documentation package and search locally. NO! That's not an option. The search facility always goes through the internet... and if you are not connected to the internet then is sad...
But, don't be too disappointed... there's still a nice solution. You may use Google Desktop to perform offline searches. It works like a charm in connection with vorax... while in VoraX activate google desktop and search for your term. That's it... fast and convenient. However, you have to pay attention to some details about configuring Google Desktop. By default it will index almost everything on your computer: emails, word documents, web history etc. etc. etc. You'll end up having a huge index cache with a lot of information not related to Oracle at all. So, my first idea was to index just one folder, the one with the oracle documentation. Apparently, this doesn't work: all fixed drives are indexed by default. Okey, there's also a section which says: "Add file or folder to exclude". I thought that adding there all my fixed drives and then explicitly telling Google Desktop to index my documentation folder will work. Well, not the case... really! If your documentation is, let's say, within C:\oracle\docs and you exclude the C: drive nothing will be indexed at all. The last thing I tried and it worked was mapping my documentation directory to a logical drive. In windows you may use the following command:
subst x: "c:\oracle\docs"
Then tell google desktop to index your X: drive and exclude all the others. Ieei, that's nice... i have offline search-able oracle documentation which is very easy to access from any application, including VoraX.
There was still a problem. The Oracle documentation is huge and I don't want everything from there. For example, if you search for V$SESSION a lot of results will come from replication documentation which is not really what I am looking for. So, in the end I decided to manually index just the books I found to be the most relevant ones. From the last 11.2 Official documentation I've selected just several directories and I put them as shown below:
X:\
|
+-- official_11_2
    |
    +-- dcommon
    |
    +-- favourites
        |
        +-- e10577
        |
        +-- e10592
        |
        +-- e10820
        |
        +-- e10880

Basically, I've selected the following books:
1. Oracle® Database PL/SQL Packages and Types Reference
2. Oracle® Database SQL Language Reference
3. Oracle® Database Reference
4. Oracle® Database Error Messages
These are the books I use to search a lot when I'm in the middle of writing sql/plsql code. Now, I have just a small set of the whole documentation which is faster to index and easier to browse.
I didn't have the time to try this configuration on UNIX systems but I'm quite confident that it should work.

Update 1: The above directory numbers for each book may be different in your documentation package.
Update 2: Starting with version 2.3 VoraX provides built-in Oracle HTML documentation search. Details may be found here.