Today is Meme Monday. Today we get to talk about all of the little things a DBA does. Thomas LaRock started things off with his list – here.
I want to just add to the list he started.
- SAN Admin
- Server Admin
- Technical Writer
- Project Manager
- Automate the process to Migrate Data from Production to Dev/Test/QA
- Automate the process to Migrate Data from Production to Reporting Servers
- Export and Email/FTP/Transfer Data to customers
- Attend Sales meetings
- Predict customer requests before the request is made
- Create standards pertaining to the database environment
- Domain Admin
- Administer excel spreadsheets
- Administer Cognos, Crystal Reports, and Access (or any other tool that may provide a reporting interface for the database)
- Create Data warehouse
- Improve your skills
I really like the bullet item “therapist” from Tom’s list. There is a lot of truth to that.
This is a good way to start monday, with a meme. This month Thomas LaRock has provided us with the theme and his entry here.
I thought of following along with a blog to match the song “Two front teeth” but don’t have nearly enough creative juices for that.
Suffice it to say that I really liked the SQLClippy idea from Tom.
So here is my contribution/want list for Christmas from MS for SQL Server (To the tune of “I Want A Hippopotamus For Christmas”)
I want a multipartner-mirror for Christmas
Only a multipartner-mirror will do
Don’t want a GUID, no poorly coded Toy
I want a multipartner-mirror to play with and enjoy
I want a multipartner-mirror for Christmas
I don’t think Microsoft will mind, do you?
They won’t have to use our replication flue
Just bring it with the SP, that’s the easy thing to do
I can see me now on Christmas morning, creeping down the stairs
Oh what joy and what surprise when I open up my eyes
To see a mirror hero standing there
Get the jist? Like Logshipping on Steroids. But maybe that is the point of AlwaysOn in 2012.
Interesting topic this month posted by Thomas LaRock. This month he has chosen “crap code” as the topic. I think it is interesting because there really are so many different ways to take this.
Knowing that there are so many qualifications for crap code, I personally like that of readability. I know everybody has their own interpretation on how code should be written and what is readable. However, I have to say that soooo many styles out there are not very good. The style is sooooooo hard to read and follow. For me, it is a coding nightmare to see code that is poorly formatted or not formatted at all.
SELECT * FROM sometable LEFT OUTER JOIN table2 ON table2.something = sometable.something AND table2.somethingelse = sometable.somethingelse OR table2.somethingagain = sometable.somethingagain
RIGHT OUTER JOIN anothertable ON anothertable.something = table2.something OR anothertable.another = table2.another AND table2.somethingelse = anothertable.somethingelse
That code is just flat out difficult for me to read. SQL Server handles white space just fine so a little formatting doesn’t hurt anything. Better yet, it very well could help improve the readability of your code to more people than just you. Something like the following helps.
FROM sometable st
LEFT OUTER JOIN table2 t2
ON t2.something = st.something
AND (t2.somethingelse = st.somethingelse
OR t2.somethingagain = st.somethingagain
RIGHT OUTER JOIN anothertable at
ON at.something = t2.something
OR (at.another = t2.another
AND t2.somethingelse = at.somethingelse
Now, for simplicity sake, I also introduced something in both of these code samples that I don’t like too much either. In both cases I use a “Select *”. This is bad form! One really should also denote each column that you want to be returned. Not only is it good for readability, but it can be useful for the query optimizer and indexing purposes.
So what do you consider to be crap code?
Did you know that your sign may have changed? I didn’t – at least not until reading the meme Monday announcement. Most people probably will see no difference in their astrological sign. However, if you believe that there is a new all powerful 13th sign and if your sign is Scorpio – your sign probably changed. In order to squeeze in that bakers dozenth sign, Scorpio got cut down to a whopping six days long. In tribute to Scorpio, my meme Monday horoscope will be for that astrological sign.
You are a born performer, with an incredible transaction list to commit today. A hard working instance, you tend to do your work with barely a spike in resources. This is a great time to be clustered with others both local and geographically disperse. This ability to run batches, run TSQL and always be available is the key to pleasing your DBA and avoiding the scrap heap. There are DB systems (RDBMS and NOSQL alike) springing up all around you which always seem to challenge your status quo–be prepared. You must decide whether the risk is worth the change it will bring about in your production environment. New ways to alert or an easy interface will make monitoring and troubleshooting go well. You may find yourself more resource taxed and burdened than usual. You are appreciated for your ability to multi-task.
This month we have an interesting topic for Meme Monday. This is hosted by Thomas LaRock and the topics revolve in some way around SQL Server. As Tom brought up, the saying is that “there are no stupid questions.” I have long disagreed with that statement. I think many people would disagree but it is a tool used by instructors to invoke questions from the crowd. I think there are plenty of stupid questions. For me, a stupid question is simply a question to which you already know the answer.
A common question that I hear that could fall into that category is “How do I select information out of table ZYX?”
For that question, pick your response du jour. Typically the response may be preceded with at least one question trying to garner more information such as “Well, what data do you want to select from the table?” If they can answer this question, then the first question seems a bit on the stupid side since they already know the essential pieces to the answer of their question. This holds true, so long as the data retrieval is a basic SELECT.
So there you have it, short and sweet.
Today is Meme Monday and is a little thing that Thomas LaRock (Blog | Twitter) has started. Today he has started things off with a list of things that could cause a Database to go “wrong” that are not always disk related.
He has tagged a few people to add to the list in an effort to get up to 99 things that are unique that could cause failures in the database. I haven’t been tagged, but wanted to throw out a few of my thoughts to add to the list.
- invoices – missing, unpaid, or wrong altogether
- vendors (misinformed, ship wrong items)
- undefined requirements
- bad documentation
- rampant use of sa
- no backups at all (full, log, or otherwise)
- very wide clustered indexes (i.e. three guids make up the PK and Clustered Index)
- P2V of a VLDB (not always bad but can be disastrous)
- Catch-all queries
These are some of the things I have seen cause some database problems. Sure some of these things are more encompassing than just the database (like a vendor shipping the wrong part), but they can have a huge impact on the database.