The Multifunctioning DBA


November 28, 2011  5:22 PM

Amazon Sales Rant

Colin Smith Colin Smith Profile: Colin Smith

First, before I get into my rant I must say that I love Amazon and I think they are awesome overall and love the Black Friday, Cyber Monday lightning deals that they are doing but I do have one complaint. I Wanted to purchase the ASUS Eee Pad Transformer TF101-B1 32GB 10.1-Inch Tablet (Tablet Only) and they had a lightning deal for the tablet that was an amazing price. 329.00 so I waited and I clicked on it as soon as it went live. But I went into some sort of Amazon Hell where it continued to ask me to add to cart and then join waitlist and then back and forth over and over again. I continued this game until I finally got on the waitlist 35 minutes later. When I finally got on the list I was 500+ on the list and my chances of getting the deal were poor. Now I am not ranting because I did not get the deal, I realize that they only have so many at that amazing price and I might not have been fast enough, but it seems to me that as soon as I clicked add to cart, it should have at the minimum put me on the waitlist at that time. Just seems to me that for the very popular items they could have handled it a bit better.

All that being said I still love Amazon and thank them for all the deals that I did get.

November 25, 2011  9:00 PM

Another Index to save the day

Colin Smith Colin Smith Profile: Colin Smith

I had a customer call and complain that a select distinct statement was taking over 10 minutes to run and they thought that was to long. The table they are running the query against does have over 600 million rows so it is not a small table but it is partitioned. So I started looking into it and I found that the column that they wanted the distinct values for was not indexed. I created that index and now I am down to under 2 minutes.  Proper indexing to the rescue again. Take a look at the queries that developers are complaining about and just see if you can do any optimization at the database level before tossing code back to them. 90% or more of the time it is code but that does not mean we can not try to help out.


November 25, 2011  3:33 PM

Powershell Truncate a String

Colin Smith Colin Smith Profile: Colin Smith

I am working on a script where I need to push some data into an oracle database. That is easy enough as I know that I can use sqlplus to execute my query into oracle but, the Oracle column that I am putting data into cannot be ny more than 10 characters. Some of the data that I want to put in is more than 10 characters so that is a problem. Now the data that I am pushing in does not matter if it gets truncated so do not do this unless that is OK. This is very simple though.

PS C:\Documents and Settings\cosmith> $string = “thisismyverylongstring”
PS C:\Documents and Settings\cosmith> $string.Length
22
PS C:\Documents and Settings\cosmith> $string1 = $string.Substring(0,10)
PS C:\Documents and Settings\cosmith> $string1.length
10
PS C:\Documents and Settings\cosmith> $string1
thisismyve
PS C:\Documents and Settings\cosmith>

So as you can see, using the substring function makes this very easy. Just pass it the index that you want to start with and the index that you want to end with.

Hope this helps


November 24, 2011  8:00 AM

Happy Thanksgiving

Colin Smith Colin Smith Profile: Colin Smith

Today is Thanksgiving so I wanted to wish you all a happy and safe Thanksgiving. I am sure that you have plenty to be thankful for as do I. Here are just a few things that I am very thankful for.

1. My Wife – We have been married for over 14 years now and not many people thought we would last since we were married so young. But she is still the light of my life and I enjoy spending time with her more than anything else in the world.

2. Child on the way – I am very excited that we will be having our first child later this year and again I am thankful to my wife for taking this challenge on with me. So far (knock on wood) the pregnancy has gone great and I hope that we can get through it to a healthy baby.

3. Health – Both my wife and I and our families are lucky and have our health. I know that this is something that many people just say but for me it is true, with a baby on the way it is extra important.

4. Work – I am thankful that both my wife and I are employed and we both enjoy our work. As you know I am a DBA for a international company and the company is doing very well. This is something that I was not able to say at my previous employer. The media business is tough these days so I am thankful I found a good position with a solid company that has a great outlook. My wife is an accountant for a large national company that is also doing well so we are very thankful for that.

So that is a few of the things that I am most thankful for. I hope you can think of some and let the people around you that make those things possible know that you appreciate them. Also be safe, eat a lot, and enjoy the weekend.


November 23, 2011  6:00 PM

Google Calender synch with Outlook

Colin Smith Colin Smith Profile: Colin Smith

So I said that I would like to get my Outlook calendar to synch with my Google calendar so I can get my calendar events on my phone. Well it was easy. Just go get Google Calendar Synch. This will do just that and it works bidirectionally. This means that I can enter a event on my android phone and have it push that to my Outlook Calendar. It was just what I needed.

Check it out. Hope it helps.


November 23, 2011  8:00 AM

Blackberry Forward SMS and Phone calls

Colin Smith Colin Smith Profile: Colin Smith

My new job will not let me connect my Andriod device to the Exchange servers so I can not get my calendar and email. Well I thought that is OK as long as I am on-call I will carry my company issued Blackberry and when I am not I will not, but I still want to make myself available if something comes up. To do this I found Advanced Forwarder. This app allows my blackberry to receive and forward all calls and texts that are sent to it. This allows me to only carry my personal phone and when I get called or paged from work it will come to my personal phone. I think I will find a way to synch my Calendar and then I will just not have my company email on my personal phone. That I am sure I could find a way around but I do not want company information on my phone without them knowing it and being able to enforce security policies. I think if I can get the calendar issue fixed I will be good to just carry my one phone when I am not on-call.

Check it out. hope that it helps.


November 22, 2011  6:30 PM

Interviewing Tips

Colin Smith Colin Smith Profile: Colin Smith

I do not claim to be a great interviewer at all but I think I do OK, I have a job and I got it only a couple months ago. Since I have been at the new position I have participated in interviews for a DBA position that we currently have open and I have been very surprised. We are looking primarily for an Oracle DBA but that person will need to support SQL Server as well. We are OK with doing some teaching and mentoring in this space but some of the answers we have been getting to basic questions are amazing. I think my favorite is:

Question: What is the difference between a login and a user in SQL Server?

Answer: “Do I Care?”

Really? I am OK with you not knowing the answer, especially since you are more of an Oracle DBA with not as much experience in SQL Server. But that answer just rubs me the wrong way and also tells me that you really have NO experience with SQL Server. In SQL Server you do need to care what the difference is as I am sure you all know if you are reading this blog. My point is that if you do not know the answer then be honest but show that you are willing to find the answer.

Answer: “Well I am really not sure, sounds like this must be a major difference in SQL Server from Oracle and I would be happy to find out and get you that answer by the next time we speak.”

Then all you have to do is follow up on that because I know I will ask that again if we speak again.

Another pointer is to be confident but not cocky. We had one candidate that really made some interesting comments that rubbed me the wrong way.

Statement 1: “I have designed the three largest databases in the world”

Statement 2: “The data dictionary was re-designed because I wanted it to be.”

Those are some very large statements, and I am actually OK with them and would be impressed if you have some sort of backup to it. Just making the statements without having a backup story to explain how that came to be is not good. Just makes you sound like you are bragging and not in a good way.

My point is really just be honest and humble and if you make bold statements like that then you better be able to back it up.


November 22, 2011  4:05 PM

SQL Server 2012 Licensing

Colin Smith Colin Smith Profile: Colin Smith

Make sure you check this out. Some changes are coming with SQL Server 2012 that you will need to be aware of.

http://www.microsoft.com/sqlserver/en/us/get-sql-server/how-to-buy.aspx


November 21, 2011  6:10 PM

EVO 3D

Colin Smith Colin Smith Profile: Colin Smith

I have the EVO 3D and I love the phone. But over the past couple weeks I have been having some very strange issues with it. The screen thinks it is getting touched when I know that it is not and when I touch it it does not do what I expect that it should be doing. So I have fought and fought with it and I have tried to recalibrate the screen, the keyboard, clean the screen again and again and nothing seems to resolve the issue. It has gotten so bad that the phone is just unusable. I finally broke down and took it into sprint. I was pleasantly surprised that they verified what I thought, the issue is a hardware issue and the screen has some dead spots. I do not carry insurance on my phone as I think that is for the most part a waste of money. I am willing to take the risk as I trust myself and if something does happen I know that I am taking a risk. But after Sprint verified the issue they told me they could replace it for 35 Dollars. That shocked me a bit but they explained that if I did not want to incur the cost I could contact HTC and that just sounded like more than 35 dollars worth of trouble to me so I paid the money and I will be getting my new phone today. I will let you know how that goes.


November 21, 2011  4:10 PM

Query Oracle with Powershell

Colin Smith Colin Smith Profile: Colin Smith

I have a small project that I am working on and it requires that I pull data from Oracle from within a Powershell script. This is not something that is fun but it can be done and it is not really that difficult to get the data out of Oracle, it is dealing with the data once you have the data out.

$query = “select * from table;”
$query | sqlplus username/password@SID
that will push the data back for you but it is ugly and you are going to have to parse that data somehow to get it into a format that is useful to you. It all depends on what the query is and how you need the data. For me I ended up having to break my query down into two queries in order to deal with the data and get the output that I was after. The problem is that it returns as a giant string and the sting is not really formatted in any useful way. So you may have to be creative in order to get what you need but it can be done.


Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: