Categories: News

A DBAs List of Little Things

Categories: Meme Monday, News, Professional, SSC
Comments: 1 Comment
Published on: March 5, 2012

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.

  1. SAN Admin
  2. Server Admin
  3. Technical Writer
  4. Project Manager
  5. Automate the process to Migrate Data from Production to Dev/Test/QA
  6. Automate the process to Migrate Data from Production to Reporting Servers
  7. Export and Email/FTP/Transfer Data to customers
  8. Attend Sales meetings
  9. Predict customer requests before the request is made
  10. Create standards pertaining to the database environment
  11. Document
  12. Document
  13. Document
  14. Domain Admin
  15. Administer excel spreadsheets
  16. Administer Cognos, Crystal Reports, and Access (or any other tool that may provide a reporting interface for the database)
  17. Create Data warehouse
  18. Improve your skills

I really like the bullet item “therapist” from Tom’s list.  There is a lot of truth to that.

Are my Linked Servers Being Used?

Comments: No Comments
Published on: March 5, 2012

This is a follow up to an article published on 3/1/2012.  That article showed how to find what linked servers were created on your instance of SQL Server.  You can read it here.

This article came about due to a request to find if any stored procedures are using any of the linked servers.  In addition to finding if any stored procedures may be using a linked server was the need to find the name of that procedure.  The request evolved to also include finding any SQL Agent jobs that may be using the linked server.

In response to that request, I had the idea to adapt a query I had recently written.  I will be posting that in the near future.

Query

DECLARE @VName VARCHAR(256)
DECLARE Findlinked CURSOR
LOCAL STATIC FORWARD_ONLY READ_ONLY
     FOR
SELECT name AS name
	FROM sys.servers
	WHERE is_linked = 1
 
OPEN Findlinked;
FETCH NEXT FROM Findlinked INTO @VName;
 
WHILE @@FETCH_STATUS = 0
BEGIN
	SELECT OBJECT_NAME(OBJECT_ID)
		FROM sys.sql_modules
		WHERE Definition LIKE '%'+@VName +'%'
		AND OBJECTPROPERTY(OBJECT_ID, 'IsProcedure') = 1 ;
 
	FETCH NEXT FROM Findlinked INTO @VName;
END
CLOSE Findlinked
 
OPEN Findlinked;
FETCH NEXT FROM Findlinked INTO @VName;
 
WHILE @@FETCH_STATUS = 0
BEGIN
	SELECT j.name AS JobName,js.command
		FROM msdb.dbo.sysjobsteps js
			INNER JOIN msdb.dbo.sysjobs j
				ON j.job_id = js.job_id
		WHERE js.command LIKE '%'+@VName +'%'
	FETCH NEXT FROM Findlinked INTO @VName;
END
 
CLOSE Findlinked
DEALLOCATE Findlinked

Don’t blast me just yet due to the use of a loop (cursor).  In a case such as what has just been presented, a cursor is a legitimate tool.  I need to find all stored procedures that contain the text I specify.  In this case, I am searching for each of the linked servers.

In addition to searching all of the stored procedures for the use of a defined linked server, I am re-opening the same cursor to search all of the jobs defined on the server.  I do this in the event that the job was created with an ad-hoc query in lieu of using a stored procedure.

If you run the query, you will find that it should provide a quicker turnaround time on documenting the use of the linked servers than manually searching.

Linked Servers

Categories: News, Professional, Scripts, SSC, SSSOLV
Comments: No Comments
Published on: March 1, 2012

Do you have linked servers that have been created in your environment?  Do you know what these linked servers are?

Finding Linked Servers

SQL Server has provided us means to be able to find the linked servers on each installed instance.  I will show two simple means (that don’t involve traversing the SSMS GUI) that will list the linked servers.

Both methods are very similar in nature.  I will leave it up to you to determine which you prefer to use.

 

Stored Procedure

Microsoft has shipped a stored procedure called sp_linkedservers.  Execute this stored procedure and you will get a list of linked servers and the details related to those objects.  One problem with this method is that not all the results returned by this proc truly represent linked servers.  This procedure will also return the name of the instance to which you are also connected.

Catalog Query

This is really what the stored procedure is doing.  But here is a modified query to return only those servers that are linked servers in the catalog.

SELECT SRV_NAME = srv.name,
        SRV_PROVIDERNAME    = srv.provider,
        SRV_PRODUCT         = srv.product,
        SRV_DATASOURCE      = srv.data_source,
        SRV_PROVIDERSTRING  = srv.provider_string,
        SRV_LOCATION        = srv.location,
        SRV_CAT             = srv.CATALOG
	FROM sys.servers srv
	WHERE is_linked = 1

The main difference being the where condition.  Querying the sys.servers catalog with a condition of is_linked = 1 will return only those servers that are linked servers.  Getting this information is a pre-requisite for an upcoming post.  I hope you find this information useful.

 

Goals 2012

Categories: News, Professional, SSC
Tags:
Comments: No Comments
Published on: February 8, 2012

As I have wanted to do each year, here is my goals post for 2012.  Last year I set out to do this very same thing but was very unsuccessful at completing the post.  Here is all I had written:

Personal

  • Family
  • Blogging
  • Build out my Virtual Environment

Professional

  • SSIS
  • SSRS
  • SSAS
  • Blogging
  • Writing (articles)
  • Community
  • Presentations

Education

  • Certification
  • Books

Fitness

  • Running
  • Exercise

This year, I will do much better.  As proof of that goal, this post will get published – one way or another.  Despite not having published an actual list of goals, I think I did fairly well with this list.  I wrote a few articles.  I was able to maintain a steady pace with my blog.  I completed my MCITP for both Admin and Dev tracks in 2008.  I became very familiar with SSRS and learned a substantial amount with SSIS.

So, as I set out to establish my goals, I decided to keep the list very short.

Professional Development

I will finish the MCITP for the BI track in 2008.  I plan to have this done by March 2012.

I will study for and take the MCM written and Lab exams for SQL 2008.  I will take more time to achieve this goal but will have it done by year end.

Continue writing.  I will continue to contribute articles for publication as well as write on my blog.  I hope to also do some writing professionally.

Personal

I have several rooms in the basement to finish.  I plan on finishing the family room and my office.

Community

I will continue to volunteer at the UG level as well as at the PASS level.  I like volunteering with PASS and helping to achieve the greatness that is PASS Summit.

Despite some setbacks already, I will push forward and get a SQLSaturday event to happen in Las Vegas.

There you have it.  Nothing too elaborate.  I’m trying to keep the goals short and simple without overly complicated detail.  I think this year will be a successful year as well.

S3OLV – Get your Merge On

Categories: News, Professional, SSC, SSSOLV
Tags: ,
Comments: No Comments
Published on: February 7, 2012

We are rapidly closing in on the February meeting for S3OLV.  You might remember reading about the upcoming meeting here.

We are looking to have an excellent meeting this month.  We have had a good run on superb presentations, and Troy aims to keep us going in the right direction.

Troy will be teaching us how to use the Merge statement.  He will help us to learn how this statement can help improve our queries.

We will also continue our ugly code segment.  Bring your ugly code.  Send your ugly code to admin at s3olv dot com.  We are doing this segment in an effort to have the group help each other and learn from each other.  Honestly, it is also an effort to help drive up group interaction.

Here is the information for the meeting.

Date: February 9, 2012

Time: 6:30 PM Pacific

Virtual Meeting Info

Attendee URL: https://www.livemeeting.com/cc/UserGroups/join?id=H3ZGRQ&role=attend

Meeting ID:  H3ZGRQ

Physical Meeting Info

M Staff Solutions & Training / 2620 Regatta Drive Suite 102 Las Vegas, NV 89128

Freedom

Categories: Book Reviews, News, SSC
Comments: No Comments
Published on: February 7, 2012

Not too long ago, I blogged about a Book called Daemon.  Freedom is the sequel to Daemon.

I enjoyed reading this book.  The story continues from Daemon, but in a largely different direction.  I like the direction the book took, for the most part.  I was hoping that there would be more tech talk and not so much of the sci-fi tek.  I liked the sci-fi tek, I just thought it would have been more down to earth to keep it closer to reality.

Daemon was scarily real.  The exploits were real, the danger seemed real.  In Freedom, I felt it made a big reach.  When looking at both books together though, it seems like a natural progression.

I like the plot.  The story culminates with a confrontation at a compound in Texas.  I really thought that the confrontation was a huge let-down.  I really expected more conflict at that point.  Everything was mounting to that, but the ultimate goal was to demonstrate that the group of people from the darknet still could think for themselves.

In the end, it was a good story.  I would like to have some of the technology.  I must also admit that Freedom was harder to put down than Daemon for me.  I found myself rooting in favor of the Daemon.  I started rooting for the Daemon at the end of the first book.

System Base Tables

Comments: No Comments
Published on: January 30, 2012

On January 19th, I published a post about the Dedicated Administrator Connection.  I spoke very briefly of the system base tables in that article.  Today, I want to dive into these tables a little bit more.

First, let’s get the Microsoft definition for these tables.  ”System base tables are the underlying tables that actually store the metadata for a specific database.”

Have you ever queried sys.objects from the master database and wondered about some of the results?  You can see all of the System base tables when querying the sys.objects view.  These tables are denoted in sys.objects by type of ‘S’ and a type_desc of ‘SYSTEM_TABLE’.

Here is a simple query to take a quick peek at these tables.

SELECT * FROM sys.objects
	WHERE Type = 'S'
	ORDER BY NAME

There is no need for a Dedicated Administrator connection in order for this query to work.  You can view these results with a non-DAC connection to the instance so long as you have adequate permissions to query sys.objects.  That said, not all objects returned by that query are System Base Tables.  Furthermore, it appears that the list from MSDN is not comprehensive.  One such example is the reference to sys.sysserrefs that does not appear to exist in SQL 2008 R2 and the missing System Base table called sys.sysbrickfiles (which is used by sysaltfiles as shown in this execution plan).

If I try to query the sysbrickfiles table (as an example) without connecting via DAC, I will get an error message like this:

Msg 208, Level 16, State 1, Line 1
Invalid object name 'sys.sysbrickfiles'.

This is normal behavior.  You cannot query the system base tables without first connecting via DAC.  Having said that, the obligatory warning is required.  As explained on MSDN, these tables are intended for use by Microsoft.  Proceed at your own risk and please make sure you have backups.

In addition to these System Base tables, you will find tables not mentioned in the article nor in the master database.  These System Base tables are found within the Resource database.  The resource database does contain most of the tables mentioned in that article, but there are some differences.  I will leave that discovery exercise to the reader.

There is plenty about SQL Server that many of us take for granted.  Under the hood, there is much more to learn.  Taking a peek at the System Base tables is one of those areas that will help you to learn more about SQL Server.  My question is this: How far are you willing to explore to learn more about SQL Server?

Slammer, Alive…Barely

Categories: News, Professional, SSC, SSSOLV
Tags: ,
Comments: 1 Comment
Published on: January 24, 2012

Slammer

By now you must have heard of the SQL Slammer worm.  It was quite an infectious little nuisance.  The harm it caused came largely due to unpatched, unprotected SQL Servers.

We are now 9 years out from the initial discovery of this worm.  The worm has made its way onto the endangered species list – but it is not yet extinct.  I don’t know if I should be surprised by that.

My initial reaction is “No way that worm is still causing problems.  Everybody knows about it.”  But yet, I just caught several infection attempts from remote hosts that were affected by Slammer.  When I take a step back, I recall that many people out there are still running on unpatched servers.  I know of many places that are running SQL 2000.  I know of a large pool of servers across different versions and editions that are not patched.  I even know of a few places that are still running SQL 6.5.

When I take all of that into account, finding that Slammer is still active does not surprise me – but it should.

So for fun, here is what I was able to trap from the recent attempts at my machine with SQL Slammer.

Time:		 1/23/2012 3:59:03 PM
Event:		 Intrusion
IP Address/User: 202.56.192.195
Message:	 Attack type: MSSQL Resolution Service Buffer Overflow (Slammer)

When I trace that IP back to its source, I get a host name of the machine.  If I search on the Host Name of the IP Address, I find this page.  If I were a hacker, I now have a lot of valuable information.  I can also assume that this particular host has many virii.

This entire little foray has made me wonder how many people out there are concerned about security.  Do you know what the patch level is of your server?  Is your AV software up to date?  Are you running any form of HIPS?  If you are in IT and your focus is Data, you may want to check those things.  After all, our focus is to protect the data.

S3OLV February 2012

Categories: News, Professional, SSC, SSSOLV
Tags: ,
Comments: 1 Comment
Published on: January 23, 2012

Do you recognize this person?

 

If you are from the Colorado Springs area, you probably do.  This is:

 

 

 

Troy Ketsdever (twitter)

Troy will be presenting to the Las Vegas SQL User Group on February 9, 2012 @ 6:30 Pacific.  Here is his bio:

Troy Ketsdever is a data architect with over 15 years of commercial software development experience, and has maintained a love/hate relationship with SQL Server since version 4.2. In addition to his “day job”, Troy enjoys writing articles and presenting at user groups on a variety of database design and implementation topics.

His main objective and vision is “making the right information available to the right people at the right time”.

The topic that Troy has chosen for this meeting is titled: Zero to “MERGE” in 60 minutes.  And here is the abstract for that presentation.

Description: SQL Server 2008 saw the introduction of the new MERGE DML statement. In this session, we’ll take a look at the basic syntax and capabilities of the command. Once we have reviewed some simple examples, we’ll dive into some of the more advanced uses (abuses?) of the command, reinforcing our understanding by looking at more complex examples.

Bring your questions.  Bring your ugly code.  If you are remote, bring your own PIZZA.  Yes, this meeting will be both virtual and in person.

Virtual Meeting Info

Attendee URL: https://www.livemeeting.com/cc/UserGroups/join?id=H3ZGRQ&role=attend

Meeting ID:  H3ZGRQ

Physical Meeting Info

M Staff Solutions & Training / 2620 Regatta Drive Suite 102 Las Vegas, NV 89128

S3OLV – Jan 2012 Meeting Recap

Categories: News, Professional, SSC, SSSOLV
Tags: ,
Comments: No Comments
Published on: January 20, 2012

Last week (Jan 12, 2012), we held the user group meeting for the SQL Server Society of Las Vegas (a.k.a S3OLV or SSSOLV).

Presenting at that meeting was Josh Lewis (Twitter).  Josh presented on a pretty tough topic in my opinion.  He chose to present to us the topic of XML for the DBA.  You can read his abstract here.

We got the meeting rolling a little bit late.  Traffic must have been a bear down in LV.  Nonetheless, it got rolling and was a good meeting.

During this meeting we had our second installment of “Crap Code.”  Unintentionally, the crap code was a perfect segue into the presentation.  The crap code demonstrated extracting elements from XML related to the blocked process report.

Josh did a great job on the topic.  We recorded the meeting and you can view that here.  Check it out.  Get a little free learning on a difficult topic (for some us like myself).

Stay tuned, the February announcement is coming soon.

 

«page 2 of 30»
Calendar
May 2012
M T W T F S S
« Apr    
 123456
78910111213
14151617181920
21222324252627
28293031  
Follow me on Google+

In 0 people's circles

Add to circlesi
Content
Categories

Categories

Now Reading

Now Reading

Planned books:

Current books:

  • ChiRunning: A Revolutionary Approach to Effortless, Injury-Free Running

    ChiRunning: A Revolutionary Approach to Effortless, Injury-Free Running by Danny Dreyer, Katherine Dreyer

  • Advanced Marathoning – 2nd Edition

    Advanced Marathoning – 2nd Edition by Peter Pfitzinger, Scott Douglas

  • SQL Server MVP Deep Dives

    SQL Server MVP Deep Dives by Nielsen Paul, Delaney Kalen, Machanic Adam, Tripp Kimberly, Randal Paul, Low Greg

  • A World Without Heroes (Beyonders)

    A World Without Heroes (Beyonders) by Brandon Mull

Recent books:

View full Library

SQLHelp

SQLHelp


Welcome , today is Thursday, May 17, 2012