T-SQL Tuesday #41 – I ♥ SQLBits

TSQL2sDay150x150It’s been a long time since I last wrote a T-SQL Tuesday post but the combination of a great topic along with a spare 5 minutes of downtime has resulted in my contribution to the mix this month.

This time around T-SQL Tuesday is hosted by Bob Pusateri (blog|twitter) and his chosen topic is “how did you come to love presenting?”. So here goes…

In 2010 I had traveled to my very first conference as a presenter. So there I was, stood on the stage in front of a motley collection of SQL professionals, realizing the enormity of what was about to happen.

For many years I had been one of the guys in the crowd of a sea of attendees who had come to listen to awesome presentations from awesome professionals. From time to time I would wonder what it must be like talking in front of all those people -and more importantly whether I could be capable of such a feat. Did I have anything to say? Yes absolutely, but these guys were (of course) in a different league from me, and a league in which I could never hope to emulate. Ever. Then a funny thing happened one day… I decided to submit a presentation to SQLBits 7 really out of curiosity more than anything.

Oh Flip!

Oh Flip!

Months later, oh joy of joys… I got selected!

Finally when the euphoria faded, the reality set in. OH MY GOD… I’VE BEEN SELECTED!!! WHAT AM I GOING TO DO!!! This presentation was going to be my first ever presentation to my first ever audience anywhere ever and I knew it wasn’t going to be a walk in the park. There was also an extra element of excitement/ fear in that SQLBits always recorded their presentations, hosted them publicly for free on the internet, and (if that wasn’t enough) used picture in picture recordings of the presenter in sync with the slidedeck.

Yes people, even back then SQLBits was a very slick conference, and if you are going to fail at presenting, it is perhaps not the place to start :) .

And let’s not forget the leap of faith that the SQLBits committee had shown by selecting me for this event. Whilst I was not entirely unknown from a social media perspective (I had been a active blogger and twitter user for several years by then) the fact remains that as a presenter I was (shall we say) a little inexperienced!

So moving back to stage where I was delivering my first ever session…

I remember looking at the audience quite early on around 5 minutes into the presentation and I clearly remember thinking I AM ACTUALLY DOING THIS!!! After composing myself, I continued the session and think it went quite well. Not only was it one of the most frightening, exhilarating, scary and rewarding experiences that I have ever had, the months and months of preparation leading up to the event improved my technical skills exponentially from where they had been before.

Now with every presentation I deliver, I always learn hugely from each experience.

After SQLBits 7 I decided that I wanted more and have gone on to present at every SQLBits since (to date). I have also delivered sessions to many major SQL conferences and community events around the world, seen places I would have never seen, have met people I would have never met and embraced the SQL Community in ways that I had never realized possible.

So to the SQLBits Committee who made it all this possible and started my enormously rewarding journey, I would like to say a special thank you!

SQLBits I think I ♥ you!

Posted in learning, personaldevelopment, publicspeaking, sql, sqlbits, SQLServerPedia Syndication, t-sql tuesday | Tagged | 1 Comment

How to run SQL Server 2012 on the Kindle Fire HD

Warning! Please do not attempt to perform any of the following steps on production systems. This information is provided purely for reference and any attempt to replicate these actions on your own hardware will be purely at your own risk!

One of the biggest benefits to the latest release of SQL Server (and reasons to upgrade) is that Windows Server Core is now a supported option. For those of you who are not yet familiar with Server Core, it could be best described as a reduced GUI version of Microsoft Windows. In other words, if you like the command line then you are in for a very big treat! Regular visitors to these pages will most likely be very aware of my passion for Windows Server Core and more to the point running SQL Server on it.

I digress slightly, but the point is that because SQL Server can now run on within a reduced graphical interface environment, one large beneficial side effect to this is the portability of the database engine. More specifically we can “hack” SQL Server to run on more and more types of hardware and software. The following is a closely guarded secret by Microsoft, but with with a few simple hacks, re-compilations and know how, we can spoof SQL Server to run on several other Operating Systems.

Let's get to this!!!

Let’s get to this!!!

Now is probably a good time to stress that whilst I will reveal some of the magic involved in fooling SQL to run elsewhere other than Windows, I am currently bound into a Non-Disclosure Agreement with Microsoft and will therefore be careful not to break it. Therefore any information that I have compiled within these pages are public domain and can be found from various sources elsewhere. It is also important to stress that as of this time of writing, only the SQL Server features supported by Windows Server Core can be “ported” across to other environments -so if you are wanting to use Master Data Services elsewhere other than “full-fat” Windows, then unfortunately you are out of luck.
For a list of all the SQL Server features currently supported on Server Core you should visit “Install SQL Server 2012 on Server Core“.

Several months ago I came into possession of a lovely new Kindle Fire HD and as you may know, this tablet runs a customized version of Google’s Android Operating System. Having had some recent (but limited) success with running SQL Server on some other Android based Hardware I decided to try my luck on this nice bit of kit, and the following is how I did it.

Install Server Core

Probably one of the most time consuming parts of this whole exercise is the installation of the Server Core Operating System. This can be especially bewildering if you have never done so before, but a very good source of information is the MSDN article ”Install and Deploy Windows Server 2012“. One reason I chose Windows 2012 as opposed to Windows 2008R2 was simply to eliminate any possible backwards compatibility issues with Android when we come to port SQL Server. For instance there is a well known bug in Android 1.6 Donut where a port of SQL Server from Windows 2008 will cause erratic buffer pool memory corruption.

Install SQL Server onto Server Core

Installation of SQL Server onto Server Core is relatively straight forward (see the previous link provided) as long as you are comfortable with performing a command line installation -either through using a configuration file or a full  set of command line options. Unfortunately (and perhaps understandibly) GUI based installation will not work, however I did identify a “bug” which allows a workaround which I detailed in the following post “Using the SQL Server Installation Wizard on Server Core!“.

Dump the SQL Server Process to disk

There are lots of ways to dump a process working set (the memory a process is consuming) to disk. On Server Core, it is no more difficult to do so since the Task Manager is (partially) supported and works as you would expect. You simply need to locate the SQL Server Service process, right click it and select the Create Dump File option.

dump_process

Once this is successful you will see a message telling you where the dump file has been created. One very important consideration for you is to make sure that you have set a fairly low maximum memory cap for SQL Server’s buffer pool otherwise it the dump file will be much larger (and take longer to output) in addition it will make your ported SQL Server application to run faster.

dumped process

Rename the dump file to .src

A fairly simple but necessary step to perform is the renaming of the dump file that we have just created. The reason for doing so is so that we can recompile the assembly in the next step and target our assembly for Operating System of choice. Simply right click the dump file and rename its extension to .src.

Recompile the source file using the .NET Native Image Generator

The Native Image Generator tool (ngen.exe) is an often overlooked and ignored utility for the .NET Framework but is very useful for improving the performance of our .NET applications and avoiding JIT compilation. There are several undocumented options for ngen and we shall use them to port our application. Since SQL Server is not a full .NET application and only uses parts of the .NET Framework (for optimization reasons) we can use the undocumented “/partial” switch which will recompile all necessary IL code sections of the dump file and will translate all other machine code sections into one complete assembly. Since we are also moving to a different Operating System we must also use the undocumented “/architecture:ux64″ switch to target a 64 bit Android environment.

ngen

Once we have created our native Android image of SQL Server there are only a few final steps remaining!

Install FSExplorer on your Kindle

In order to copy our SQL Server Assembly across to our Kindle Fire HD, navigate to the root and create a new folder we need a decent file explorer application. Probably the best I have come across on the Android Operating System is a nice little free app called FSExplorer. Open the Kindle App Store, search for and install FSExplorer.

Move the SQL Server image to your Kindle

Using FSExplorer, navigate to the file system root and create a folder called SQLSrvr where you will stored the Android SQL Server assembly. Copy the recompiled SQL Server image to your Kindle under this folder.

Set SQL Server to auto-load

In order to auto-load SQL Server as a daemon process you should first create an auto loader file under the root calling it startp (if one does not already exist). Make sure the file has the execute permission assigned and within it enter one simple line start /SQLSrvr/sqlsrvr.d.

Don't forget to edit the startp file and copy the SQL assembly!

Don’t forget to edit the startp file and copy the SQL assembly!

After you have made this last change, reboot your Kindle Fire HD and SQL Server should launch successfully.

Enjoy!

Posted in android, humour, linux, sql, SQLServerPedia Syndication | 3 Comments

Upload files to your Azure VM instance

Sometimes some of the simplest tips are the best, and recently I was trying to figure out just how to upload SQL Server 2012 Enterprise/ Developer Edition installation files to my Windows Azure Virtual Machine since my pre-provisioned copy of SQL Server (Evaluation Edition) had expired.

As it turned out I realized pretty quickly that I didn’t need to bother since the VM also comes with a copy of SQL Server 2012 Evaluation Edition media pre-loaded at the root of the C:\ drive. All I had to do therefore was to grab an existing Developer Edition license key and run the Evaluation Edition media setup and step through the Edition Upgrade to “convert” my existing instance.

However, I also knew that there were other utilities and tools (and possibly other installation media) that I would want to bring into my Azure VM and it all felt slightly restrictive. After checking out the Windows Azure Management Dashboard I could not find any options whatsoever to upload files to my VM.
manage_console

Even after a little digging around in the usual search engines, the most useful suggestion I managed to locate was to download and install an FTP server onto the VM itself and play around a little with port settings! Whilst feasible, that level of tinkering was surely ridiculous. After a few moments of frustration I had an idea. Since I was connecting to my Windows Azure VM over RDP (and knowing that my RDP client is able to provide remote access to certain local resources such as the clipboard I decided to try taking the easy route and simply copy and paste an executable after enabling this option. To do so, you simply have to:-

  • Launch your RDP client (mstsc.exe in Windows) and expand the details button to reveal the remote computer access to local resources checkboxes.
  • Ensure that the Clipboard option is checked and connect and log into your Azure VM.
  • Copy the files, folders or ISO from on your local host.
  • Paste into your Azure VM.
remote

Remote Desktop can provide access to local resources!

Whilst I have seen this fail in certain restrictive network configurations, to my delight SUCCESS. I know this operation is hardly rocket science, but sometimes the most simplest things are the hardest to figure out. Now my Azure VMs suddenly seem to be far more useful and I can’t wait to play further!

Posted in azure, cloud, sql, SQLServerPedia Syndication, virtualization, windows | 2 Comments