Sunday, November 30, 2008

GPS use in-flight

garmin_nuvi_260Have you ever wondered if you can use your portable GPS device while in-flight?

Here is a list of Airlines which APPROVE/DISPROVE GPS use in Flight. (Remember that the allow list means that it is left to the pilot’s discretion).

iPhones – AppShopper – Tool to find apps for the iPhone

image

http://appshopper.com/

AppShopper is a great website that helps in finding apps based on various criteria. Just like the iTunes store you can search for top apps based on whether they are paid or free and it also shows you the rating of the software (just because it is popular it does not mean that it is great). In addition AppShopper also allows you to track and find applications that have recently changed in price (http://appshopper.com/prices/free).

Saturday, November 29, 2008

Nav N Go’s iGo – Light years ahead of competition

 iGO_My_way_8_Cockpit_n I first started using Nav N Go’s iGo software when it came packaged with the Mio c310s. The software runs on Windows mobile OS. The graphics were clean and clear. The interface simple and yet highly customizable. There were many websites dedicated to hacking the iGo software. The list of features that I liked are endless (smart zoom, quick overview of route, easy customization of route parameters, etc.) I loved the software very much.

Unfortunately, this year, not many of the low-end devices came packaged with the iGo 8. This new version is vastly improved (even better graphics, more options, 3D land-marks, etc) and I wish I could get my hands on a device that was cheap (under $200 or at least one to review). With none available and my c310 aging out, this year I begrudgingly, settled on a Garmin Nuvi 260.

But if you have the $ then check out this list of devices that run the iGo 8. The iGo8 will definitely not disappoint you.

Current list of devices supported by Nav N Go iGO 8:

Airis T482igo_8_pack
Airis T620
ASUS MyPal A686
ASUS MyPal A696
ASUS P320
ASUS P535
Dell Axim X51v
Eten Glofiish M700
Eten Glofiish M750
Eten Glofiish M810
Eten Glofiish X500
Fujitsu-Siemens Pocket LOOX 720
Fujitsu-Siemens Pocket LOOX N500
Fujitsu-Siemens Pocket LOOX N520
Gigabyte g-Smart i
HP iPAQ h2210
HP iPAQ h4150
HP iPAQ rw6815 Personal Messenger
HP iPAQ rx5940 Travel Companion
HTC Athena 100 (X7500)
HTC Pharos (P3470)
HTC Touch Cruise (P3650, Polaris)
HTC Touch Dual (20 key) 5520
HTC TyTn (P4500, Hermes 200)
HTC TyTN II (Kaiser)
MiTA  Mio 168
MiTAC Mio 169
MiTAC Mio 180
MiTAC Mio A501
MiTAC Mio A701
MiTAC Mio A702
MiTAC Mio P350
MiTAC Mio P360
MiTAC Mio P560
MyGuide 7500XL
Palm Treo 750
Samsung SGH-i780
Toshiba Portege G810
Yakumo deltaX 5 BT

And a much more detailed list after the jump (link).

My wife has the HTC tilt mobile phone and I am going to check out to see if I can get the iGo8 to run on it and review this latest version from Nav N Go.

GPS – Mio and Garmin 2008

miotm_rgb_logoI loved my Mio c310 portable navigation device (PND or is it personal navigation device, never mind!). I loved the fact that it ran Windows CE and the mapping software was iGo 2006. The combination of using Windows CE and iGo, provided for a device that had crisp and visually pleasing graphics and an interface that was highly customizable. The c310 had its quirks but at $150 in 2006, it was a steal of a deal and I never got lost. The iGo mapping software is the standard that I hold other PNDs to know.

The biggest problem with the Mio c310 that I had was that the company did not put out map updates often enough and their customer service kinda sucked (just check the number of people who commented on my posts on upgrading the map software and how they could not get any help from Mio and used my post to unbrick their 310s).

Mio with NavMan software (Moov series)So this year I started looking at the Mio’s Moov series of GPS. And boy was I disappointed to learn that they had replaced the iGO mapping platform with the software that used to run on the NavMan devices (I believe Mio acquired NavMan, which is why that is the software that is now packaged on these devices). Now there are a ton of people that think this was a good decision on Mio’s part as the NavMan is simpler to use with far fewer functions and is less customizable (read crippled!). This year Mio had the Moov 500 on sale at RadioShack for $150. With a wide screen layout and text-to-speech (TTS) it is the cheapest full featured GPS on the market. And I would have bought it, if only it had the iGo software running on it. From my very limited testing with the devices screwed down to the desk, I just did not feel like the NavMan software brought anything new to the party. I would have liked to test the device for a week and return it in a week if I didn’t like it, but given the state of the economy, I did not want to buy something that I might have to return and cause a company to take on a loss.

Garmin Nuvi 260So this year, after tons of research, I settled on the Garmin Nuvi 260. This device does not have a wide-screen, but it does have text to speech (which means spoken street names - “Turn right in 100 feet on to Lincoln street”, instead of “turn right in 100 feet”). In addition, Garmin has a good map update policy and you can generally buy new maps every year for around $70. Garmin Nuvi’s also support a browser plugin, that allows you to send locations directly from Google Maps to your device when it is connected to your computer.

My only problems with the Nuvi: The device runs Linux and the graphics are just not crisp. (I felt that was also the same problem that the TomTom’s had). In addition, as someone who loves to tinker with his devices, there are just about zero hacks for the Nuvi(s) (same is true for the TomTom). I just cannot customize the map screen to show me the details that I am interested in and I am stuck with what Garmin decided that I must see while I drive. (On the Mio, I could have current elevation, time to destination, distance to next turn, just about anything that could be computed could be put on the screen).

The pluses for the Nuvi are: Solid map update technology, so you wont need a PhD in computer science to update the device’s firmware or maps. Simple interface – you will never ever need to break out the manual. Has TTS on a low end model. 5 hours of battery – so you can take it out of the car and on your walks around the city.

 

list of my posts on the Mio - http://blog.aggregatedintelligence.com/search/label/Mio

list of my posts on GPS devices - http://blogsearch.google.com/blogsearch?hl=en&source=uds&q=GPS%20blogurl%3Ahttp%3A%2F%2Fblog.aggregatedintelligence.com%2F

Wednesday, November 26, 2008

iPhone – Doesn’t have an app comparable to the Android’s ShopSavvy

Today, I got a chance to play with the Shop-Savvy application which is available only for the Android running G1 phone and I have just one thing to say “wow”. ShopSavvy is simple, easy and fun to use. All you do is get your camera close to the bar-code and the application does the rest…… it automatically detects the bar-code, captures it and sends it off to ShopSavvy to get you a list of prices at various stores. (I can’t count the number of items that I tried scanning today with the G1 – Pepsi bottles, Coke cans, Doritos bags, books – anything that had a barcode and was within arms length was scanned – and ShopSavvy did not fail even once).

Compare this to the applications available on the iPhone (Snappr for instance).

Snappr.net

The Apple does not allow developers access to the complete phone’s capabilities via its SDK. This means that one has to take a picture, then resize it (and or rotate it) and only then is the barcode image available to the application to send and get results back. Compared to the ShopSavvy’s simple steps (just point at the barcode), iPhone’s barcode reading applications feel like they are from the 19th century. (iPhone app – Snappr - http://www.snappr.net/)

Apple’s crippled SDK doesnt allow for developers to create innovative and user friendly apps for the iPhone. Whereas the Android platform provides developers complete access to the hardware and allows them to create cool and useful apps. If Apple does not open up its SDK, I am sure that it will loose its fight against Android based phones.

T-Mobile Ad showing ShopSavvy in action and a demo of ShopSavvy

 

 

iPhone app Snappr.net in action

Tuesday, November 25, 2008

T-Mobile and AT&T’s 3G speeds compared

A friend of mine recently bought the Google Phone (G1) from T-Mobile which provided me a chance to test the 3G networks from AT&T (iPhone) and T-Mobile (G1).

 

 

iPhone

G1

Download Capture1 2008-11-25_093544
Upload Capture2 2008-11-25_093620
Coverage image
http://www.wireless.att.com/coverageviewer/
image
image
http://www.t-mobile.com/coverage/pcc.aspx

Conclusion:

From this simple test using www.testmyiphone.com, it looks like T-Mobile’s 3G network is faster than AT&T’s 3G network (at least for the downtown Denver area). What is also interesting to note is that while the latency is consistent on AT&T’s network, it varies widely on T-Mobile’s network (download has a latency that is 4 times higher than upload). The reason this is important is that for the most part we are downloading more data than uploading data from our mobile phones. In addition the amount of information that we send back and forth is typically really small bites of data. This means that even though the T-Mobile network has a higher through-put, the higher download latency will result in a lower perceived speed of the T-Mobile network.

It is important to note that this test reflects network statistics at certain point in time (11:30am on Nov 25, 2008) and the results could be skewed because of the number of people accessing these 2 companies 3G networks at that time.

 

note:

for an interesting article on understanding network latency and the relationship between latency and throughput, read the article: “It’s the latency stupid!” http://rescomp.stanford.edu/~cheshire/rants/Latency.html

On the iPhone, you can take a screen shot of the www.TestMyIphone.com results by pressing the home button and power button simultaneously. On the G1, there doesn’t exist an easy short-cut to take a screen-shot. So the easy way to get a copy of your test results is to take down the test key value. If you then use the test-key in the following url “http://testmyiphone.com/results/[test_key]” (e.g.: http://testmyiphone.com/results/n2067Vd998O), you will get the test results.

Sunday, November 23, 2008

SQL Server 2008 – Spatial Data in 3D

Last week I attended an MSDN event in downtown Denver where one of the technologies demonstrated was SQL Server 2008. SQL Server 2008 supports spatial data and all the demos showed only data in 2 dimensions (X,Y).

I was wondering if SQL Server 2008 supported 3 dimensional data (X,Y,Z) and came across this post/tutorial and it does!

http://blogs.msdn.com/davidlean/archive/2008/11/01/sql-2008-spatial-samples-part-2-of-n-background-on-spatial-types-well-known-text-wkt.aspx

Summary:

The .AsTextZM()  and .ToString() can be used on a spatial datatype to get the X,Y,Z (and M) values of a geometry.

On the other hand, .STAsText() returns only the X,Y values of a geometry.

 

And to create geometries you use a function like: STMPolyFromText

geometry::STMPolyFromText('MULTIPOLYGON (((5 5, 10 5, 10 10, 5 5)), ((10 10, 100 10, 200 200, 30 30, 10 10)))', 0);

 

To find out how to construct various geomteries in WKT, see http://edndoc.esri.com/arcsde/9.1/general_topics/wkt_representation.htm

Saturday, November 22, 2008

iPhone 2.2 – Using Google Maps tutorial

I got the iPhone 2.2 firmware update almost as soon as it was released to iTunes. Once my phone was updated the first thing I dived in to try out was the new Google Maps application with it’s street view and all.

Unfortunately, unlike the previous versions of Google Maps on the iPhone (GMOI), in this version features are just not discoverable. When I first started up the new Google Maps application it looked just like the old version and I thought that for some reason the 2.2 update just skipped updating GMOI on my phone (the following images are the home screens for search, directions and the peel away menus of the new GMOI and they all look just like the previous version of GMOIs to me).

Google Maps for iPhone - Home Screen Google Maps for iPhone - Home Screen Google Maps for iPhone - Home Screen

Apple nor Google have released a tutorial/faq on how to get at the new features, so here is a very quick and dirty little tutorial on using the new features.

1. Routing
The first big new change is in routing. GMOI now lets you look up routes for driving, public transit or for walking. Once you input your start and end locations and you get a route back from Google, you will see the following screen, which shows you the first new feature in GMOI.

Routing - driving directions

Laid out across the top are the following 3 new icons: new icons for choosing routing options, which allow you to get routes for driving, public transit and walking. Tapping the buttons toggles between the various route types.

Routes - walking Routes - public transit

Above images: Google Maps for the iPhone (GMOI) showing a route for walking to the destination (left) and a bus route (right).

When you are looking at a route, if you tap the start button, you will get an animated fly through of your route.

The bus route adds a new task-bar that gives you information about when you need to depart and when you will arrive at your destination.Public transit - routing information

Touching the clock icon will take you to the following route customization page, where you can select different routes based on time:

Transit Times page

If you tap the depart information box, you will be taken to another page where you can change the schedule of your trip and even customize the schedule to be based on an arrival time instead of a departure time.

One big problem with the bus routing is the fact that you can not determine the bus/train name from the main map. The “Transit Times” customization window also suffers from the same problem, and I wish that Google had thought of listing the bus IDs that one would have to take for each of the listed trips.

To get the details of the bus route: such as where you would have to walk to, to get on the bus, which bus ID you need to take and the walking directions from the ending bus-stop to your destination; you first need select and display the route on the map and then you need to go to the peel away menu page and select the list option.

GMOI - peel away menu    ==> Tap on List ==>     Detailed directions for public transit

2. Street View

Ever since Google announced that the G1 phone would be getting Street View, owners of the iPhone were wondering if Google would be bringing it to the iPhone…… and in this 2.2 release of the iPhone firmware, Google has brought Street View to the GMOI.

Again the Street View is a feature that is just not easily discoverable on the iPhone. (Hint: you don’t get a special menu when you zoom far enough into the map)

To get Street View you need to do one of the following things:

  1. Drop a pin (which is done from the peel away menu page from the main map window)
    StreetView - PushPin or
  2. You search for a location, using the Search feature. (which will add a pin(s) to your map automatically).

The new pin labels have a special new icon on them which looks like this Copy of Picture 023.png . If Street View is available for the location where your pin currently points to, then this button will be available otherwise it will be disabled and will appear grayed out.

When you tap on the Copy of Picture 023.png button, GMOI will take you to the StreetView of that point via a smooth animation (looks very cool). StreetView is a 3D view of the location where you dropped your push pin (if you have a slow connection, you will see the blank globe and sky while GMOI downloads the images to apply to this 3D view).

Street View - 13th and Broadway - Denver

Once in the StreetView window, you can pan around to get a 360 degree view of that location by pressing and dragging your fingers in all 4 directions (A left-right motion rotates your around the point and an up-down motion tilts your view). The small circle (bottom right) of the window shows you an overview of your location that you are currently viewing. As you rotate around the point, a cone illuminates the direction you are viewing.

Street View - 13th and Broadway - Denver

Double tapping anywhere in the window (or a pinching out motion) zooms into the view.

Finally, if you tap on the arrows that appear on the road, your StreetView location will be moved in that direction and the view will be refreshed to reflect that new position.

Street View - 13th and Broadway - Denver

Street View - Colorado State Capitol

(Above – Google StreetView of the Colorado State Capitol)

More information about the release is available from the Google Mobile Blog: http://googlemobile.blogspot.com/2008/11/google-maps-for-iphone-adds-street-view.html

Friday, November 21, 2008

Using the Microsoft Lines of Code Counter Tool

If you download the MS LOC counter tool (available at http://technet.microsoft.com/en-us/library/bb897860.aspx) and then install the add-in version, you might be left wondering about how to start using the tool (at least I was!)

Before installing the MS LOC tool make sure that you have VS 2005 and Team Explorer installed on your machine. (Not sure if MS-LOC works without Team Explorer).

To start using the tool first go to View -> Other Windows -> LOC Counter Explorer.

image

This will bring up the LOC Counter Explorer tool.

image

Next you need to create a counter task and then run it.

The MS-LOC tool allows you to count code that might be stored in Visual Studio Team System or Visual Source Safe repository or even items that are stored on your file system (choice is mutually exclusive though).

For more information:

Notes
Note on IT
PowerPoint
PowerPoint Presentation
Podcast
IT Pro Webcast, WMA, MP3
TechNet Radio
Download the tool
Line Of Code Counter tool

Thursday, November 20, 2008

iPhone – Firmware 2.2 is now available

I am downloading and updating my iPhone as I am writing this post. Tons of new improvements are going to be available in this update (Google Street View for one).

Screenshots of the new firmware in action after the jump - engadget.

ASP.NET Web Server Control Event Model

When you first start working with ASP.Net, the Visual Studio wizard generates code that hides a lot of complexity of what happens behind the scenes. At first glance ASP.net has a model that is similar and familiar to WinForms developers – it allows you to hook up and respond to events generated from the UI. Obviously the big difference is that events in ASP.net get generated on a client and get processed on a server.

But when you start digging deeper you have to start wondering how events on the client hook back to your server code. In some cases it is via attributes attached to elements in the web-page.

<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />

Where Button1_Click is a method in the code behind.

But then there are other methods such as Page_Load that seem to get called without any kind of hook up.

protected void Page_Load(object sender, EventArgs e)

And Page_Load is not even an overridden method. So how does it get called?

The first thing to realize is that the first event is an example of an event triggered due to interaction with a control. The second is an example of a life-cycle driven event (life-cycle events can occur on both controls and pages).

Controls declared in the markup file (front-end) are automatically bound to the methods in the code behind class using the attributes defined on the control (such as OnClick was bound to Button1_Click in the above example).

As for page events, when you name a method using the standard Page_{EVENT NAME}, then the ASP.Net engine automatically calls these methods during the life cycle of the page. This is the reason that the Page_Load method gets called when ever the page gets loaded. This automatic hook-up is based on the “AutoEventWireup” property that is defined on the page and has a default value of true. If you prefer to manually hook-up the events, you can do so by setting “AutoEventWireup” to false.

<%@ Page Language="C#" AutoEventWireup="false" CodeBehind="Default.aspx.cs" Inherits="WebApplication2._Default" %>

Note:

If you use explicit event binding on your pages, then remember to set “AutoEventWireUp” to false, otherwise your events will get called twice.

Auto event binding is slow as ASP.net has to reflect on your code and find methods that match the standard. For this reason it is recommended that you do not use auto event binding on high traffic websites or when response times are important.

Learn more about the event model from MSDN

Learn about the page events and the list of page events that you can bind to at ASP.NET Page Life Cycle Overview (And here is another good article from CodeProject - http://69.10.233.10/KB/aspnet/ASPNET_Page_Lifecycle.aspx)

Finally, here is information for processing events on the client – (instead of on the server) - Client Script in ASP.NET Web Pages : useful for those times when you need to handle frequently fired events such as onmouseover.

Wednesday, November 19, 2008

Design patterns every ASP.net developer should know

download

Here is a good article on design patterns for ASP.Net projects - ASP.NET Patterns every developer should know (From DeveloperFusion.com)

Toad – Did you know you can run it of a USB stick.

via http://www.toadworld.com/Default.aspx?tabid=67&EntryID=312 (Bert Scalzo’s blog)

Download Toad_flash.zip from http://www.bertscalzo.com/page5.html

Here are the steps:

  1. Format the USB Flash Drive as an NTFS file system.
    1. File explorer, right hand mouse, properties, hardware tab
    2. Select the USB Flash Drive and press the properties button
    3. Policies tab, choose Optimize for Performance and press OK
    4. Format the USB Flash Drive – NTFS should now be available
  2. Create TOAD_FLASH directory on your USB Flash Disk (at topmost level)
  3. Download and then unzip the TOAD_FLASH.zip file onto your USB Flash Disk
  4. Unzip the contained Oracle Instant Client installation file onto your USB Flash Disk
  5. Install Toad for Oracle and copy the Toad home (install directory) to your flash drive
    Example: xcopy /s /q "C:\Program Files\Quest Software\Toad 9.7" "X:\Toad 9.7\"
  6. Run TOAD_FLASH_SETUP.bat file to install (and save pre-existing Toad setups)
  7. Run TOAD_FLASH_RUN.bat file to launch Toad (must enter license first time)
  8. Run TOAD_FLASH_RESTORE.bat file to restore PC back to prior Toad state

C# – How do you synchronize your methods?

Do you use the following pattern to synchronize your methods?

class Transaction 
{
   private static DateTime timeOfLastTransaction;
   public static void PerformTransaction() {
      lock (typeof(Transaction)) {
         timeOfLastTransaction = DateTime.Now;
      }
   }
   public static DateTime LastTransaction {
      get { 
         lock (typeof(Transaction)) {
            return timeOfLastTransaction;
         }
      }
   }
}

The above is probably what a majority of C# programmers write (I did too for a long time). This is because this was how Microsoft said we should. (Instead of using the type object you might be using the this reference for the lock).

Well if you don’t know this by now – the above method is not the best way to synchronize your methods because the object on which your locking is public and could be locked by code run out side of the class.

The correct way to perform synchronization is to use an object whose raison d'etre is to provide synchronization.

class Transaction {
   // Private, static Object field 
   // used purely for synchronization
   private static Object objLock = new Object();

   private static DateTime timeOfLastTransaction;
   public static void PerformTransaction() {
      lock (objLock) {
         timeOfLastTransaction = DateTime.Now;
      }
   }
   public static DateTime LastTransaction {
      get { 
         lock (objLock) {
            return timeOfLastTransaction;
         }
      }
   }
}

Read more about this topic in this MSDN article: http://msdn.microsoft.com/en-us/magazine/cc188793.aspx

(The above code snippets are based on the code snippets that appear in the above article)

SQL - What is the difference between SYSDATE and CURRENT_DATE?

Quite simply SYSDATE returns the time on the server where the database instance is running.

Where as CURRENT_DATE returns the time where the session is running (adjusted for the session's time zone).

And you can alter the session's time zone using the following commands:
ALTER SESSION SET TIME_ZONE = 'MST'
ALTER SESSION SET TIME_ZONE = '-5:0'
ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS'

Oracle - Today's Date

You probably know that sysdate returns today's date in SQL.

But what if you have a table with a field that records the time at which the record was added and you wish to find all the records that were added today (as an example lets call this field UpdateDt).

You first might try something

select * from myTable where UpdateDt >= Sysdate;

This will obviously not return any results because sysdate does not just include the current date but also the current time and obviously there are no records that were updated before the current date-time.

Next would be to try something like the following:
select * from myTable where UpdateDt >= sysdate - 1 day;

But the above statement depending on when the query was run could return not just records that were added today but also some of the records that were added yesterday (because sysdate - 1 day returns a date that is 24 hours in the past).

Unfortunately Oracle doesn't seem to have an easy function to return today's date with a time stamp of 12:00 am. So here is what you need to do:

select * from myTable where UpdateDt >= to_date(to_char(current_date),'dd-mon-yy');

where "to_date(to_char(current_date),'dd-mon-yy')" will return today's date with a time stamp of 12:00 am.

Toad - Tips n Tricks - Customize the Schema Browser

Here are some ways in which you can customize and make the Schema Browser in Toad even more useful.

  1. Open the Schema Browser by default
    You open up Toad and by default it opens the editor window for you. But what you would like is for Toad to open the Schema Browser as the first window (and maybe the editor window as the second one).
    Toad is probably one of the most configurable software applications that I have seen and provides you with a way to do just that.
    Here is how:
    Go to the Toad Options window. (View -> Toad Options)
    image
    In the LHS tree view, scroll right to the end and click on the "Windows" node.
    image
    In the details window, you can specify which windows are available and which windows should auto-open.
    image
    The other option that is important is the drop-down at the bottom of the pane called "Auto-open bring to front". Setting this to the Schema Browser, make the Schema-Browser the default window that opens up and is ready for use when Toad first starts up.
  2. Show all the tabs of the Schema Browser's left pane at once.
    By default Toad shows the Schema Browser's LHS tabs in a single row with scroll buttons. This makes it very hard to quickly jump between tabs that might be far away from each other.
    image
    Toad allows you to customize the LHS browser to display all the tabs in many different ways. The one I like the most is the multi-line tab view as it shows all the tabs at once making it easy to jump between them.
    image 
    To show the multi-line tab view, click on the customize button:
    image
    And select the "Tabbed (multi line tabs)" option.

    Obviously the sheer number of tabs makes this view a little intimidating to work with. So read on to the next tip.
  3. Customize the left pane.
    As you can see, the multi-line tab view is extremely cluttered to make it very useful. Fear not, Toad allows you to customize which tabs are visible. Here is how I have it setup:
    image
    To customize which tabs (called objects by Toad) are displayed, click on the customize button and select the "Configure LHS Object Types" option.
    image
    The window that pops up allows you to specify which tabs (objects) are visible. It also allows you to quickly go back to the default view.
    image
  4. Quickly toggle the display of the right pane (details)
    F5
    is your friend. Hitting F5 toggles the RHS (details side) on and off. This allows you to get a complete view of all the Schema Browser tabs.
    image 
    image

Other useful tips and tricks for the Schema Browser:

  1. F5 - refreshes the contents of the LHS pane.
  2. Shift + F5 - refreshes the contents of the RHS (details) pane.
  3. You can select multiple objects (in either the LHS or RHS panes) and when you hit CRTL+C, the list of objects are copied to the clip-board as plain text.
  4. You can customize how the list is copied to the clip-board (one line per item or items separated by commas) via the Toad Options window (under the Schema Browser options)

Monday, November 17, 2008

Toad - Tips N Tricks - Pushing your dev database to production

The time has come to finally move all the awesome changes that you have made in your development database to a production database. Your production database is live and you need to merge your changes from development into production..... I hope you kept track of all the changes you made to your development database.

What is that you are saying? You didn't? Oh! you forgot! No worries, Toad comes to the rescue.....

Toad allows you to compare 2 schemas using the Database Compare tool. (Database->Compare->Schemas)

Database->Compare->Schemas

There are 3 tabs in the Compare tool.

image

In the first tab you set up the schemas that will be compared. The second tab allows you to define what parts of the schema should be compared (tables, packages, etc). The object set allows you to define filters which will be used in selecting objects that need to be compared (useful if you use a standardized naming convention on your db objects).

To use the Compare Schemas tool do the following:

  1. Set the source schema.
    1. If you already have a connection open this will default to currently open connection.
    2. You can also choose any other valid connection you have in Toad.
  2. Define the target schema as well as the folders where all the output files will be stored.
  3. Under options select those objects that you wish to be compared.
    1. The options tab has 4 nested tabs, each one allowing you to customize exactly which objects need to be compared.
    2. The most important tab is the first one "Object Types to Compare"
      image
    3. The second tab "Object Type Specific Options" is equally important as it allows you to specify what needs to be ignored in objects such as your PL/SQL scripts when the comparison is made.
      image
  4. Once you have set up how Toad should compare your schemas hit the "Begin Schema Compare" button image.
  5. This will result in 2 new tabs being added to Toad Compare space.
    image
    1. The result tab shows you in a tree what is different as well as similar between the 2 schemas.
      image
      This will allow you to quickly jog your memory about what all changed between your development and production schemas.
      You can also output the differences to an excel sheet or a HTML report.
    2. The more interesting tab is the Sync Script tab.
      The sync script tab has a script that you can run on the target schema to make it look like the source schema. This sync script is a time as well as a life saver, as it cuts down the time required to modify your production schema as well as reduces the number of errors and mistakes that you might make if you had to do this manually.
    3. But do your due diligence and read each line of code in the Sync Script and make sure that each statement is doing something to the production schema that you expect.
    4. I suggest that you have a test schema which mirrors your production schema. Make sure that you are first able to migrate your changes from development to test. Have everybody (developers, testers and users) test the test schema. Once you are sure that your test schema is indeed working correctly you can run your sync script on your production schema.
    5. An Important Note: The Sync Script is only available in the DBA version of Toad. Without it you will be able to view the sync script but not save it or run it.
      To find out if you have the correct license to save the Sync Script, run the Toad Support Bundle Tool (Help -> Support Bundle).
      image
      image 
      If you see the "DB Admin Module", then you can save the Sync Script, otherwise when you hit the save button, Toad will write out the first few lines of comments from the Sync Script and stop without any error message. (For the longest time ever I though Toad had a bug, until one of their tech support people straightened it out for me).
      I wish this feature was part of a lower bundle and not isolated to the DBA bundle - as I think developers will find it useful to parse the script and then provide it to their DBA to run on the schema. (Quest software are you listening?)

The Compare tool has been a huge time saver as well as a life saver to me. And now that you know that this feature exists in Toad, I hope it does the same for you as well.