The slide deck only has a couple of slides in it, so my it self it isn’t all that interesting. The recording has taken via Net Meeting. It’s the first time I’ve recorded something via Net Meeting directly, so if it isn’t great sorry. I’ll try better next time.
The recording works in IE, I don’t think Firefox likes the format.
In this presentation we’ll be looking into the pros and cons of moving SQL Servers into a virtual server environment. Specifically we’ll be looking into when it’s a good idea and when it’s probably not a good idea. Like all problems in the database world there are no hard set answers as to if virtualization is a good idea, but there are some times when virtualizing a SQL Server is a good idea, and can save you some money. There are some other times when you will be shooting yourself in the foot and shouldn’t. We’ll be focusing on when how to make this decision, and how to gather the metrics that you need in order to come to this decision.
Normally when I give this presentation it’s live, and this is the first time that I’ll be giving the presentation via a web cast, so some with your questions ready.During the presentation I’ll be focusing on VMware’s vSphere and Hyper-V as the virtualization platforms. As I’m more familiar with VMware’s platforms it will be a little VMware heavy, but I’ll cover as much Hyper-V as I know.
However, it’s your class and your assignment. At least attempt to do the work before hitting up the internet for the answer.
I ran across one recently. The entire question posted was “give ip address of 50 websites”. My answer was way more clear, and just about as concise. “Use the nslookup command line tool to find the IP addresses.” Now I’m sure that the person who posted the question (assuming that they see the answer at all before the question is deleted) will be very annoyed that I didn’t do there apparently extremely hard homework for them.
Other jems that spring to mine. “I need to write a program to do x. Please post the full code.” Or maybe “I need an application written in VB.Net with 3 buttons, 2 text boxes and puts the values in the boxes together when the buttons are pushed. Please post code.” And these are actual questions that people are posting!
The forums are there to help you get past a road block. Not to do your homework. You are taking a programming class so that you can be a programmer after school. If you don’t learn these basics (and since you are asking people to do your entire homework assignment I assume that you haven’t learn the material) you aren’t going to ever figure out how to to do the cool video game programming that you want to do. You’ll never get a job, and if you do you sure won’t keep it for very long.
Then someone like me with years of experience will be sitting across from the table in my ripped jeans, and purple hair (yes I changed the color recently) firing you because YOU are the one that can’t pull his weight. Even though I’m the one that looks like a freak. And you know why I’m the one firing you, because I know what the hell I’m talking about, and you can’t figure out how to use the nslookup command in a command line window (pretty much works on every OS here).
Now, how could these questions have been posted so I didn’t rip you a new one when I posted my answer?
Old Question: “give ip address of 50 websites”
Better Question: “How do I find the IP address of a website?”
Old Question: “I need to write a program to do x. Please post the full code.”
Better Question: “I’m writing a program to do x, but I can’t figure out where to start. I’ve got y written so far. Where should I go from here.”
Old Question “I need an application written in VB.Net with 3 buttons, 2 text boxes and puts the values in the boxes together when the buttons are pushed. Please post code.”
Better Question: “I’m writing a program which puts values in a text box together. I’m not sure the best way to do this in VB.NET. Can you provide some pointers?”
You’ll get some actually learning done, and you’ll get some pointers which you can then take to class, then to a job.
Now if you don’t have any desire to learn the material in the class, drop the damn class and take a class in something you are interested in. If you have no desire to program software for a living then don’t take a computer programming class. If you don’t like doing it you won’t end up being very good at it, and you won’t make much money at it. Which is probably why you decided to take the class in the first place, right?
Sorry about that, apparently I needed a lot more sleep (or a lot more coffee) when I wrote that post. I’ve corrected yesterday’s post so that it’s actually accurate now.
When you run the ALTER DATABASE command without a termination clause (ROLLBACK AFTER, ROLLBACK IMMEDIATE, NO_WAIT) the ALTER DATABASE command will run until the command completes, or until if command is terminated.
The ROLLBACK AFTER command tells the SQL Server to cancel any pending transactions and rollback those transactions after N number of seconds.
ALTER DATABASE YourDatabase ... WITH ROLLBACK AFTER 30
The ROLLBACK IMMEDIATE command tells the SQL Server that if it can’t complete the command right away, then the other pending transactions should be rolled back.
The NO_WAIT command has the opposite effect as ROLLBACK IMMEDIATE. If the ALTER DATABASE transaction can’t be completed then that transaction is terminated.
ALTER DATABASE YourDatabase ... WITH NO_WAIT
Hopefully this helps clear up some of the confusion.
So if you deny a user access to a bunch of tables, then you put that user into the db_datareader fixed database role that user will have select rights to all the tables in the database, including all the tables that the user has been denied access to.
You can see this yourself by creating a table, with a date field, then stuff some records into that table.
CREATE TABLE sample_table (id INT IDENTITY(1,1) PRIMARY KEY, dt DATETIME) go CREATE INDEX ix_sample_table ON dbo.sample_table (dt) go INSERT INTO sample_table (dt) SELECT '1/1/2000 15:00:00' UNION SELECT '1/2/2000 12:00:00' UNION SELECT '1/3/2000 08:00:00' go
You can now query the dt column and use the convert function. When you view the execution plan you’ll see that an index scan is being used.
SELECT id, dt FROM sample_table WHERE CONVERT(varchar(10), dt, 101) = '01/01/2000'
But it you use the BETWEEN operator instead of the = operator you’ll see the engine using an index seek instead of the index scan.
SELECT id, dt FROM sample_table WHERE dt BETWEEN '01/01/2000' AND '01/02/2000'
Now the same thing applies when using other functions to the datetime column in the table. For example if you were to have a system where people need to search based on the timezone where the data is stored in UTC time, but searching needs to happen based on the users time zone.
The easiest way to do this would be to put a dateadd function around the dt field. However even when using the BETWEEN operator you still use an index scan, instead of the seek. In this case I’m searching against the pacific timezone.
SELECT id, dt FROM sample_table WHERE dateadd(mi, -420, dt) BETWEEN '01/01/2000' AND '01/02/2000'
Now, if you switch the -420 to 420, and put the DATEADD function around the dates in the BETWEEN operator the index seek will be preserved. The query looks a little strange, but that’s ok. It’s the end result that we are looking for here.
SELECT id, dt FROM sample_table WHERE dt BETWEEN dateadd(mi, 420, '01/01/2000') AND dateadd(mi, 420, '01/02/2000')
Now if you have the UtcOffset that you want to use stored in another table such as an Account table. We’ll recreate the sample_table to go with this.
CREATE TABLE sample_table (id INT IDENTITY(1,1) PRIMARY KEY, dt DATETIME, AccountId int) CREATE TABLE Account (AccountId INT PRIMARY KEY, UtcOffset INT) go CREATE INDEX ix_sample_table ON dbo.sample_table (dt) INCLUDE (AccountId) go INSERT INTO sample_table (dt, AccountId) SELECT '1/1/2000 15:00:00', 1 UNION SELECT '1/2/2000 12:00:00', 2 UNION SELECT '1/3/2000 08:00:00', 1 INSERT INTO Account SELECT 1, -420 UNION SELECT 2, -300
In order to make this work, you have to take the UtcOffset value *-1 so that the date is adjusted in the correct direction to make the query work.
SELECT id, dt FROM sample_table JOIN Account on sample_table.AccountId = Account.AccountId WHERE dt BETWEEN dateadd(mi, Account.UtcOffset*-1, '01/01/2000') AND dateadd(mi, Account.UtcOffset*-1, '01/02/2000')
(Ignore the Clustered Index Scan on the Account table, correcting that isn’t the goal of this post.
Hopefully you find this technique useful.
The Virtual Center server took a little bit to get upgraded since there are so many components which need to be upgraded on the machine. Once they were all upgraded upgrading the ESX hosts was a piece of cake.
When you install the upgraded client tools on your machine the last step asks you if you’d like to install the host upgrade tool. This upgrade tool is fantastic.
You tell it which host you want to upgrade, and you point it to the vSphere ISO that you want to install on the host, in my case VMware ESX 4.0. After that you answer a couple of questions about how big you want the host’s volume to be where it installs, and that’s it. The tool uploads the ISO to the host, and when the upload is complete it begins installing the OS automatically. In the event of a failure the host will rollback the upgrade and continue to be running the prior OS.
One massive change between VI3 (ESX 3.x) and vSphere 4.0 is the licensing changes between the two. With VI3 you download a license from from VMware and load that License file into a licensing server on the Virtual Center host. With vSphere you add license keys to the Licensing section within the vCenter Server via the vCenter client.
I’d have to say, the entire process was very easy. It took me about 2 hours per host to upgrade (there was a slow 10Mbit WAN connection between the Hosts and the client machine I was running the upgrade from.
So far I’ve upgraded my standalone ESX machines which handle the non-customer facing machines at the office (domain controllers, file servers, dev and QA app servers, etc). The only task I have left is to upgrade the production customer facing ESX cluster which that handle our websites, DNS servers, etc.
Hopefully the cluster will upgrade just as easily as the standalone hosts.
The information page is the same. There’s no registration form on it just yet. that is supposed to go up on Monday for the new date and time. I’ll be sure to put up a new post then.