24 November 2012

Exporting/Importing Microsoft Outlook 2010 Email Account

Microsoft Outlook 2010 is pretty sophisticated application but unfortunately just recently I was hit by a major imperfection – there is no way to import/export your email account settings (IMAP/POP3 configuration, etc.). Nevertheless there is one tricky way to do it – import/export some Windows registry keys. To export the account settings just export the following key:

HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook

To do so just run regedit.exe and navigate to the key above, right click on it and select Export.

The import process will be to simply double click on the exported file.

30 August 2012

Getting Started with IBM Netezza

Note: More recent version covering Netezza 7 is available here: http://szahariev.blogspot.com/2013/07/getting-started-with-ibm-puredata.html

Data Warehouse, Business Intelligence, ETL, Data Analysis are terms we here more and more every day. But there is one name that becomes more and more popular: Netezza – state of the art data warehouse appliance offered by IBM. If you want to get started with Netezza, there is a good news: IBM distributes an emulator running under Windows that you can download and deploy at home. So here is what you need:

  1. Download and install VMware player (free) or VMware workstation (paid)
  2. Install VIX API (free) if using VMware player
  3. Download the Netezza emulator by first requesting to join the IBM Netezza Developer Network (NDN) by following this link: https://www.ibm.com/developerworks/mydeveloperworks/groups/service/html/communityview?communityUuid=35ac05e2-4e00-42fe-b252-111e5f3ad8fa

When you join the IBM NDN you will find there not only the emulator but also the required product documentation that will guide you to master the product. Here is what you will get when the emulator is running:

image

Currently IBM does not offer Windows based GUI for querying the Netezza so you will have to connect to the Netezza host and use nzsql by using ssh client.

One 3rd party alternative to the nzsql is the Aginity Workbench for Netezza. It runs under Windows and provides GUI for querying the Netezza. The application will require a free registration after a 10 days trial period. The downside is that you will need a Netezza ODBC or OLE DB driver to connect to the Netezza host. Unfortunately these drivers can be downloaded only by IBM customers.

29 August 2012

Using Notepad++ to Search and Replace using Regular Expressions

Not long time ago I had to modify a 300 lines SQL Server stored procedure that uses columns containing spaces in the names into a version that does not contain spaces. For example columns like [Price Rate] should be converted to Price_Rate. Doing this manually is long and tedious task. Fortunately Notepad++ saved the day once again – use regular expressions.

To to search and replace the spaces for the column names with underscore open the Notepad++ Replace dialog (Ctrl+H) and type the following for the search pattern:

\[([0-9a-zA-Z]*) ([0-9a-zA-Z]*)\]

The above will match everything that starts with [ continues with combination of letters or numbers, has a space after that, has a combination of letter or number after the space and ends with ]

Type the following for the “Replace with” field:

\1_\2

This means that Notepad++ will replace the \1 with the match between the [ and the space from the column name. The \2 will be replaced with the match between the space and the ]. Here we are using one special feature – if part of regular expression is within a round brackets then this match can be tagged using \1, \2, \3, etc.

At the end select “Regular expression” for “Search Mode” and hit the “Replace All” button.

image

For more information about the special character of a regular expressions take a look here.

12 February 2012

Introduction to DSCop

DSCop is an open source tool that analyzes IBM InfoSphere DataStage jobs and reports information such as violation of some commonly accepted best practices. It's developed in C# and provides plugin based architecture to allow 3rd party extensibility. The tool comes with a few sample plugins that should be enough for basic understanding how the tool works and how to implement your own plugins.

Requirements

Computer running version of Microsoft Windows with .NET Framework 4 preinstalled.

Download and Install

The current publicly available version of DSCop is RC1 available here. After download unzip the file and you are ready to use the tool.

Basic Usage Scenario

The tool will automatically search the folder where the DSCop.exe file is located and will load all the plugins. Each plugin contains one or more rules. Each rule enforces certain check that is performed on  a DataStage job. The jobs should be exported to one or many xml files.

To check a job with the tool, use this syntax:

DSCop jobfilename.xml

As a result you will get a list with rules that were executed, jobs processed, rule violations found.

A sample output after running the tool is shown here:

image

DataStage has the ability to export multiple jobs into singe XML file. However if your jobs are not in one file you can use wildcards to specify them like this:

DSCop Staging*.xml

Advanced Usage Scenario

Now we are going to explore some of the advanced use cases where you want to run the tool by including/excluding certain rules.

The syntax for running the tool by explicitly enumerating the rules you want to execute is:

DSCop jobfile.xml –include RuleName1 RuleName2 RuleName3

A sample output using this syntax is shown bellow:

image

Please notice the “*Ignore” next to the rules that are not enforced.

To exclude certain rules use the following syntax:

DSCop jobfile.xml –exclude RileName1, RuleName2, RuleName3

image

Sample Plugins

The RC1 version of the tool comes with the following plugins/rules:

  • CoreRules/StableSortRule – checks all Sort stages whether the StableSort=true. StableSort is enabled by default but should not be used due to decreased performance.
  • CoreRules/TeradataConnectorParametersRule – checks all Teradata connector stages whether the ServerName/Username/Password properties are parameterized. Hardcoding this information should be avoided.
  • NamingRules/PrefixNamingRule – checks if stage names are following predefined naming convention. The naming convention is described in a the file NamingPrefixes.xml located in the same folder as the plugin.

Feedback

You can send your feedback to the following email: dscoptool-at-gmail.com

10 February 2012

Some tips for the SSD owners running Windows

Solid State Drives (SSD) are much different than Hard Disk Drives (HDD). Because of this you must change your usual pattern of usage. Otherwise you risk your shiny new SSD to be at the end of its life only after a few months of use. In this post I will describe some of the tricks that seems to work on my machine.

The main disadvantage of the SSD devices is that each data cell can be re-written limited number of times. This number is several times lower than the data cell in the HDD. So you must make sure that the applications you are using are not constantly writing on the SSD. Bellow is a short list that will extend the life of your SSD.

Must Have

 

Disable Windows Swap File

If Windows runs out of RAM then it moves some of the data to the swap file on your disk drive. This is one of the primary sources of disk write operations on systems running with low RAM memory. Buy more RAM and disable Windows swap file. The RAM you need depends on the applications you are running and the version of Windows. IMHO for Windows 7 you need at least 4GB RAM, 8GB is recommended.

Turn off Disk Defragmenter Schedule

The classic hard disk drives are using a moving head that reads the data from the disk. If the file is not located on sequential blocks on the disk, the head positioning time will increase and this will slow down the read process. The defragmentation process makes sure that the file blocks are located in a sequence on the disk. The SSD do not suffer from this since there is no head that reads the information. So you don’t need this feature.

If you perform defragmentation on SSD drive this will only drain write cycles from its life.

Windows 7 automatically detects SSD drives and turns of the defragmentation but it does not hurt to check if it has been stopped. On Windows 7 you can disable the Disk Defragmenter Schedule like this.

Move Temp Folders to RAM Drive

RAM drive is a disk drive that looks looks like a normal drive for your windows but stores the information in the RAM instead of using a SSD or HDD. The operations with RAM drive are several times faster than the operations with SSD or HDD. The downside is that you lose the drive content after powering off your computer. But the Temp folder is used by Windows to store temporary files not needed after power off. So you don’t have to worry that you will lose something important.

Moving the windows Temp folder to a RAM drive will decrease the write operations on your SSD and this prolongs its life. Here is how to move the Windows Temp folder to another location. The only think you should select is the software that emulates your RAM drive since Windows still does not have such a feature. For example the QSoft’s RAMDisk does a perfect job for me. You can download a free version that will expire after 6 months (at which point you need to download new free version which will be active for another 6 months).

You can even move the location of Internet Temp folder but this will slow down your browsing since there will be no cached images or pages and everything will be downloaded again after you power off the PC.

Turn off Windows Search

Windows Search is another feature that generates a lot of write operations due to the indexing process. The SSD are quite fast on reading data so you don’t need indexes to speed up your search. You can turn it off like this on Windows 7 systems. Of course if you are not satisfied you can always turn it on.

Monitor the Overall Health of the Drive

Install an application that will report your drive health. For example a good choice is the free version of SSDLife. It can be downloaded here. The most useful metric is the approximate date when the drive is supposed to failure.

image

 

Nice To Have

 

Hibernation

Hibernation becomes very tempting when combined with fast disk drive. The down side is that this feature stores GB of information (depending on you RAM size) every time when the system is hibernated. Having in mind that the SSD drives are sensible to the number of writes it may quickly drain the life from your new SSD drive. And of course after disabling you get some more free space on your drive. Here is how to do it on Windows 7.

Disable System Restore

System Restore is helpful if you mess up your system – for example installing wrong device driver. However, this feature consumes significant amount of free space on your SSD drive. If you are suffering from free space problems and you are confident that changes you make to your system are safe you can disable System Restore.