Saturday, January 1, 2011

Migrating to wordpress

I'm migrating to wordpress. In 5 seconds you should be redirected to

Tuesday, December 28, 2010

Delphix deals before the end of year

It's let's make a deal time at Delphix. If you have ever had the fun of closing an Oracle deal at their fiscal year end, you know what happens. Not only is it fiscal year end but Delphix is also millimeters away from adding an extra figure to their end of quarter total and I'm betting that now is the last time these low of prices will ever be seen - just my view point from being inside the castle.

I'm not sure if you can imagine the ease and savings of virtualizing databases

1) Super fast provision – three clicks and a few minutes to stand up a fully functional, point-in-time 10g/11g database copy/clone

2) Storage savings - a new database copy basically only consists of some pointers and the space it takes for private redo and temp

Delphix doesn't require filesystem snashots or EMC or NetApps. It only requires x86 box with about the same amount of the disk space of the database you want to virtualize. The source database is copied onto the Delphix machine with RMAN calls, the data is compressed and Delphix handles the snapshots and provisioning of virtual databases. Virtual database can be provisioned from the original source copy, or any incremental snapshot or if log shipping is used, then any SCN or date in between. Then you can make as many copies as you want, with in reason, for almost free in terms of storage.

If you are a departmental head and some extra budget that will be lost at year end then Delphix is a good way to use that budget.

For these cut rate deals, everything has to be in by Friday at the absolute latest. For best info contact

This idea is being harnessed by more and more companies across different industries - we've be implemented this at (part of ebay), Tivo (consumer tech), Corporate Express (retail), Tagged (social networking), Clearwire (telcom), KLA Tencor (hardware), Holland America (travel) .

When I talk to customers who don't have development or QA copies of production I cringe. Usually developers work on subsets of production and often query performance on these subsets don't reflect the performance in production. Even if production is a full copy of development there is often just one copy shared by all the developers and QA. Any change to this copy has to go through a number of hoops and signoffs which slows down the development process and de-motivates developers. I don't know if you can imagine having a copy per developer of production where each developer can make and test as many changes as fast as they want on an exact copy of production - it's awesome and inspires the developers. After the developers are confident of there modifications then they can submit the final change request for review.

Delphix makes all of this easy with no changes on production and creation of virtual databases just a few clicks of a mouse in GUI .

Sunday, December 19, 2010

New Oracle Monitor - what language would you use?

I don't consider myself a programmer and my exposure to some of these languages is quite superficial, so please feel encouraged to jump into this discussion with your experiences, corrections and comments.

What language and UI would you use to create an Oracle monitor? Why?
What are the pros and cons ? I want a tool to be
  • easy to install
  • quick to program
  • have interactive graphics
  • run fast
  • web enabled
These goals are hard, if not impossible, to achieve in the same product. A product's choice of programming language will be limited if interactive graphics are involved. I think graphics are the only way to make a tool easy to use and information easy to grasp but graphics definitely limits the coding options. A really nice option, and practically a commercial requirement is to run in a web browser and running in a browser even further limits the the coding options and and the possibilities of achieving all the goals
What programming languages could be used? Some choices are
  • C
  • SQL*Plus
  • PL/SQL
  • perl
  • python
  • tcl/tk
  • ruby(on rails)
  • Java fat client
  • Java web app (with Flex)
  • Delphi
  • Visual Basic
  • Apex
And tangential languages
  • ksh(bash/sh/csh) with AWK
  • HTML5
Here is a quick (5 minute off the cuff ) impression of the languages
Do they require an install? or can the be run immediately with simple executable?
Are interactive graphics possible (within reason)
Are they easy or difficult to program in?
Do they have cross platform support? (*nix, mac, win)
Are they web enabled?
Are the fast or are they memory (and CPU) hogs?
Do you have to pay for the development platform?


To have an absolutely brain dead install would require the tool to be written in C, Delphi or VB as these are compiled into single executables. All the other languages, AFAIK, require the language interpreter or engine to be installed and generally require Oracle libraries to be there. Actually, C, Delphi and VB might require Oracle libraries as well, but at least for C, it seems like there would be a way to link a static executable. Oracle is not required for most Java applications as they are generally shipped with a JDBC driver for Oracle, though it's just another file to scatter about on your file system as part of a complicated install. On the other hand Embarcadero has a neat option where everything, even in a java app, is packaged into one executable called an "instant on" executable, much more akin to running a self contained executable on UNIX via some windows magic in the sauce.
The installs required by other products vary. I'd say most are pretty easy, though how easy depends largely on how the language environment is packaged along with the tool. If the tool does no prepackaging and lets the user set up the required packages then installation can be a nightmare. A tool like ASHMON written in TCL/TK for examples requires graphing package, thread package, math extension and an Oracle connection package. I've packaged all these up into a single download which still requires the Oracle client libraries to be pre-installed. All and all it takes a good bit of upkeep to maintain the binaries of all packages on the platforms people might use and even upon installation it doesn't have single executable, but an execution shell that has to launch and find the scripts which depend upon directory locations and it has to find the Oracle install and tnsname.ora. It would be so awesome if I could just make one executable with everything. So installation for Perl, Python and ruby would be similar, AFAIK. A java app is a bit better - one executable though it depends on java already being installed, and for APEX - I believe all sorts of stuff has to be installed and configured on an Oracle database and either installing a full Oracle database for the tool or requiring the target database to have APEX installed is a lot to ask for.
The software that is most likely to be installed is SQL*Plus but even SQL*Plus may not always be available on a customers laptop or desktop. My laptop did not have SQL*Plus until yesterday, almost 2 months after I started using the laptop. I was just using SSH and other tools. Yesterday I finally installed SQL*Plus to start working on a new performance monitoring tool. Why a new tool? I want a new tool that will give me performance data from customer's Oracle databases that I can review at a later point in time. I want a tool that the customer can run as quickly and easily as possible and that requires the least amount of user knowledge and interaction. Beyond the goal of collection performance data, I would also want the tool to give some immediate feedback on performance. Of course SQL*Plus should be the easiest thing to use. Maybe the laptop or desktop does not have SQL*Plus installed, but in the realm of Oracle performance, nothing should be more reasonable than expecting the customer to have SQL*Plus installed on the desktop/laptop.

AFAIK, the only reasonable interactive graphics options are Java Applications, Java in the web using FLEX (SGV was an option but is been shelved), TCL/TK, Ruby with RMagick, Visual Basic and Delphi. Not such luck for SQL, PLSQL, Perl or Python.
Apex may have some, but not sure how robust they are.
Java has gobs, but how good they are, not so sure and how do you find the right one? Many are pay for and I'd like to first commit to Java before paying and I want to be sure the package I'm buying is the best. Ideally I'd rather not have to pay
TCL's BLT package has a quite good graphing library.
For graphs, there are lots of small but important options - auto resize, filled area stacking, log scales, mixing bars and lines, easily adding and deleting items from the graph, actions on graph contents triggered by mouse passing over or clicking, etc. Sure, graphing can be done in almost anything, but having a package to take care of all the minutia is the only kind really worth my time. TCL's BTL graphs also use "vectors" or very efficient lists of numbers. I can act on these lists - divided two lists, add to lists, multiply a list by a value or modify points, add points, delete points and have the graph updated immediately.
Delphi and Visual Basic have graphic packages though, like JAVA, there are lots of options and many are pay for.
Ruby seems to have Rmagick. Not sure if there are other options.
Java web applications have Flex which requires Adobe's IDE.

Data Manipulation
SQL and PL/SQL of course are pretty simple - at least they provide the ability to collect and manipulate data in a far more powerful and easy way than any other language. The con with SQL of course is it's not procedure. PLSQL is of course procedural but often leads to creating things in the database like global temporary tables, packages and procedures and creating things in the target database is a "no no" for me. I want to affect as little as possible the database I'm monitoring. The best approach is to collect the data via SQL or even PLSQL with as little manipulation and then manipulate the data on a local, not target database. I've done this in the past with AWK but it's tedious and brittle. Similarly I've manipulated the data in TCL and again, though clearer than AWK it's still quite tedious. I've tried it in JAVA and JAVA just gives me the hebee jebees - it might not be as tedious, but I just get the feeling that the data structures are inefficient, non-scalable, slow and memory intensive. Another maybe better alternative is using a locals database but this requires installing a databases which is a bit overkill at least if the database is Oracle. The solution to this is to use an embeddable database like HSQL, H2, SQLite or firebird (is Derby embeddable?) For other languages we could also manipulate the data in local structures or objects but tacking aggregations, groupings, sums, averages, counts etc is just so tedious in code and so easy and effortless in a database. I assume it's pretty easy to embed a databases in almost all the languages except maybe C because then I'd assume we'd be loosing the advantage of having C be an easy to install executable, though maybe it's easy.
I started to play with SQLite and TCL a several years ago and though it may be simple it was certainly taking me more time than just interfacing TCL with a running Oracle database.
Beyond whether to use a database or not and how, there is the question of how productive is a coder in a language. The lower level the language the more tedious. For example C, though elegant and fast, is quite tedious. At the other end is something like Delphi which is a piece of cake. Another aspect is just how heavy the language is. I find Java heavy. The overhead to set up simple functionality feels simply crippling to me.

UI layout
Delphi is easy to layout UI.
TCL/TK is difficult.
I think Java is somewhere in between
For SQL the only UI is just hacking with ASCII - generally not pretty.
Ruby - I don't know.
Flex - not sure either though I'd guess its good though no where near as easy as Delphi.
VB - I assume it's like Delphi.
Perl and Python - not much options unless they are married to something like TK.
Apex - don't know, I've head good things but it is Oracle and from what I've seen of APEX it's not a cakewalk, at least to get up and running and ready. Maybe when all the pieces are in place its straight forward.

Java IMO seems like crap - it's like "new money" , you know those LA mansions that are gaudy fake, expensive and needlessly huge.
Perl is not pretty but at leasts it's efficient. You don't get any LA mansions in Perl. It's more like a souped up jalopy. It's sort of junky but it runs fast.
Python seems good to me.
Ruby seems like a cross between TCL and Python - seems nice - sort of zen, though I've only written a few lines.
TCL - little strange, but ok - might have been nice but it's been long forgotten.
Delphi uses a modified Pascal and what's easier than Pascal?

Java is a pig.
Flex is a pig.
OK, OK don't tell me that it's not the language its the programmer. I've never seen a C program take up 600Ms to collect a few K of data and I've never seen a Java program run under 50Ms. (more like 100M+)
Delphi is like 10M, runs fast. What's not to like? (pay for IDE and it's washed up, the UI looks like so 20 years ago)
C of course is lightning fast.
TCL seems fine, maybe at bit slow, but for the structures I care about like vectors and in graphs have been well optimized
Python seems fast.
Perl - I assume it's pretty fast. I tried to write a direct memory access program in Perl and it was slower than executing SQL but that's because the API attached and detached from the Oracle SGA for every bit of data I collected. I theoretically could have gone in and modified the Perl API for shared memory.

Who works on the web for a GUI? Apex, Java with Flex, Ruby on Rails with Rmagick. Rmagick may or may not provide GUI interaction - I have yet to try it. I spent a couple hours last weekend trying to get it to work under Cygwin and eventually gave up and just installed it straight under windows, but have yet to play with it.
Java with Flex is probably the premier solution but it's fat and the IDE is payfor.
What about HTML5?
Is FLEX an option? maybe for an enterprise application but not for a desktop web enabled application as far as I can tell.

My Story
I've been thinking about this for years. I started programming TCL/TK graphics back in 1994. The only other option before 2000 or so was Visual Basic and Delphi . I didn't hear of Delphi till about 2007 (!) and Visual Basic never seemed like an option since it was limited to Windows. The windows limitation seems much less important now days, but back then I only worked on UNIX and didn't have a laptop, so TCL/TK was the only option until around 2000 when Java became an option. In 2002 when I started working on OEM 10gR1. When I arrived at Oracle in 2002 to work on OEM, I had no idea it was web based and pure HTML. HTML ?! I had thought that I would be working on the 9i java fat client. The 9i java client was relatively good at least compared to OEM 7 and 8 and I thought with a little facelift the 9i client could be good. I could hardly believe the 10g OEM was HTML. Pure HTML ? No interactive graphics?! and this was the monitor that was suppose to performance shoot, monitor and tune the some of the most important production databases in the world? Are you kidding me? The "solution" back pre-10gR1 was to have use gifs for any graphics. Any change in the gifs causes not a partial page refresh but a full page refresh. and these gifs would only be updated occasionally. The refresh rate on the Oracle home page could be as much as an hour out of date. Wow.
Well we change things - got SVG in, got the refresh rate to be much faster, but OEM is still slow and the data collection has hardly improved in the last 6 years. So much more could be done with some small changes, for example adding the average wait times for different kind of IOs, harnessing the wait histograms better, high lighting some key statistics , trending, forecasting, showing the differences between selected periods clearly, adding more drill down and aggregation options on the ASH data and externalizing in a clear graphical way the new extended row course data in ASH. I had want to get Adobe Flash/Flex into OEM but Oracle was reluctant. The compromise was SVG. OEM does use Flex but I've heard that Flex is going to be ripped out in lieu of ADF, and what's even more twisted is ADF builds it's graphic components upon Flex. Strange.
In all cases OEM is slow and huge and slow to change. Java, whether it's in the middle tier or a Java application is memory pig and generally slow.

I want the tool to run fast which means using as little CPU and memory as possible.
I want a tool that's fast to install.
I want a tool that has interactive graphics.
I want a tool that is easy to create and program.
I want the tool to be web enabled.

For collection, the best sounds like using SQL*Plus with anonymous PLSQL - this could possibly be wrapped in C for a single collection executable.
For aggregation, anything works as long as it has a database.
For UI Delphi sounds like the easiest to program *and* run (possibly VB - anyone know the pros and cons of VB verses Delphi?)
For web - it's either JAVA and FLEX and a memory pig and a pay for IDE or is RUBY on rails a possibility? Ruby has an Oracle , SQLite and UI packages.
What about HTML5 ? Too new? Does it have Oracle access? does it have an embeddable database? What graphic options does it have?

Tuesday, December 7, 2010

Solaris AWK still broken after all these years

It's amazing how time flies. I've got the above book sitting on my desk at work. It's the only book on my desk at work. Its probably my favorite computer book for it's terse clear style and simple power. I've keep it for about 20 years, and 20 years later, I'd expect any bugs in basic code examples to be worked out. For the most part on most platforms this is true, but not Solaris.

AWK is an awesome utility always available on UNIX and makes a perfect tool to for scripts that will run anywhere with no need for dependencies nor if's, and's or but's. For that reason it's all the more dissapointing that the default awk on Solaris is broken for syntaxes that were valid over 20 years ago. On the default awk on Solaris the following are broken
  1. awk -vVAR=value
  2. if ( $0 ~ "string" )
  3. gsub , sub
Probably the most useful thing to know is for point 1, passing in a shell variable, you can do it by setting a variable in the shell such as "VAR=10" and accessing it in the awk script with:
Point 2, the if construct can be gotten around a bit less elegantly  with
 /string/   { ...
Point 3, gsub and sub are broken is just plain annoying and it takes writing your own routines with index and substr.
Which was too bad for me. I wanted to write a script to eliminate more than 2 redo logs from database creation for "scratch" databases. I don't know if you can imagine a create script like:

STARTUP NOMOUNT pfile='/mnt/provision/redo2a/datafile/initredo2a.ora.provision'
) SIZE 52428800,
) SIZE 52428800,
) SIZE 52428800

I just wanted 2 redo logs and one member for group, so I wanted to pull out all that's highlighted in orange. Simple with AWK:

cat ${MNTDIR}/ | \
awk -vNREDO="$NREDO" '
# members
if ( $0 ~ "GROUP" ) { members="on" ; nlogs=0}
# output
if ( $0 ~ NREDO ) { last="yes" }
if ( $0 ~ "DATAFILE" ) { output="on" }
if ( $0 ~ "SIZE" ) { members="off" ; nlogs=0}
if ( output == "on" ) {
if ( nlogs < last ="=" last = "no" output="off"> /tmp/redo2.$$

The script works on AIX, HPUX, Redhat but not on Solaris. For Solaris I had a few choices. I could try and use nawk or gawk which would require me using some sort of "ifdef" and even then using nawk would require some changes. AFAIK gawk would have to be installed on the machines, thus ruling it out. For me, I wanted the safest option. The safest option for me was just to re-write the code in a way that worked around the bugs on Solaris default awk.

cat ${MNTDIR}/ | \
awk '
/DATAFILE/ { output="on" } # turn output back on
/SIZE/ { members="off" ; nlogs=0; size="yes"} # end of group members
/GROUP/ { members="on" ; nlogs=-1 } # start counting group members
{ if ( index($0,NREDO) ) last="yes" } # reach the maximum of redo logs to recreate
if ( output == "on" ) {
if ( members == "on" ) { # we are in the log member section
nlogs++ # count members
i=index(str,","); # get rid of comma at end of line
if ( i > 0 ) {
if ( nlogs < size ="=" last ="=" str="$0" i="index(str,"> 0 ) {
last = "no"
output="off" # we reach max # of redo logs, turn output off till we see DATAFILE
print str
{ size = "no" }
' > /tmp/redo2.$$

Thursday, December 2, 2010

Job Openings for Oracle experts

You know it's a good company when the support desk looks like this:

Delphix, the company I've been at for the past month, is hiring! We are interested primarily in Oracle expertise centered around backup and recovery, rman, dataguard and ASM.
Big plus for solid knowledge of NFS, storage systems, zfs and networking with an eye for performance tuning.
We are looking for sales consultants, support, engineers and QA.
I'm super happy with this new position - small company where everyone makes an impact and the people are super smart, motivated and experienced.
We've got an amazing team from the the creators of Dtrace and zfs to principle players in the development of Oracle RAC, cache fusion and dataguard to the founder of Avamar and the marketing VP who took VMware public. Come join us !
If interested, contact me at kyle.hailey @ delphix dot com.

Delphix turns physical database infrastructure into software that can run in a fraction of the space, automating some of the most challenging and time consuming operations in the datacenter: refreshing and provisioning of databases. With our database virtualization software, enterprises can reduce complex provisioning tasks from 10 days to 10 seconds and shrink 10 TB into 1 TB.
Enterprises typically create multiple copies of production databases for development, testing, QA, staging, UAT, pilots, training, operational reporting, etc. By linking with production databases via standard APIs, Delphix enables the benefits of consolidation and virtualization for all supporting database infrastructure—with no need to make changes to production systems. As a result, an investment in Delphix can generate a high-impact ROI with very low risk.
The team at Delphix has been responsible for developing products that have generated billions in annual revenue, including Oracle RAC, used in more than 20% of Oracle deployments, and EMC Avamar, the solution that pioneered data de-duplication, one of the fastest growing technologies in datacenters today. Our board of directors includes founding board members for Oracle, Business Objects, Informatica, Riverbed, Brocade, and Avamar. One of our lead investors was the co-founding chairman of Oracle, founding chairman of Business Object and founding chairman of Informatica. Our Advisory board has a number of recognized industry icons including the original WW VP’S of Field ops from Oracle and VMware. I We are head quartered in Palo Alto. Delphix will be hard to beat in terms of working on very interesting technology, a great business, and the ability to grow both your career and technical ability.

Tuesday, November 23, 2010

NFS and IO testing : Bonnie++

Been spending time lately testing out and trying to tune NFS mounts.
For testing IO, I've been using
  • dd
  • iozone
  • bonnie++
  • orion
This first option, dd, is fine for file creation tests and/or sequential reads but less flexible for random reads or random writes
To test random reads I thought I'd use iozone but don't see a solely random read test.
Then I thought I'd use the Oracle supplied tool, orion, to do random read test on an NFS mounted file system, but this doesn't work, at least on AIX 6.1, with my mount settings.
First orion test gave this error
$ orion -run simple -testname orion
ORION: ORacle IO Numbers -- Version
rwbase_read_luncfg: SlfFopen error on orion.lun
orion_parse_args: rwbase_read_luncfg failed
OK, have to create "orion.lun" with either my lun locations or my file locations. I put in file locations:
$ cat orion.lun
Now get another error
$ orion -run simple -testname orion
ORION: ORacle IO Numbers -- Version
Test will take approximately 9 minutes
Larger caches may take longer
orion_spawn: skgpspawn failed: Error category: 27155, Detail: 2
orion_main: orion_spawn failed
Non test error occurred
Orion exiting
Illegal instruction(coredump)
Looks like the "orion" executable wasn't being found, at least not by execve
$ truss -f orion -run simple -testname orion
700502: execve("orion", 0x0FFFFFFFFFFBF2D0, 0x0FFFFFFFFFFFFB30) Err#2 ENOENT
so I ran it from my bin directory where the orion executable could be found. Now get another error
$ orion -run simple -testname orion
ORION: ORacle IO Numbers -- Version
Test will take approximately 9 minutes
Larger caches may take longer
storax_skgfr_openfiles: File identification failed on /kyle/system01.dbf
OER 27054: please look up error in Oracle documentation
Additional information: 6
rwbase_lio_init_luns: lun_openvols failed
rwbase_rwluns: rwbase_lio_init_luns failed
orion_thread_main: rw_luns failed
Non test error occurred
Orion exiting
If the datafile was on "/tmp" it word fine but if it was on my NFS mount it failed with the above error. Hmm - doesn't work over NFS?
Finally I decided to try bonnie++. I download, unziped, tar extracted bonnie++ , ran "./configure" and then make, but got error
$ make
make: 1254-002 Cannot find a rule to create target bon_io.o from dependencies.
For some reason the rule for the ".o" doesn't seem to work:
%.o: %.cpp %.h bonnie.h port.h
$(CXX) -c $<
Not feeling like trying to figure make out I just did it by hand
$ for i in *cpp; do
name=`echo $i | sed -e 's/.cpp//'`
echo "g++ -c $name.cpp $name.h bonnie.h port.h"
done > makeo
$ sh makeo
$ make
That worked. Test results coming

Thursday, November 11, 2010

Virtual Conference on Oracle Performance!

The E2SN Virtual Conferences are webinar-style online training sessions, but just like at conferences, you can listen to multiple top speakers within a single event.
The standard conference consists of 4 x 1.5 hour presentations with 30-minute Q & A sessions after each presentation. The four sessions are spread across two days, so the conference takes only four hours per day. So, in addition to not even having to leave your desk for learning from world's top experts, you can still get your important work done in the office, too!
The first scheduled virtual conference is focusing on a walk-through on Systematic Oracle SQL Optimization, with emphasis on practical applications and real-life scenarios.

Systematic Oracle SQL Optimization virtual conference:

  • The speakers are: Cary Millsap, Jonathan Lewis, Kerry Osborne and Tanel Poder

  • The conference takes place on 18. and 19. November ( 2 x 0.5 days )

  • The time of the conference sessions is: 08:00am - 12:00pm Pacific Standard Time (PST) on both days

  • For this inaugural event we have a special launch price of 475 USD per attendee!
Click here for agenda, abstract and registration....