Tag: sql server

  • Quickly Copy Data

    How quickly can you copy data from one place to another?
    How quickly can you copy data from one place to another?

    There’s no magic solution for many of the problems we face in SQL Server. Whether we are trying to maintain concurrency under high write loads, restore databases quicker, or ensure extremely high availability we need to make trade-offs. Sometimes those tradeoffs are frustrating, and people look to other solutions like NoSQL, not realizing that they are just making different trade-offs.

    I see the frustrations and comments constantly on the SQLServerCentral forums, and one recent discussion was no exception. In this particular debate, a user was frustrated by the requirement to copy backup files across the Internet to another location. The transfers were taking too long and the poster were trying to find some magic way of decreasing the transfer time. Increasing the bandwidth, the simplest solution, wasn’t an option, and that usually isn’t easy to do in a corporate environment. The poster seemed to think there had to be some magic way of reducing the time it takes to copy large backup files, and there isn’t any magic solution. The things that help reduce transfer time are often the common things we think of.

    Compression is an obvious solution. There are numerous free programs to compress files and even software that will compress the backups as they occur. There are techniques in Windows for speeding up copies, though many are Windows version dependent. Beware, however, since copies from your server might cause you memory issues. However there might be other, more creative solutions that people come up with.

    Imagine that you track the transfers, keeping meta data about the process. Perhaps you can find a way to send less data overall the next time. In some sense, this is the idea behind log shipping. If you only send the changes (the transaction log backup), you might save a tremendous amount of time and resources. That assumes, of course, that the changes in a period of time contain less data than the overall database. That might not be the case in some  workloads.

    There are other services that might help. Imagine that you back up to the cloud, either because you use a toolfeature, or service if your application exists in the cloud. Spinning up a new instance with a copy of that data in the cloud might eliminate the need for transfers completely if the other location can just access the data in the cloud.

    I’m sure some of you have other ideas, and I’m sure many of us would like to hear what creative ways you might have for moving data between locations.

    Steve Jones


    The Voice of the DBA Podcast

    No podcasts today due to some personal issues. The podcasts should return tomorrow.

  • Fear Fear

    Are you too fearful or just paranoid enough?
    Are you too fearful or just paranoid enough?

    I’m a conservative DBA. I get nervous when backups aren’t running, code isn’t in source control, and developers have access to production systems. I’ve had too many late night pages and weekend phone calls, not to mention many extra hours spent in the office from changes to systems that didn’t go well. That latter item leads me to limit the number of changes I make to systems whenever I can, including avoiding applying Cumulative Updates to SQL Server.

    When I read an editorial from Glenn Berry, I had to stop and think of whether or not I had a healthy respect for the problems that can occur from change, or if I was being overly conservative (or fearful). Glenn makes a good point that so many people do not upgrade or change their drivers, firmware, or other software. People don’t patch their SQL Servers, even with Service Packs. I’m sure some of that is fear, but some of it is neglect as well.

    For me the decision usually comes down to examining the reward/risk ratio, trying to understand if improvements are balanced by the risk of downtime. I do value stability above new features, mostly because if problems do occur, I will be the person fixing them. That doesn’t mean I avoid all changes. I think Service Packs need to be installed, though not necessarily the first month. I’ve also come to embrace some of the continuous integration (CI) and continuous deployment (CD) ideas as ways to both reduce a software inventory as well as hold developers to a higher quality standard. However if you want to deploy (and perhaps patch) in a continuous deployment environment, then you should ensure that your CI process performs strong checks and make sure your developers are holding themselves to a high level of quality.

    We change the way we work, and the tools we use in technology often. Change is a concept we embrace, and we should since the ways in which our systems work are regularly changing. Bugs are patched, new techniques and tools are developed that should make us more efficient and productive. Those don’t always work, and we should be wary, but we should also not fear change. We should evaluate each new possibility with the attitude that our decision to move forward “depends.” It depends on the ease with which we can integrate something or apply a change, and the ease with which we can roll back our changes if they do not perform as expected. It also takes practice to ensure that all those things are easy.

    Steve Jones


    The Voice of the DBA Podcasts

    We publish three versions of the podcast each day for you to enjoy.

  • Exploring a Database in Azure

    After creating my Azure account, I wasn’t sure where to go next. Fortunately I had an immediate project that occupied my attention: a public Adventureworks database.

    As we noted, Red Gate and SQLServerCentral agreed to host the database and cover costs. Once Jamie Thomson transferred the database to my subscription, which didn’t seem too hard, although slightly confusing, it showed up in my list of objects.

    azure_i

    I drilled down to the sql databases to ensure this was the only object there, and it was.

    azure_j

    I wasn’t sure what I could do, so I clicked on the database. I do tend to be an RTFM guy at the beginning, but I was curious how easy they’ve made things. This is what I saw:

    azure_k

    It’s a good list of things, although since I have SSDT installed, I didn’t need the first item. I guess if you have SSDT installed you would know it, and the link is handy. The interesting thing for me was the “Server” string at the bottom of the panel.

    I wonder if it works.

    Jamie had given me the admin name and password, and I plugged this into Management Studio, along with the connection string.

    azure_l

    Sure enough, it connected, and changing to the AdventureWorks2012 database, I could query the objects.

    azure_m

    I decided to test Object Explorer as well, and that was interesting. I had a very cut down version of what I normally see for a SQL Server instance.

    azure_n

    Most of the “instance” level stuff was gone. I could see the master database, and my own database, but no others.

    Since this was a new instance, one of the first things I decided to do was create my own login account. I right clicked “Logins” and selected “New Login”. I go this:

    azure_o

    A template for a script. That’s interesting. No GUI version of the login creation dialog. I used CTRL+Shift+M to fill in the template stuff.

    azure_p

    That’s not my password, but I did choose a nice, long one. I executed the script to create a login and then went to add a user. Once again, I got a script from the GUI.

    azure_q

    I changed this and created my user to map to my login.

    This let me log into the system, and set myself as a db_owner. However I wasn’t an administrator. That’s for another post.

  • Helping MS Help Us

    Vote today! See if we can help MS help us.
    Vote today! See if we can help MS help us.

    I think SQL Server is a fantastic product. I’ve been using the platform over 20 years, across 8+ versions and 2 operating systems. It’s provided me with a great career, and one I’ve enjoyed. However the software isn’t perfect, with numerous bugs and holes. The Connect system was introduced years ago as a way for people to submit bugs and suggestions, vote on them, and provide feedback for Microsoft.

    Does it work? I think Connect is broken, and while I sympathize with the volume of suggestions that Microsoft must deal with, I’d hope that they actually listen, consider, and act on something other than documentation bugs. Those seem to be the only ones acted on lately.

    Most of the items submitted are sent in by individuals, and they get one or two votes, but that’s usually from the submitter’s friends. Many of the items are, IMHO, not important enough to submit to Connect. My guess is they cause plenty of people in Microsoft to view Connect as a slop bucket where most users toss every complaint they have about the product. I sometimes wonder if items are submitted by users before they even spend a few minutes on a search engine trying to resolve their problem.

    However there are some great suggestions, and this is one. It’s asking for a new virtual table: Errors. This is in addition to the inserted and deleted tables. It’s not just that I think so, but there are over 300 people that have voted it up. It’s the number 6 highest voted item on Connect. Users see value in this, especially data warehousing users. If you read the comments, this thread, or this blog, you might agree. If so, then I’d encourage you to vote it up. If not, vote it down. Either way, leave a comment on why this would help (or not help) your work. I don’t know if this will change Microsoft’s mind on the issue, but it would be interesting to see if they respond with anything other than there are “resource constraints” preventing this from being implemented.

    While you are at it, look over the list of top voted on items. There are some good ones, like fixing this errorcreate or replace, and enhancing the OVER clause. If any of them would make your job easier, let Microsoft know. They always say that customer problems and situations give them reasons to enhance the product or fix issues. Let’s give them a chance to actually prove that statement is true. Participate in our experiment and vote today.

    Steve Jones


    The Voice of the DBA Podcasts

    We publish three versions of the podcast each day for you to enjoy.