Daily Coping 5 June 2020

I’ve started to add a daily coping tip to the SQLServerCentral newsletter and to the Community Circle, which is helping me deal with the issues in the world. I’m adding my responses for each day here.

Today’s tip is to decide to look for what’s good, even on difficult days.

I’ve had a number of difficult days. Some days I think most people just suck. Some days, I look forward and think about how the world might improve over time.

It’s easy to nitpick and find fault. Find a complaint. We see it constantly in social media, where someone can find a reason not to like or appreciate what many others might.

These last couple weeks have been difficult in the US for me. As a minority, I find myself angry, sad, and generally upset. I disagree with some people over their views, their posts, their thoughts, but I also know some personally and I know they are good people.

Our small, personal world where we shake hands, toast over drinks, and share meals is far removed from the larger issues of race, ethics, business, and politics. I try to remember that disagreement is just that, a difference of how we view things. Maybe because of some fundamental reason, maybe because of ignorance of naivety, maybe because of our experience and frame of reference.

I can still appreciate and smile at my friends and colleagues for the things that they do well, the good, the respect, the favors, and the gentle way they behave in person.

Even if I think they do a poor job of expressing themselves at times.

Try to be a better version of yourself online, not a worse one.

Posted in Blog | Tagged , , | Comments Off on Daily Coping 5 June 2020

Do You Think About CheckDB?

Many of you are administrators, maybe accidental ones, but you have some responsibility for ensuring your databases run smoothly. Part of ensuring this happens is monitoring resource usage, configuring security, and patching your system. However, the long term health of your database requires some proactive work to ensure things continue to run smoothly. One way of doing this is using checkdb to assess the health of your database’s internal structure.

Those of us that are full time focused DBAs likely run checkdb, though potentially not in the best way. There are implications to “offloading” this work to another machine. Those that are accidental DBAs, developers, or someone else with other duties might not think about checkdb as necessary.

Do you think about how you should run checkdb? Do you think about licensing issues? Do you think about the frequency and breadth of where you should run checkdb? I’m wondering what some of you do after I ran across a post from Brent Ozar on offloading this work. If you haven’t dug into how checkdb works, you might not realize some of the things that Brent brings up. Even if you think you know how this works, read the post.

I’ve usually been able to run checkdb in production, but I recognize that more and more environments can’t do that. Usually because of the resource contention. When I’ve had that issue, I’ve accepted a time lag to getting results. I don’t worry about finding out about database corruption a day later. I can probably deal with that. I worry about finding out a month later, when reconstructing data is much, much harder.

This isn’t to imply or recommend that you need to run checkdb on each production instance, but rather to get you to think about how checkdb works and choose a strategy that works well for your environment. Even if you have this set up, ensure your configuration still makes sense for your organization. Take a few minutes and read the post and then schedule a review with colleagues of your checkdb philosophy.

Steve Jones
Listen to the podcast at Libsyn, Stitcher or iTunes.

Posted in Editorial | Tagged | Comments Off on Do You Think About CheckDB?

Daily Coping 4 Jun 2020

I’ve started to add a daily coping tip to the SQLServerCentral newsletter and to the Community Circle, which is helping me deal with the issues in the world. I’m adding my responses for each day here.

Today’s tip is to look up at the sky. Remember we are all part of something bigger.

I am blessed in that I have a very wide open, beautiful sky where I live. Sometimes when I’m out at night, it’s amazing how many stars I see. During the day, there’s vastness as it stretches from horizon to horizon. Here’s a recent shot of how widely I can see.

20200525_165937

I notice this, as it’s something I don’t get in NYC, London, or many cities, where buildings and narrow streets block views. The flatness of the land limits how far and wide I can look.

I think that sometimes is how I view the world, getting caught up in some situation, some problem, some challenge, and I think about things from a narrow point of view.

The world is amazingly large. Larger than most of us can imagine. The amount of people, land, money, resources, opportunities, challenges, difficulties, and more are huge. There is more that we are apart of than we can imagine.

If you have faith in a higher power, that’s another level that is worth remembering.

The world is bigger than any of us.

Posted in Blog | Tagged , , | Comments Off on Daily Coping 4 Jun 2020

Creating a New Sequence–#SQLNewBlogger

I wrote about sequences in an editorial recently and decided to start using them. Creating one turned out to be surprisingly easy.

I had a table I’d been logging some data in, with a PK, but no natural key or identity bound to the table. Instead, this was low volume (1x per day) and I just manually adjusted the PK value.

I decided to create a sequence. As I did this, I found it interesting and consulted the BOL page for some ideas on the options.

The first part is simple. A name and datatype.

CREATE SEQUENCE dbo.MyKey as INT

That makes sense. Next, I need a starting value. In my case, I had 7 values in the table, so I added this:

START WITH 8

That gets me what I need. The last part I added was the INCREMENT BY clause. In my case, 1 works fine. My code:

2020-05-09 09_33_59-SQLQuery7.sql - ARISTOTLE_SQL2017.way0utwest (ARISTOTLE_Steve (56))_ - Microsoft

The last query is how you get the next value. The NEXT VALUE FOR phrase can be used in various places, but that’s for another day.

If I needed to bind values, I could use the MINVALUE or MAXVALUE, which I’ll look at in a different post. I could also control caching and cycle values if I needed to.

SQLNewBlogger

I actually started a post on binding this to a column and then decided to add this short post in about 5 minutes.

Posted in Blog | Tagged , , | Comments Off on Creating a New Sequence–#SQLNewBlogger