Kris' blog

Stuff mostly around Oracle SQL Developer, Data Modeler, the APEX Listener and other general Oracle development thing in general.

Thursday, December 03, 2009

Externally Editing Blobs

Another new thing in this RC1 is the ability to easily edit blobs in the database.  We've had the save and load from file as well as the ability to show the text of the blob but now we're interrogating the blob to figure out what it is.  The code is starting with what should be fairly common file types and we'll expand as we go.  There's a new button on the BLOB view dialog named External Editor.  When you press this, you may get prompted to go define an editor for this type.  Here's what it looks like for XML stored in a BLOB.


Defining the editor is located in the preferences.  I'm going to setup VIM as the editor of choice for all *.xml files. 

Now when I press the External Editor, gVIM launches. What is happening is that there is a temp file created and called via command line from SQL Developer.  The launching of the external tool is monitored so that when that tool is closed the temp file is re-loaded into the database into the BLOB content.


Which is why you'll see a * next to the row indicating that there was a change made and it's awaiting a commit or rollback.
 

Now editing images,documents,xml stored in the database is greatly simplified.

Wednesday, December 02, 2009

Apex Listener EA2

A new build of the Application Express Listener was just loaded.  This new version adds lots of new features. Check out the Configuration in the install guide.  Here's a screenshot of some of the new options available.



Another new thing is in the log file.  Every 1000th request I print some statistics to the log file.  The statistics include uptime, processing time , min/max/avg/median times for the requests.  Here's an example of those statistics where the listener has been up for 9 hours for a total of 16 minutes of processing time to deliver 79.1M of data.


Current Time:    Wed Dec 02 10:06:02 PST 2009
Server uptime:   0 Days 09:01:32.126
Total accesses:  1.95K
Total Traffic:   79.1M
Total Processing Time:    0 Days 00:16:52.965
Min/Average/Median/Max Processing Time:    6    506    308    12057ms
Min/Average/Median/Max DB Time:    0    288    205    9077ms
Active Requests:    0

1/3 active/available in cache apex

Tuesday, December 01, 2009

Realtime SQL Monitoring

There was some a new feature added to the realtime SQL monitoring in the latest SQL Developer 2.1 staged on OTN today.  This little feature adds the ability to save the reports from the real time sql monitoring.

First to invoke the screens, goto the Tools->Monitor SQL...


Next you'll get a list of the SQL that has been monitored.  In case your new to this feature of 11.1, this is any SQL that runs over 5 seconds and it's history is limited to 20 statements per CPU the database is running on.


To get to this screen right click on the grid of running SQL and choose "Show SQL Details"  This will show the state of the SQL statement you choose.  The green arrows in this screen shot indicate that this current step of the execution plan the statement is on.  This is VERY handy to determine if the SQL is nearing the end or just beginning.  This has all been in the tool for a while now.  The new part is highlighted in ORANGE.  It's a simple save button to save this screen to an HTML file.

Once you save the file and open in a browser, you'll get a saved version of that same screen.  You can then mail or post this resulting file where the person responsible for the SQL can get it and address an issues.