Monday, April 21, 2014

How to Autostart a headless Virtual Machine Guest in Oracle Virtualbox on a Windows host


Create a text file with .bat extension containing the following line. Let's call it autostart_oracle_vm.bat

C:\Program Files\Oracle\VirtualBox\vboxheadless.exe --startvm MYVM

Now create a text file with the extension .vbs with following content, let's call this autostart_oracle_vm.vbs

Set oShell = CreateObject ("Wscript.Shell") 
Dim strArgs
strArgs = "cmd /c D:\autostart_oracle_vm.bat"
oShell.Run strArgs, 0, false

Now add a short-cut to autostart_oracle_vm.vbs in the following location

C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

Friday, February 7, 2014

Error Stack and SQL trace

You can run the following to get an errorstack of any ORA error in a database:

alter session set tracefile_identifier =  'errorstack';
alter session set events '<error_id> trace name errorstack level 3';
--run the problematic sql here
alter session set events '<error_id> trace name errorstack off';

e.g. to diagnose error:-
ORA-00942: table or view does not exist
run:
SQL> alter session set events '942 trace name errorstack level 3';

To generate an sql trace, run the following:

alter session set tracefile_identifier =  'sqltrace';
alter session set events '10046 trace name context forever,level 12';
--run the problematic sql here
alter session set events '10046 trace name context off';

Friday, January 31, 2014

Automatically format SQL or PL/SQL code online/offline

Did you know you can automatically format your sql or pl/sql code?
Complete with indentations and colors and everything.

My Favourite tools to accomplish this online are:
sqlformat.appspot.com
and
www.dpriver.com/pp/sqlformat.htm

If you have sql developer, you can paste your code into a worksheet and press Ctrl+F7 to format the code.

Sunday, February 17, 2013

Fixing E Mail signature in Thunderbird

So I was sick and tired of Thunderbird doing THIS to my emails.
By default, while replying to a mail, Thunderbird displays your signature after the quoted text. Which sucks, because then in a long mail chain, you'd lose track of who said what and how to contact someone.




Things get worse as a mail chain gets longer.

Thankfully, there's a quick and easy fix.

For some reason this setting is under "Account Settings"


And That's it.
Problem solved.




First Post

This is my first blogger post.

I'm an Oracle DBA and I intend to use this blog to log my Oracle adventures, little tips and tricks or just rant about IT life in general.

Hopefully this will be useful to me or even someone else somewhere down the line.

-Sumeet