Enable Backup Compression as Default in SQL Server 2008 R2

Of all the features added to SQL Server over the past few years I was particularly pleased with the addition of backup compression, there have been third-party tools around for a while that have done this (such as Quest’s excellent Litespeed) but third-party tools always add an extra layer of admin and maintenance that as a DBA I could do without. In SQL Server 2008 it was made available for Enterprise licences only but with the launch of SQL Server 2008 R2 backup compression is now available with a Standard license, though in both cases the feature is turned off as a default – so how do you use it?

Well, if you’re making a backup from Management Studio you can specify manually on the Options page of the “Back Up Database” page (right-click on DB >> Tasks >> Backup), like so…

Alternatively, if you’re one of the “Real DBAs don’t use GUIs” crowd you can add the “WITH COMPRESSION” option to the BACKUP command..

BACKUP DATABASE reportserver TO disk = ‘E:\ReportServer.bak’
WITH COMPRESSION

Or, conversely you can specify not to use compression…

BACKUP DATABASE reportserver TO disk = ‘E:\ReportServer_no_compression.bak’
WITH NO_COMPRESSION

But what if you want to use compression but don’t want to have to think about it every time – or more importantly, don’t want your users to have to think about it? To enable backup compression as a server-wide default you will need to use sp_configure…

USE MASTER;
GO
EXEC sp_configure ‘backup compression default’,’1′;
RECONFIGURE WITH OVERRIDE;

Now all you need to do is tell your storage admin that he/she owes you a drink!

1 comment - What do you think?  Posted by ash - 20100828 at 14:19

Categories: Microsoft SQL Server   Tags: , , , , , , ,

The Truth About Information Security…

It’s an old one but I just came across this cartoon from XKCD and it made me laugh…

Be the first to comment - What do you think?  Posted by ash - 20100824 at 08:25

Categories: Security   Tags: , ,

32-Bit ODBC Drivers in Windows Server 2008 R2

Lately I’ve been taking advantage of my MSDN subscription (thanks to Ken Simmons‘ competition last month) and playing with some new technologies, initially experimenting with Windows Server 2008 R2. If you hadn’t heard prior to launch period, Microsoft made 2008 R2 64-bit only – probably the right decision to make but whilst the software industry is still making a transition from 32-bit to 64-bit there are bound to be some niggles here and there.

Being a database guy, one of the issues I noticed right away was that the ODBC Data Source Administrator accessible via Control Panel / Administrative Tools is the 64-bit version and can only be used to setup connections for 64-bit ODBC drivers. Not only was the 64-bit version missing the Postgres driver I had just installed, there were no drivers at all other than SQL Server…

It turns out that there are are two, entirely identical ODBC tools and the one that most of us will end up using initially (unless we’re lucky enough to have an all 64-bit architecture) is kept in the basement that is the c:\Windows folder. The 32-bit ODBC Data Source Administrator can be found by going to the Start Menu, selecting Run and executing c:\Windows\SysWOW64\odbcad32.exe as follows…

Once launched, you’ll see a tool that appears to be identical in every way, except that the ‘missing’ ODBC drivers are now available…

Please note that you can’t run both 32-bit and 64-bit tools at the same time so please make sure you close the 64-bit one first, it’s also worth bearing in mind that if you’re running 32-bit applications they will probably be looking for 32-bit DSNs so even if you can get a 64-bit driver for your data source it doesn’t mean that it’s the right thing to do.

As much as I understand Microsoft’s decision to stop developing 32-bit operating systems, a little bit of a helping hand during the transition period would’ve been nice - perhaps a second shortcut in the Administrative tools folder and the ability to run them simultaneously?  The whole thing seems like a confisuing mess in their own words

The 32-bit version of the ODBC Administrator tool displays 32-bit system DSNs, 32-bit user DSNs, and 64-bit user DSNs. The 64-bit version of the ODBC Administrator tool displays 64-bit system DSNs, 32-bit user DSNs, and 64-bit user DSNs.  

To maintain backward compatibility, no resolution for this problem is currently available… to work around this problem, use the appropriate version of the ODBC Administrator tool.

I’ve made my own shortcuts to the 32-bit version and if you’re like me and constantly diving in and out of ODBC Administrator then you’ll probably want to do the same.

1 comment - What do you think?  Posted by ash - 20100819 at 14:14

Categories: Operating Systems, Windows   Tags: , , , , , , , , ,

BusObj + MySQL – SQLBindParameter State 07001

I recently encountered a strange problem in Business Objects whilst trying to create a derived table against a MySQL database and whilst the query was a complex one it executed without fault in the MySQL Query Browser so I knew that wasn’t the probem.  The error message I encountered was “SQLBindParameter not used for all parameters”…

I tried the same query as a Freehand SQL query in DeskI and received the same error, after banging my head against the problem for about 15 minutes I decided to take my favourite solution – I went for lunch!  On return the solution seemed blindingly obvious, at the very top of my query I’d included a comment but in the comment I’d included a question mark – as soon as I removed the “?” the query ran without a hitch.  I’m not quite sure of the reason behind this but I suspect that one of the Business Objects, ODBC or MySQL layers treats the “?” as a reserved character to indicate a parameterised query – if anyone has the answer i’d be interested to know.

Be the first to comment - What do you think?  Posted by ash - 20100709 at 13:40

Categories: Business Objects, MySQL   Tags: , , , ,

My Favourite SQL Server Features

SQL Server MVP Ken Simmons is offering the chance to win one of three MSDN subscriptions on his blog, I thought I’d join in by writing a post describing my favourite features of SQL Server.

The ‘big ticket’ item for me is SQL Server Integration Services. For those of you stumbling across this post from non-SQL backgrounds SSIS is Microsoft’s ETL tool and has been bundled with the database engine since SQL Server 2005. Essentially SSIS allows you to extract data from (or deliver data to) a range of ODBC, OLE DB, ADO.NET or flat file data sources including Oracle, DB2, MySQL, Excel, CSV files and of course – Microsoft SQL Server. Along the way you can make use of a range of tasks and components that allow you to transform the data and perform operations such as looping, FTP, Email, Lookup Values, Data Mining, Aggregation, Process Dimensions and many many more .  There are alternatives out there but many are prohibitively expensive for the small-medium enterprise (e.g. Informatica, BODI) – that SSIS comes bundled with SQL Server still astonishes me to this day.

As for my favourite ‘little’ features I’d have include:

Linked Servers, a few people give it a bad rap since they can be misused but I’ve made great use of Linked Servers to simply data assurance processes and join data in queries running across both MySQL and Sybase data sources in a single statement.

Copy and Paste Coloured SQL, I’m not sure if it’s just because I’m used to Management Studio but I often struggle to read SQL if it’s not coloured-in. Colouring SQL improves readability and since SQL Server 2005 I’ve enjoyed the ability to copy and paste directly from Management Studio into emails or word documents and retain the coloured keywords, it makes documentation much more interesting.

Common Table Expressions, it took me a while to get into the swing of using CTEs and then for a while I probably over-used them before settling down. They’re often a great way to make statements with nested subqueries much more readable and much more elegant in design but whenever I go back to SQL Server 2000 or MySQL I really miss CTEs.

SQL Server Express, it might be a bit of a cheat to include an edition as a feature but the fact that the core SQL Server database engine is available for free is brilliant and allows a lot more people to try out SQL Server and see the difference between a slick GUI like Management Studio Express vs the MySQL toolset.

Intellisense, I couldn’t resist choosing this as one of the more modern features I love about SQL Server. Once you’ve gotten used to it Intellisense makes trotting out T-SQL statements a breeze and you know what? It just feels cool, albeit in a really geeky sense of the term.

Be the first to comment - What do you think?  Posted by ash - 20100705 at 21:56

Categories: Microsoft SQL Server   Tags: , , , , , ,

Business Objects DeskI: DA0005 “No column or data to fetch”

This is just a quick tip to help people fix an odd error I encountered whilst runing a Freehand SQL query against a MySQL 5 database, I’d used prompted queries against MySQL previously so that wasn’t an issue  – I’m speculating a little but in my case the data provider used subqueries and both the inner and outer query were prompted which is a little unusual. 

The error I received was DA0005 “No column or data to fetch”…

The solution came from the brilliant BOB Forums (original post here), the solution was to edit the odbc.sbo file which on my default installation found in:  

C:\Program Files\Business Objects\BusinessObjects Enterprise 11.5\win32_x86\dataAccess\connectionServer\odbc

You’ll need to add the following in the relevant section, in my case I added it under Generic, Generic ODBC and MySQL 5. 

<Parameter Name="ForceSQLExecute">Always</Parameter>

After closing and restarting DeskI everything was fine, please bear in mind that if you’re running a client/server installation and your Inforview users need to run the report you’ll need to change the settings on the server too.

Be the first to comment - What do you think?  Posted by ash - 20100629 at 14:51

Categories: Business Objects   Tags: , , , ,

Next Page »