bet.ucoz.co.uk

Posts Tagged ‘Migration’

Database Consolidation Considerations June 3rd, 2011

Vinod Kumar

Following the post around Multi-tenancy, there were interesting comments that have come my way to write more on such topics. Well, thanks for reading and dropping a line. In this post, thought will write around another interesting yet very common topic which I get a chance to discuss with customers – Consolidation of Servers. Though these can be driven by very specific business reasons, these do need some thought before implementing.

There are a significant number of manageability, availability, performance, scalability, and political considerations when deciding between dedicated (physical/virtual), instance level, database level or schema level consolidation. Fortunately, most of these are covered in the SQL Server 2008 Consolidation Guidance technical article. The article comes complete with excellent explanations and decision trees, and though it’s primarily focused on the decision between virtualization vs. instance level vs. database level – it is noted in the article that “Other possibilities include further optimizations on an existing approach such as schema-level consolidation. The key decision factors are similar to the higher-level consolidation options mentioned previously, so this paper will focus only on those.”

As mentioned before, business might see Consolidation from (not in any specific order):

  1. High-Availability – Instead of giving redundant multiple HA databases, some times consolidating will give an advantage for all the applications on a better server with a common HA option (like clustering).
  2. Centralized Management – Customers look at this as an opportunity to consolidate all the departmental applications and more so consolidate the DBAs inside their organization.
  3. Cost Saving – This is most likely the first thing that business sees as an opportunity. Ultimately, they want to look at maximizing the utilization of the hardware they have bought or more so get one beefy server to manage 10s of applications database away from outdated hardwares.
  4. Risk management – As discussed on above, centralization means it also standardizes the way DB code is developed, managed, deployed and maintained. Also it becomes easier for servicing, implementing processes and automated system administration.

Other Consolidation Considerations

Well, all the above reasons are valid, there are more that are missed between the lines.

  1. Operational Cost – Consolidation on newer hardware means reduced servers and power savings can also be achieved. And moving virtual also means you are saving on hosting costs.
  2. Increased uptime – Server consolidation makes it more economic to provide high-availability configurations and dedicated support staff. Organizations also benefit from implementing better storage management and service continuity solutions.
  3. Predictable Performance – Moving to a more standardized systems means we can assure a more predictable performance and can behind the scenes implement isolation of resources per application and a DBA can go ahead and implement compression like techniques without change in application code.
  4. Integration Benefits - A consolidated platform provides for easier, consistent and cheaper, systems integration, which improves data consistency and reduces the complexity of tasks such as extract, transform, and load (ETL) operations across systems.

Technical Considerations

For code already written, migrating to an alternative solution than was originally designed may require rework by developers – i.e. if they’ve already written their code in database A to access database B objects with 3-part name identifiers, they would have to make accommodating changes. Additionally, any database users with a database-wide role (db_datareader, db_ddladmin, etc) that are consolidation candidates might have to be changed.

Though schema consolidation with a single database is nice for logical groupings of data that benefit from being kept in synch [especially during a recovery] or must maintain referential integrity, the thought of combining unrelated entities raises all kinds of management and political questions.

Unrelated applications might have differing availability, maintenance, and isolation requirements – and combining them at a database level complicates this. And if these are financially sensitive data then the process of auditing or tracking becomes even more harder than ever.

Finally, It is great to collapse multiple databases from applications, but if these applications are in-house applications you are good. If these were third party applications – then application compatibility needs to be checked. Certifying the application to Versions of database, x86 Vs x64 architecture, version of the OS etc are all extra activities to be handled – not to mention on dependency services.

Misc Considerations

Well, Planning is the name of the game. Loved to see this hidden somewhere in documentation – a Checklist. Worth a read and consideration, though this is not complete – you will need to create one for your infrastructure needs.

But there are tons of other things that also come to mind -

Special Security context of databases
Limitations or dependencies that prevent consolidation (Agent jobs, Maintenance Plans, SQLMail, ETL or others)
Third party add-on dependency for application
OLTP VS OLAP features and frequency of use
Dependencies of Server / Instance names (hard coded inside application)
How many databases for a single app and proximity of all the dependent DBs
Data growth rate, Data Retention Policies followed by Archival
Backup windows and Special Backup technologies
Peak usage / Low usage time windows of each server
Replication frequency, duration, and volume
Specific Connectivity requirements (Protocols, SSL and others)
Internet / Public Access vs. Internal only
SLA’s to business units for uptime

In the 60 page whitepaper on Consolidation Using SQL Server 2008, the option to collapse multiple databases into a single database [via multiple schema management] is essentially written off citing challenges with security, object naming conflicts, performance issues, etc. It leaves off with an ominous warning that schema-level consolidation should be “used carefully” – but I’d just avoid it all-together for unrelated applications. And you have more dope above on why I say so.

HomePage for SQL Server Consolidation and Virtualization

If you did read it this far, feel free to drop a comment with suggestions if any. Obviously, your experience are also unique and valuable.

Continue reading...


 

My Blog New home December 31st, 2010

Vinod Kumar

Welcome back to my new Blog space (Vinod Kumar)

WHY: If you are reading this post, you have surely landed into my new blog space. Yes, I did move away from my old location at SQLXML. Interestingly, the reasons were simple – I was the only person blogging on that space and I had to finally move away because even Bryant had moved away from that space to his very own domain.

With so much happening on the blog space, there is another change in the work I will be doing inside Microsoft from mid-Jan 2011. More about that in the next 15-20 days when things become clear and concrete. I thought with so many changes around, this change will also be a good thing to initiate.

WHERE: Least assured, you can be confident that I will find more time to blog, share and be active on this blog space. My domain of ExtremeExperts has been around for quite sometime and in some forms has been my Identity also since 2003. So I thought of going ahead with a sub-domain for my blogs. Makes it easy for my readers to remember just one Identity to reach me.reverse-migration

WHEN: Yes, there will changes on the blog from skins, plug-ins, format etc in the coming weeks as I get going with the tweaking process before I lock on something. I surely request your kind patience while the mayhem happens on my blog.

There are still some old linking on few posts which I plan to somehow change slowly but surely as and when I get hold of them. So keep sending those broken links to me and I will update them …

Yes, I am on WP hosting now guess quite a lot of you have also used the same. So are there interesting plugins I need to take a look at? Please feel free to recommend and give pointers. Will want to try and lock on things as fast as possible.

TODO: Please update all your bookmarks to point to this new location. Also update all your RSS / Atom feeds to this new location.

Continue reading...


 

SSIS–Excel Connection Manager Error November 29th, 2010

Vinod Kumar

Yesterday, I was playing with SSIS on my host machine and had bumped into an interesting error:

[Load Promotion Data [1]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC00F9304.  There may be error messages posted before this with more information on why the AcquireConnection method call failed.

[SSIS.Pipeline] Error: component "Load Promotion Data" (1) failed validation and returned error code 0xC020801C.

[Connection manager "Excel Connection Manager"] Error: SSIS Error Code DTS_E_OLEDB_EXCEL_NOT_SUPPORTED: The Excel Connection Manager is not supported in the 64-bit version of SSIS, as no OLE DB provider is available.

Now this looked interesting because I was on a x64 bit OS, x64 bit on SQL Server but had a x86 (32 bit) Office 2010 installed when I was using my Excel Data Source. These errors were taken as-is from the “Execution Result” tab directly. The errors give away some detail that this combo is the problem. But fundamentally various search yielded me into places which stated I need to run SSIS in a x86 mode. And this is well hidden inside the Project –> Properties tab –> Configuration Properties –> Debugging menu.

image

Just turn the “Run64BitRuntime” option to “False”. And go ahead with your build !!! This just solved my problem.

Continue reading...


 

Denali–DTS Support November 26th, 2010

Vinod Kumar

It is high time that we started looking at moving our age old DTS packages back into SSIS with full fledged functionality soon. Just checked the SSMS on the CTP1 to figure out that under the Legacy system, this has gone missing.

image

Moving to the new features is always advised and make sure to keep an eye into the support for way old features that you are likely to still have around as you plan for your migration or upgrade. All the best !!! The documentation will surely have a note, but as we start playing around I am getting to know of these one by one …

Continue reading...


 

Denali–Extended Events November 24th, 2010

Vinod Kumar

As I installed Denali (next version of SQL Server) on my machine, I have been trying to figure out what all have been added as part of this CTP1. On playing around with the SQL Server Management Studio I found something very interesting -

image

Now Extended Events in completely integrated inside of SQL Server and this is such a cool thing. Though there is very less we can do with this in this CTP1 release. I just tried to query from the database to figure out that the there are tons of events and actions already there inside the database.

image 

I am sure the subsequent CTP’s we are sure to see more of this xEvents infrastructure. As shown in the figure 1, there is already an Event on System_Health check which has been configured out-of-box. Interesting to play around, you can script it out and check how it has been configured. Remove the grouping and the wealth of events and actions come out …

More on this later, but you get the point. Extended Events are now part of UI and lots of fun things are coming round the corner !!!

Continue reading...


 

RENAME’ing Objects October 14th, 2010

Vinod Kumar

At a number of places people have asked me this simple requirement of how can I go about renaming objects inside SQL Server. This can be to rename a Column, Table or even a Database.

There are multiple scenario’s, like in a bulk uploading table you want to push the data into a staging table and then move data after cleaning. During next upload you don’t want the previous uploaded data but want to have it for reference. In this case, this renaming helps tons.

Sometime there are cases, where you want to change the schema like renaming a column like “Phone” to “Telephone” or “Cell” but don’t want to add another column or get into migration of data. This is a neat way to work around this.

sp_rename [ @objname = ] 'object_name' , 
[ @newname = ] 'new_name' 
[ , [ @objtype = ] 'object_type' ] 
More about this lesser known command can be got from Documentation. 
Note: Use it with utmost care as this involves Schema change directly !!!

Continue reading...


 

NuPack and jQuery Releases October 9th, 2010

Vinod Kumar

clip_image002NuPack is a free, open source package management system for the .NET platform that makes it easy for developers who use Visual Studio 2010 and WebMatrix to incorporate third party libraries into their application during development.  This is the first project of its kind at Microsoft where we are actively taking contributions from the community.

Visit the homepage for NuPack

Scott Hanselman blog post introducing NuPack

Video: Using Windows Azure Storage in WebMatrix via NuPack in 3 minutes

 

clip_image002[5]At Mix 10 in March, Microsoft announced that it was to start contributing code to the jQuery open source project. On Monday MS announced the first "commit" to the project by added jQuery Templates, Data-linking as official plugins to the library and Globalization as a contribution to jQuery UI. This announcement compliments Visual Studio 2010 which provides fantastic support for jQuery out of the box as well as ASP.NET MVC which ships with the library too.

Scott Guthrie’s on Microsoft committing code to jQuery

Web Camps TV Episode on Microsoft contributing to jQuery

Boris Moore on using jQuery Templates

Continue reading...


 

Scalable Shared Databases –SQL Server September 24th, 2010

Vinod Kumar

The scalable shared database feature provides a solution to scale out a read-only reporting database. Using commodity hardware for servers and volumes, multiple SQL Server instances attach to a single copy of the reporting database stored on the Storage Area Network (SAN). This equates to a single copy of the reporting data files, which reduces storage requirements across your environment.

The reporting database must reside on a set of dedicated, read-only volumes whose primary purpose is hosting the database. After the reporting database is built on a set of reporting volumes, the volumes are marked as read-only and mounted to multiple reporting servers. On each reporting server, the reporting database is then attached to an instance of Microsoft SQL Server and becomes available as a scalable shared database. Once established as a scalable shared database, a reporting database can be shared by clients that use different reporting servers. To query the database, a user or application can connect to any server instance to which the database is attached. For a given version of a reporting database, clients on different servers obtain an identical view of the reporting data, making query results consistent across servers.

BenefitsA scalable shared database presents a number of benefits.

  • Introduces workload scale-out of reporting databases that are using commodity servers. A scalable shared database is a cost-effective way of making read-only data stores or data warehouses accessible to multiple-server instances for reporting purposes, such as running queries or using SQL Server 2005 Reporting Services.

  • Provides workload isolation. Each server uses its own memory, CPU, and tempdb database. This prevents a runaway query from monopolizing all resources and affecting other queries. This also benefits reporting environments that make heavy use of work tables and other tempdb objects.

  • Guarantees an identical view of reporting data from all servers. All attached reporting applications use an identical snapshot of the data, which improves consistent reporting across the enterprise. This assumes that all of the server instances are configured identically. For example, all servers would use a single collation.

Only SQL Server Enterprise Edition supports this cost-effective scale-out solution to support your most demanding reporting requirements. The relational engine was added as part of SSD in SQL Server 2005 edition and we extended the support to SQL Server Analysis Services from the 2008 editions.

Highly recommend reading this KB article on SSD implementation details.

Digg This

Continue reading...


 

FAST Recovery with SQL Server September 16th, 2010

Vinod Kumar

Microsoft SQL Server 2005 onwards the Enterprise Edition has an improved hidden feature on availability of databases recovering from a crash or during a database mirroring failover by introducing the fast recovery feature. image

Fast recovery makes the database available during the undo phase. SQL Server crash recovery and database mirror failover include multiple phases. The first phase involves applying logged transactions to roll forward the data. This is known as the redo phase. After the redo phase has rolled forward all the log transactions, a database typically contains uncommitted changes made by transactions. The recovery process then rolls back all uncommitted transactions in the undo phase. In this case, SQL Server allows users to access the database during this undo phase. This makes the DB available faster than normal … This is very critical for availability SLA’s of databases within the enterprises.

More on the recovery of databases and the stages are outlined over MSDN SQL Server BOL. Feel free to read the complete process from documentation.

Fast recovery is possible because transactions that were uncommitted when the crash or failover occurred reacquire whatever locks they held before the crash or failover. While these transactions are being rolled back, their locks protect them from interference by users. If you recollect this is based on the snapshot capability that was introduced with the SQL 2005 and above Enterprise editions.

Biggest benefits of Fast recovery lets users access the database during the undo phase, reducing the time that a database is unavailable during these already time-sensitive activities. Earlier versions of SQL Server and SQL Server 2005 Standard Edition do not allow access to the database until completion of the undo phase.

Continue reading...


 

LOG Backup with SQL Server? September 14th, 2010

Vinod Kumar
Backing up the transaction log is a very important part of a disaster recovery plan to be able to restore the database to the closest point to a point of failure.image This is critical to the business and most importantly part of any applications deployment plan. The term log backup chain is often used to describe the sequence of log backups that can be restored in sequence after restoring a SQL Server database backup. A simple database cannot have its logged backup and therefore cannot have a log backup chain. A log backup chain is broken when some operation invalidates the ability to backup the log and restore it after the previous. Examples of operations that breakup the log backup chain are changing the recovery model of a database from FULL to SIMPLE or executing the BACKUP LOG WITH TRUNCATE_ONLY or NO_LOG command.
It is also important to remember that the size of a transaction log backup may be larger than expected if the database recovery model is bulk-logged. This is because the transaction log backup will contain a record of all bulk operations since the last full or differential database backup.
BACKUP LOG WITH NORECOVERY
This option is used to backup the current tail of the log and leave the database is a state where transaction logs from a standby server could be restored to bring the database back into a consistent state.
Consider this scenario. You have a primary database but are deploying a standby server where you copy over and constantly restore logs. Now for some reason the primary server has a problem and you want to failover (not cluster failover) and use the standby server as the new primary database server. If the primary server database is still available, simply use BACKUP LOG WITH NO_RECOVERY to backup the current tail of the log and apply to the standby server to bring it to a consistent state and the appear to be the same database as on the primary.
Now you start using the standby server and start backup up logs on that database. Now you want to switch back to the primary. Since you used WITH NO_RECOVERY you don’t need to restore a full database backup from the standby server. Simply take any log backups produced on the standby and restore them on the primary.
There are so many interesting hidden behaviors as a DBA you might want to explore and understand. Hope this blog is demystifying some of these.

Continue reading...