The Multifunctioning DBA


January 21, 2009  4:48 PM

Powershell V2.0 CTP

Colin Smith Colin Smith Profile: Colin Smith

I finally got on the ball and downloaded Powershell V2.0 CTP and am starting to play with it now. You can download all that you need from http://www.microsoft.com/downloads/details.aspx?FamilyId=7C8051C2-9BFC-4C81-859D-0864979FA403&displaylang=en You will need to unistall Powershell Version 1 in order to install version 2.0. I just installed this and have not had much time to chek it out but so far it is looking good. Looks like more cmd-lets and now have remoting functionaltiy which is one thing that I really wanted in Version 1.

Version 2.0 also comes with a graphical interface in order to write scripts and not need a third party utility such as Primal Script or Powershell Plus. As I learn more and play with this I will post what I think about it. Remember that this is a preview edition and is not ready for production at this time. I would only install this in Testing environments at this time. Features can still be added, subtracted, or changed from this version so be careful with it. Also check out this link for more good info.

http://www.microsoft.com/technet/scriptcenter/topics/winpsh/pshell2.mspx

January 20, 2009  5:49 PM

Environmental Variables in Powershell

Colin Smith Colin Smith Profile: Colin Smith

I have a script that I run in production that requires the script to access the Environment Variables for the server the script is executing on. This is a very simple task in powershell and very very useful. In my script I am using it just to verify that the machine name that it is executing on is the same as the machine name that I want the script to execute on. This is because the script is run from a single location and runs on many servers. The script compares the name that I am inputting to the actual machine name before moving on. Here is how easy this is in Powershell:

$name = (get-content env:Computername)

$name will now hold the value of the environmental variable on that machine for ComputerName. Powershell makes this so easy by having env as a PSDrive. This means that you can connect to it like you would a drive letter and get information from it. try the following:

cd env:

ls

and here is a sample of the results.

PS C:\Documents and Settings\smithco> cd env:
PS Env:\> ls

Name                           Value
—-                           —–
Path                           D:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;D:…
TEMP                           C:\DOCUME~1\smithco\LOCALS~1\Temp
SESSIONNAME                    Console
PATHEXT                        .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.PSC1
APPDATA                        C:\Documents and Settings\smithco\Application Data
SYBASE                         D:\Apps\sybase
PROCESSOR_ARCHITECTURE         x86
SystemDrive                    C:
HOMESHARE                      \\pni-pcfs01\HOME
DEFLOGDIR                      C:\Documents and Settings\All Users\Application Data\McAfee\DesktopProtection
windir                         C:\WINDOWS
USERPROFILE                    C:\Documents and Settings\smithco
TMP                            C:\DOCUME~1\smithco\LOCALS~1\Temp
SYBASE_JRE                     D:\Apps\sybase\shared-1_0\jre1.2.2
USERDNSDOMAIN                  PNI.US.AD.GANNETT.COM
USERDOMAIN                     PNI
ProgramFiles                   C:\Program Files
FP_NO_HOST_CHECK               NO
HOMEPATH                       \
COMPUTERNAME                   PNI-BT15689
CLASSPATH                      .;D:\Apps\sybase\ASEP_Win32\3pclass.zip;D:\Apps\sybase\ASEP_Win32\monclass.zip;C:\Program Files\Ja…
USERNAME                       smithco
NUMBER_OF_PROCESSORS           2
PROCESSOR_IDENTIFIER           x86 Family 15 Model 4 Stepping 3, GenuineIntel
VSEDEFLOGDIR                   C:\Documents and Settings\All Users\Application Data\McAfee\DesktopProtection
INCLUDE                        D:\Apps\sybase\OCS-12_5\include;
ComSpec                        C:\WINDOWS\system32\cmd.exe
LOGONSERVER                    \\PNI-DVADDC02
SYBASE_OCS                     OCS-12_5
CommonProgramFiles             C:\Program Files\Common Files
SystemRoot                     C:\WINDOWS
PROCESSOR_LEVEL                15
PROCESSOR_REVISION             0403
QTJAVA                         C:\Program Files\Java\jre1.6.0_05\lib\ext\QTJava.zip
lib                            D:\Apps\sybase\OCS-12_5\lib
ALLUSERSPROFILE                C:\Documents and Settings\All Users
WF_RESOURCES                   D:\oracle\ora92\WF\RES\WFus.RES
OS                             Windows_NT
HOMEDRIVE                      H:

PS Env:\>

Pretty cool huh….


January 20, 2009  5:36 PM

Video Streaming

Colin Smith Colin Smith Profile: Colin Smith

I am very close to not renewing my Satellite subscription when it ends. This is because you can get almost any TV Show that you want from the internet. Once they are available on line you have a number of options available to you to get that media to your television.

  1. You can build or get a Media Center PC
  2. You can connect your non Media Center PC to your TV
  3. You can use a third party utility to stream Media to a device connected to your TV.

Of all of the options available I prefer method 3. Most people have a Playstation 3, Xbox 360, or a Nintendo Wii already connected to the TV. If this is the case why spend all the money on buying or building a Media Center PC. If you have that in your budget then more power to you and I am sure that you will enjoy having it. If you are like me, especially now, I do not want to spend that kind of cash on another computer. Option 2 is OK if you have a nice LCD TV but even then you might have to pay with overscan issues and that is just not fun. The last option is great. Imaging if you could stream all of your media to a device that you alread have and that you enjoy for other things as well. Lets talk about it.

I purchased a Sony Playstation 3 almost soley for this purpose. It has a great Media Center already and it has Blue Ray and you can play some great games on it. It is a bit pricey, but if you think about all it can do it is worht it if you use the features. You can certainly use an Xbox 360 for this but you then do not have the Blue ray player. A Wii will work as well, limited at the moment. In order to get the content that I want from the internet I do still have to have a computer but it does not need to be a powerhouse that a Media Center PC needs to be.

I use two applications right now in order to stream my Media. I think it woudl be great if the two would merge. Both have features that the other does not and all are very good features. PlayOn my MediaMall is the one that I use most and here is why. I can stream Netflix, Hulu, CBS, CNN, ESPN, and YouTube to my PS3. This software lets you log into your personal accounts and play things that are in your que without having to filter through all the muck. I LOVE it!!! Go get it Go Buy it and support a great application. They are always working on it and releasing new things and have some exciting improvements in the works. Hurry and get it for 29.99 during the Beta process. Too much longer and the price jumps to 39.99 and that is still a steal if you ask me.

The second product that I use is TVersity. This is also a media server application but this has a seperate set of features that I hope PlayOn will add in the future. This one is great because if you have media local you can share those folders and stream that media, be it video, music, or pictures, to your PS3. TVersity also allows you to add streams from other locations. I have added a few from another great site that all the geeks will want to check out called Revision 3. This has many different shows that have food content. Again check it ou. TVersity is FREE!!! You can not beat that… These guys also do an awsome job of adding features and with the newest release you can even stream Live TV Feeds from CNN and some other news sites. Live TV is awsome.

Well I hope that this will help you out if you are looking for some way to take advantage of your gaming system or other set top box. I use the PS3 but both applications support more than just the PS3. So if you have a Dlink media center or any oter set top box check it out and see if it works.

Thanks to all the developers of these two great applications. Once more content is added I can say goodbye to my Dish.


January 14, 2009  8:56 PM

Furlough (Forced Unpaid Time Off)

Colin Smith Colin Smith Profile: Colin Smith

What is a furlough? That was my first question when I got the memo about EVERYONE in my company, nationwide, having to take one. In my case it is a 1 week period that I will not be allowed to work and I will not be paid. It is a temporoay layoff really. That being the case, since my company is in for some hard times, I will be using this unpaid vacation to search for new opportunities in the IT world. I know jobs are hard to come by right now but it never hurts to look right?

I think with my skill set, that I am an asset to any companies IT department. I am well versed in Windows Administration, server and workstation level, Citrix, VMWare, Datbase Administration (Sybase, MS SQL Server, and Oracle), not too mention my eagerness to learn and do new things while I continue to develop my skills in all other areas. I have been useful to my company with Exchange Server and automating tasks via scripts using VBS and now Powershell. Powershell, in my view, is the future of Administering any Microsoft product in the future.

Anyway, I just thought I would vent a bit about the Furlough since I know that many of the big wigs in the company, even though they also get a furlough, will still be getting bonuses and whatever other compensation they can find to make up for it for themselves. I know that this is much much better then not having my job and I think that this really shows the struggles of our current economic situation. My company is very large and is well placed in the market. My division of this company is a big cash cow for the company and we are all feeling the pinch.

I am a loyal employee and I really enjoy the company that I work for, but I hate that every 2 or 3 months we are hearing about more layoffs and now this furlough. I am more than willing to give up a week of pay so that no one, myself included, gets the layoff. I am, however, afraid that this is still just the beginning of a very rough road ahead. I am sure that I am not the only one in this type of a spot and to all of you out there with me I can only say, Do your job, do it well, continue to learn and expand your skillset, and I hope that by doing those things you, as well as me, will be able to make it through the tough months, perhaps years, to come.

Please let me know if you are in the same spot or if you know of any jobs that might be out and about for a guy like me.

colin@sysadminsmith.com

http://sysadminsmith.com/


December 31, 2008  4:24 PM

ISQL

Colin Smith Colin Smith Profile: Colin Smith

So I just told you about SQLCMD and it is a great tool for connecting into MSSQL servers. ISQL is a very similair tool that is used to connect to Sybase. Syntax and usage are the same and it will get you to the same wonderful SQL prompt for ASE Servers. I usually use PUTTY to connect in to the server su to sybase and then isql to the database. Now that I know I can do this from my windows server, as long as I have a good sql.ini, I have been doing this when I do not need to manipulate anything on the filesystem like scripts. This is a great tool to get in the Database do what you need and get out. This is much quicker then logging onto the Unix host via PUTTY and then isql in to ASE. Try it out and let me know if you need anything. Thanks


December 31, 2008  4:12 PM

Job Market

Colin Smith Colin Smith Profile: Colin Smith

So in this economy I thing that just about everyone has seen someone close to them, hopefully not you, be laid off from work. I know that at my employeer we have had a couple rounds of layoffs and I have been very lucky. this last round one person from our Systems team was laid off and he was an asset to the company. He was a Unix Admin but also had skills working with Sybase Databases and other third party tools such as Veritas.

When I was in my training class, the instructor told us that a DB Admin is a good spot during these times. He mentioned that there is a shortage of ASE Administrators on the West Coast. That is very good for us in the DB Game. I have also seen that here in Arizona, Database Admins are some of the highest paid and most needed people in IT at this time. Good news for all of us out west but it is still a scary time. So please do what you can to keep your job and start polishing your skills as well as learning new skills. Good luck out there and I am knowcking on wood for myselfe as well.


December 31, 2008  4:06 PM

Happy New Years

Colin Smith Colin Smith Profile: Colin Smith

Just wanted to wish everyone a Happy New Year and tell everyone to be safe on the roads. I will be hanging out with some freinds and my wife just having a nice quiet night. Have a good one and I hope that next year is great for you all.


December 26, 2008  6:15 PM

Sybase DBCC

Colin Smith Colin Smith Profile: Colin Smith

Sybase DBCC or Database Consistency Checks. This was something that was talked about in my training class and so I thought I would implement this when I got back to work. I mentioned it to my team and they both said that I sounded just like them when they got back from class and they laughed a bit but said go ahead and see what happens. They told me that I would get a ton of errors that were meaningless and that to find out that they were meaningless errors I would have to call Sybase Support. They made it sound like it was more hassle then it was worth but I figured that I might want to do it any way just to get the experience and just what if I did find an error. I could be the Hero and I l love to be the Hero when I can.

I requested a couple devices from our Unix guys for the DBCC Database. I did an sp_plan_dbccdb and determined that I needed 5 gigs of space for data and only about 20 MB for log but I figured I would do 1 Gig for log. I got the devices and I created the DBCCDB and I ran the installdbcc script and boom I have DBCCDB and I am ready to go. I did also set up a named cache and bound it to DBCCDB just to make the DBCC commands run a bit faster. I also made sure that my number of worker process was sufficient for the task.

After getting everything set up I did it, I ran dbcc checkstorage on my DB and guess what. 0 Errors were found. Nothing at all to worry about and not even one spurious error that my teammates said I would have tons of. I am pretty sure that they have not run dbcc checkstorage for a couple releases and in 12.5.4 they added some error checking into the dbcc that makes it report very few if any spurious errors. Since this is the case I am going to regularly schedule this and perhaps one day it will really save us.

The dbcc does take about an hour to run on my DBA server that we load from Production once a week. I will continue to run he dbcc on this server so that I will not hinder the production server at all. Sybase does say that dbcc checkstorage is very un-intrusive but I would rather not give the application team any reason to blame the Database or my team for the application running slow. Based on this I would recommend that you run this as often ass possible as it may save you from getting in big trouble at some point. I hope to never see this report any errors but if it does I will be happy to catch it early. If you have any questions or comments please let me know here or go to www.sysadminsmith.com and send me an email.


December 26, 2008  6:14 PM

Sybase DBCC

Colin Smith Colin Smith Profile: Colin Smith

Sybase DBCC or Database Consistency Checks. This was something that was talked about in my training class and so I thought I would implement this when I got back to work. I mentioned it to my team and they both said that I sounded just like them when they got back from class and they laughed a bit but said go ahead and see what happens. They told me that I would get a ton of errors that were meaningless and that to find out that they were meaningless errors I would have to call Sybase Support. They made it sound like it was more hassle then it was worth but I figured that I might want to do it any way just to get the experience and just what if I did find an error. I could be the Hero and I l love to be the Hero when I can.

I requested a couple devices from our Unix guys for the DBCC Database. I did an sp_plan_dbccdb and determined that I needed 5 gigs of space for data and only about 20 MB for log but I figured I would do 1 Gig for log. I got the devices and I created the DBCCDB and I ran the installdbcc script and boom I have DBCCDB and I am ready to go. I did also set up a named cache and bound it to DBCCDB just to make the DBCC commands run a bit faster. I also made sure that my number of worker process was sufficient for the task.

After getting everything set up I did it, I ran dbcc checkstorage on my DB and guess what. 0 Errors were found. Nothing at all to worry about and not even one spurious error that my teammates said I would have tons of. I am pretty sure that they have not run dbcc checkstorage for a couple releases and in 12.5.4 they added some error checking into the dbcc that makes it report very few if any spurious errors. Since this is the case I am going to regularly schedule this and perhaps one day it will really save us.

The dbcc does take about an hour to run on my DBA server that we load from Production once a week. I will continue to run he dbcc on this server so that I will not hinder the production server at all. Sybase does say that dbcc checkstorage is very un-intrusive but I would rather not give the application team any reason to blame the Database or my team for the application running slow. Based on this I would recommend that you run this as often ass possible as it may save you from getting in big trouble at some point. I hope to never see this report any errors but if it does I will be happy to catch it early. If you have any questions or comments please let me know here or go to www.sysadminsmith.com and send me an email.


December 26, 2008  5:59 PM

Sybase Training Day 5

Colin Smith Colin Smith Profile: Colin Smith

Sorry that I have not done this entry yet. I have been busy with the holidays and my wife just graduated from ASU. I am back now and should be getting back to a more regular schedule. So I have touched on the first 4 days of training and it was a five day class. The last day of class was very short but we did cover some good stuff. One thing in the book that we did not cover was Sybase Central. We did not cover this because it is a GUI and the instructor, as well as myself and the other student, figured that we can learn to click on our own. It does look like the book has some good information about Sybase Central so I will go over it myself and write a post about it.

The main topic on the last day was about monitoring the system. We talked about some third party applications that are around that will do this by monitoring some “Fake” tables that Sybase keeps only in memory just for monitoring purposes, and we also discussed monitoring the old fashioned way. My company does this the old fashioned way by monitoring the alert log and backup logs for any errors or events that we may want to know about. We also have functionality built in to monitor other files if we choose to. Essentially this works buy parsing the alert log and the backup log files at some interval and looking for key words. When a keyword is found the system then sends us an alert that something is wrong and we need to look into it. I am still pretty new to the Unix world so I will not be sharing the scripts with you as I do not know everything about them. I can tell you how to do this in the Windows world using Windows Powershell. I have a series of blog posts here on how to monitor SQL server using Powershell and I am essentially doing the same thing that we do in the Unix environment. Some things are a bit different but for the most part it is the same.

The big thing about this is that you need to have some sort of automated system set up to alert you when something is not correct in the database. If you do not do this then you will not know when things are going wrong until a user calls and tells you, and that may be too late, or you will spend your entire day watching the alert log and the backup log looking for errors. That is not a task that I would wish on my worst enemy. Be a good DBA and make your life easier, set up some monitoring and get some important things done during your day.

No matter what my title or what my job is, I will always work harder on making my job easier then I actually work on doing my job. In the Windows world I would script as much as I could. Sometimes the script writing would take me days to complete even though the task itself only took 30 minutes to do manually. I tell you what though, the next time I needed to do that task and I was done in 30 seconds it was well worth it. So please set up some monitoring and some auto responces to certain errors if you can. That way you do not even get a page. Life is good if you make your job as simple as possible. Good luck with this and if you need any help just let me know by leaving a comment or head over to www.sysadminsmith.com and send me an email. I am always happy to help when I can.


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: