May 2007 - Posts

 i can't find the video, but these guys demoed this technology about 2 years ago at some tech conference. i thought it was pretty amazing and i didn't realize that ms had picked it up and run with it. techcrunch has a cool video of it all now that it's released.


the video will say it all. check it out.

http://www.techcrunch.com/2007/05/29/microsoft-announces-surface-computer/

i knew they were releasing 'something' tonight at midnight that was supposed to be some awesome new technology. i fell asleep but, as i'm sure you can see by the early timestamp i was actually still thinking about it in my sleep and it woke me up at like 5am with no clock because i had to know man.

this is awesome. minority report is here. =)

as a matter of fact, here's the video that i saw. it was last year in feb. i remember forwarding this to a bunch of my friends because i thought it was so incredibly amazing. this idea should change the world when it trickles down.

www.youtube.com/v/PLhMVNdplJc

multi-touch computing is now ms surface computing and way cooler.


this is a repost of something i wrote a long time ago. there are already stored procs to view table sizes on a specific table. this was just something that i wrote so that i could create a list of all of the tables in the current database and change the sort orders if i wanted. it also gave me the ability to filter based on table sizes if i needed to only see tables in a certain range.

sorry the code formatting is lame. blame the new version of community server. 

 

-- view all table sizes

-- author: royashbrook - royashbrook@yahoo.com

-- april 2005

 

select

      so.id as [OBJECT_ID],

      so.name as [OBJECT_NAME],

      coalesce(j_rows.rows,0) as [ROWCOUNT],

      coalesce(j_ru.sum_reserved,0) * cast(m.low as dec) / 1024 as [RESERVED (KB)],

      d.data * cast(m.low as dec) / 1024 as [DATA (KB)],

      (coalesce(j_ru.sum_used,0) - d.data) * cast(m.low as dec) / 1024 as [INDEX (KB)],

      (coalesce(j_ru.sum_reserved,0) - coalesce(j_ru.sum_used,0)) * cast(m.low as dec) / 1024 as [UNUSED (KB)]

from

      sysobjects so

      join master.dbo.spt_values m

            on m.number = 1 and m.type = 'E'

      -- rows

      left join sysindexes j_rows

            on j_rows.indid < 2 and j_rows.id = so.id

      -- reserved: sum(reserved) where indid in (0, 1, 255)

      -- index: sum(used) where indid in (0, 1, 255) - data

      -- unused: sum(reserved) - sum(used) where indid in (0, 1, 255)

      left join

      (

            select

                  id

                  , sum(reserved) as sum_reserved

                  , sum(used) as sum_used

            from

                  sysindexes

            where

                  indid in (0, 1, 255)

            group by

                  id

      ) j_ru

            on j_ru.id = so.id

      -- data: sum(dpages) where indid < 2

      -- + sum(used) where indid = 255 (text)

      left join

      (

            select

                  j_dpages.id

                  , coalesce(j_dpages._sum,0) +

                        coalesce(j_used._sum,0) [data]

            from

                  (

                        select

                              id

                              , sum(dpages) [_sum]

                        from

                              sysindexes

                        where

                              indid < 2

                        group by

                        id

                  ) j_dpages

                  left join

                  (

                        select

                              id

                              , sum(used) [_sum]

                        from

                              sysindexes

                        where

                              indid = 255

                        group by

                              id

                  ) j_used

                  on j_used.id = j_dpages.id

            ) d

            on d.id = so.id

where

      objectproperty(so.id, N'IsUserTable') = 1

order by

      [DATA (KB)] DESC, [ROWCOUNT] ASC

I sent out this link to some people just to peruse as an example of someone using SQL2005 as solution stack.

I received the following question back from someone.

What is a one-star schema?  It is mentioned in the White Paper.


"What, indeed?", I said. I replied that it was a commonly used design schema used in data analysis and that I would have to refresh my memory so I could provide a much better answer.  Well, I have refreshed my memory and I thought I'd post my reply here.

Basically, a star schema is a way of organizing data in an analysis, or OLAP style database, It is a relational model. You have a fact table in the middle and dimension tables that all relate to it, thus creating a star. =) But, does everyone know what that means? What is a fact table? A dimension table? Well, let's define those as well.

A fact table is a conceptual type of table used in data analysis. Fact tables contain facts about your data that you want to analyze. If it were a sale, you would have records in your fact table that said something like 'I sold X product from X store on X date. Dimension tables may contain details about the dimensions. Perhaps a store dimension. Where is the store? How many employees does it have? What kind of store is it? Date/Time is always a popular dimension. Is it a holiday? What quarter? Which budget year? Is that sale on a Weekday? Of course, in this example, we have our product dimension. What kind of product? What color? How big? etc, etc, ad infinitum.

So, armed with that knowledge, perhaps it gives you a better understanding of what a star schema is. Here are some links I got on google that will give you some additional information:

http://www.bespoke.bm/pages/star.html (This is the best one I think. I found it while I was writing this one. =P)

http://perso.orange.fr/bernard.lupin/english/glossary.htm

http://www.itu.dk/people/pagh/DBS05/OLAP-MDM-2s.pdf

http://www.pcmag.com/encyclopedia_term/0,2542,t=star+schema&i=52005,00.asp

http://www.localcubetask.com/session1.htm

http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.dwe.tutorial.doc/tutolaplescreatemd.htm

http://en.wikipedia.org/wiki/Fact_table (Check the other articles linked and explore the Data Warehousing keyword as well)

i've received this question from many developers who either weren't sysadmins ever or just forgot. some, perhaps, are just lazy and don't want to look it up or remember it. it may be that others still just want to see if *i* remember. =P

the command line to view what nt groups you are in is, literally:

 net user %username% /domain

 

include the % symbols and it will use the environment variable for your username.

 

so i came across this article today in my surfing. it's written by Nik Cubrilovic who has a pretty cool blog and it's about his initial experience switching to vista from os x. The experience he records is extremely positive. It makes me want to try using my laptop at home more. For a little background, I have a work laptop that has windows xp professional on it. We use a lot of encryption and protection etc at work so sometimes it seems slow, but overall it's very responsive and usable. It's a IBM Z61t with 2GB of RAM and a 100GB 7200 RPM drive. Computer properties says I have a t2400 @ 1.83GHz. I have a Dell D810 that has (I think) the max specs for that machine short of 4gb of RAM which I think it can hold. I only have 2gb, but i have the 1920 x whatever display. I don't remember what video card I have, but .... well quite frankly Vista seems to run really slow. I also do not really like the new media center. It looks really cool, but I have lag sometimes running DVDs and I never had that before I upgraded. Granted I was using some other DVD player, but still.....

His positive thoughts seem to be at odds with many other reviews out there. Most notably this recent review from my FAV hardware site, the big Cool, HardOCP!

It seems that it's a pretty good upgrade if you are a more normal user, perhaps? That generalization doesn't seem to fit either. I have actually been wanting to get a macbook pro for a while now. it's been something i've been saving for and hoping to use for my personal machine and also as my rails dev box instead of using windows. of course, with so many .net/ruby crossovers coming out now, perhaps i should just keep developing as i have been on windows and wait. os x is pretty though. =P and, yes, vista is pretty too, but it's not the same.  

 getting a mac would probably help with my desires to do some mono development.

 

This tip is the pimpness. There are really no downsides and it can help a lot if you are having heavy contention with your tempdb.

 

http://support.microsoft.com/kb/328551/en-us

 

here’s a summary of what you do:

 

Increase the number of tempdb data files to be at least equal to the number of processors. Also, create the files with equal sizing.

 

That’s pretty much it. Definitely read the article though as it has a ton of great technical information about why this works and what is going on in a situation where something like this is needed.

 

 

In general I would probably say if you *need* this fix, you really *need* to revisit why you are running a complete piece of crap application in a production environment, but that’s just me. =D

I’m fixing to start upgrading some servers to SP2. Here’s some reading material if you are in the same boat.

 

Nice Summary(has the links below as well):

Microsoft's What's New

Microsoft's ReadMe

 

A search on Google or on Microsoft’s SQL forums will reveal plenty of single point errors. I definitely recommend installing in a dev or test environment first and testing until you can’t test anymore. =)

 Free Enterprise Service Bus based in .NET. If you are looking at implementing an ESB and you have the option of going the open source route, give it a look.

check out the jump start guide for some more details.
 

just saw this on http://blogs.msdn.com/queryoptteam/archive/2006/06/01/613516.aspx which i found on mark garner's awesome blog.

v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} st1\:*{behavior:url(#default#ieooui) }

So I ran into a situation today where I needed to rename a database. Unfortunately, unknown to me, I had that database setup as my default database. Although I had SA role in sql, as soon as I took the database offline to rename it, I couldn’t do anything. Unfortunately, I didn’t notice the problem right away because, I wasn’t really doing anything else on the box at the time except running some other queries and those were already logged in to other databases. After about 15 minutes I went to get a drink and when I came back it was STILL not done. So, I started to poke around and noticed I can’t get to anything. I was getting access denied to db1 (my default) when I clicked on db2 and db3. “Crud.”, Says I. What do you do?

 

Well first I examined my method of access. I was a member of several groups that had this default db set. This default db setting was not something that *should* be set, but it was so oh well. I think executed a create login statement for myself giving myself an account with a default db of master to override the other settings. Here’s a sample:

 

USE [master]

GO

CREATE LOGIN [DOMAIN\ROY] FROM WINDOWS WITH DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english]

GO

 

If you already have a login, just issue an alter it. Checkout BOL for some guidance on this. So I take a look at the sql security and see that some of the groups I’m getting rights from (all windows auth). But what if you didn’t already have a window open? Ah, have no fear my friend. You can always use osql or some program with a custom connection string etc. SQL Management Studio hides the option a little bit from you. When you connect to something via connect button or modifying the connection settings of an existing window, you get the nice little login dialog box. If you click on options, you can change the database at the top.

 

 

Oh Nooooooo!!! I can’t see any of the databases because I don’t have rights to connect to the server! That’s fine, just put in master or some other db you have rights to. Simple. Now I’m in. The problem is that my ‘take offline’ operation is still pending and if you try and look at the db you wanted to take offline, you see that it’s ‘in a state of transition’ and it will not let you look at it. By this time, the server dbas were calling me wanting to know what was up (they got a call from another dba who had the incorrect default db set too) and I filled them in on what was going on. I told them my next plan of action was to kill my spid and then to continue with the rename operation if the db was offline after the spid was killed, or to handle it off hours since the db was taking so long to go offline. They complained at me that they didn’t want app dbas that happened to have sa rights for app optimization purposes (dbcc commands etc) doing real sa work. So I gladly offloaded the ‘work’ of renaming the dbs to them and before I could even finish talking to my boss about what had happened, they had already killed the spid and everything just went back to normal. Pretty cool.

 

So, I say this because I have had issues in the past where I or another person had accidentally removed a db that was their default (or mine in this case =P) and I figured I’d let someone else know what to do.

 

=)

i personally like the file system. it's generally easier on me since i'm normally authoring the jobs and don't have hundreds of packages to manage. if i did have hundreds of packages to manage and i didn't author, i might prefer the server. here are some great blog posts about this subject.

pros and cons of both

mostly pros for file system



As a bonus during my research I came across this blog which appears to detail an experience of trying to continuously integrate a data-mart among other things.

http://mgarner.wordpress.com/2006/08/31/automating-ssis-deployment/

http://mgarner.wordpress.com/2006/09/24/builddb-open-source-tool-for-the-agile-sql2005-database/

http://mgarner.wordpress.com/2006/10/22/ndataunit-unit-testing-tool/ 

so not too long ago, we had a need to monitor the space used by our tempdb. one of the other dbas had sent out a script on how to do it that i imagine he found somewhere. when i finally got around to processing that email i forwarded him the sp_spaceused command. very easy built in proc that will give you this information. run it in the db you are in to see the space used there or use a full path to see another database. eg. anotherdb.dbo.sp_spaceused. very easy. =)

here's a fun forum post about a lot of different ways to get this information. some more complicated then others. if you need a specific format or something, then obviously this won't work, but if you just want to check something in a query window really quick, sp_spaceused is the way to go.

i hesistate to put this under tips n tricks since it's just a sql sp. maybe my tip will be that if you haven't, you should check out the system stored procs. lots of fun stuff there. =) I'd also say checkout the information schemas and the data management views as well. there. three tips for the price of one. =)

I'm sure plenty of you have seen these hanging on peoples walls. They are the pretty little foldout maps from MS that describe stuff. they have them for tons of things and here is a link to the download location for the SQL2005 System Views map.

 http://download.microsoft.com/download/0/d/f/0dfe488e-a335-4480-8a8a-b405e32f4368/SQL2005_Sys_Views.pdf

 

A brief search on the web yielded links to more maps here:

http://www.microsoft.com/downloads/details.aspx?FamilyID=771aeb45-9d27-4d1f-acd1-9b950637d64e&DisplayLang=en

 

I tried to find some more, but.... well it was just way too hard. =P
 

 

Solid state baby! It's coming!

http://www.dell.com/content/topics/global.aspx/corp/pressoffice/en/2007/2007_04_24_rr_000?c=us&l=en&s=corp

http://gizmodo.com/gadgets/peripherals/adatas-128gb-solid-state-drive-sees-the-light-of-day-231693.php

This isn't really anything new, but I'm just chomping at the bit for solid state to really take off.

The i-RAM from Gigabyte can be seen here and is a exactly what I dreamed of  back in the late 90s. I'm still surprised that more of these items haven't come out with the relative cheapness of RAM.
 

 

 

More Posts Next page »