Monthly Archives: September 2017

I’m speaking at SQL Saturday SAN–This Weekend!

SQL SaturdayAlthough this year has been pretty busy and I haven’t been speaking a whole lot this year, I’ve got a couple of sessions coming up this weekend at SQL Saturday San Diego!

I’ve got two sessions on the schedule; the first one is an introductory session to SQL Server Analysis Services Tabular modeling, and the second one is a bit of a more advanced (call it Intermediate) session where I discuss and demonstrate managing databases using Database projects in SQL Server Data Tools.

The Tabular presentation is designed for folks who are new to SSAS in general or the tabular flavor of it. I focus mostly on the development process of these apparatus and how to move from raw data to a model that is useful for business users to explore on their own.

In the SSDT session, I discuss some of the advantages of utilizing database projects to help manage your database schema in Visual Studio. This presentation also has a lot of demo time in it, and I help explain how to start from scratch and manage what I feel is the most important part of schema management: deployments.

We (DCAC) are also sponsoring, so if you are in the southern California area this weekend, come on out to SQL Saturday, say Hi, and learn some new SQL Server stuff!

Hey, you! Don’t Forget to Enable DB Mail in Agent

Raise your hand if you’ve been there: You set up a new SQL Server instance, configure Database Mail (test it), and then set up a nice Agent job to back up your databases. You configure it to send mail on job completion (so you can keep an eye on it not matter what), but it’s not sending mail. You test DB mail again, and it’s working. What gives?

This is kind of a gimme, but a few weeks ago I configured a new maintenance job (NOT a Maintenance Plan 😉 ) on a new-ish non-production server that didn’t have any other jobs on it yet. When it wasn’t sending mail, I stood around for a lot longer than I’d like to admit before I figured out what was going on.

The kicker is that you have to enable the use of database mail within the SQL Server Agent–this isn’t on by default.

As with most things in SQL Server, there’s a couple ways to turn this on. First is the GUI. The Alert System page of the SQL Agent’s properties dialog is shown here, and you can see right on the top where the main “Enable” checkbox is, along with dropdowns for the DB Mail settings you want to use. Flip that on, pick your desired mail settings (probably only have one setup), restart the Agent service, and your agent jobs will start sending mail as-expected.

Agent Properties dialog showing Mail Settings

There’s also the T-SQL route, which is useful for adding this configuration to a general “initial” script (such as ours: https://github.com/DC-AC/SQL2016_Scripted_Install) so you don’t have to worry about this on new instances that you install/setup. It’s a quick SP call to enable mail:

EXEC msdb.dbo.sp_set_sqlagent_properties @databasemail_profile=N’Main Profile’

Assign the mail profile you want to use, and go. The UI by default and greyed out (at least on a few 2016 instances that I’ve checked recently) checks the “Save copies of the sent messages in the Sent Items Folder” option. This option can be driven with the email_save_in_sent_folder parameter on the proc. Set it to 1 to turn on that option. True story: I have no idea where that mail gets saved on a SQL Server; I assume it goes to the “Sent Items” folder in the mailbox the profile is configured to use, but I’ve never actually configured this with a mailbox that I have access to to see.

This T-SQL step assumes SQL Server on Windows. If you’re doing this on Linux…well, it’s different. I’m not going to reproduce that work here, because it may change since SQL 2017 is still in RC at this point. So, if you’re doing this on Linux, check out the official docs for that process.

Moral of the story here: Don’t be a dumbass like me; turn on DB Mail in the Agent!

You Still Have Your Eclipse Glasses, Right?

Courtesy NASA/SDO

Although, yes, you should just keep them until the eclipse in the US in 2024 (or the one in the Andes in 2019, which I haven’t completely ruled out just yet, because I’ve become a crazy person), there’s another good reason to keep a pair or two handy:

Sunspots!

More specifically: GIANT sunspots!

Right now, there are two fairly-large sunspot areas on the face of the sun. They’re so big, in fact, that they can be seen without magnification. Just put on your eclipse glasses and take a gander. Both of them are pretty close to the center of the solar disk, as seen by the picture above (which is from late yesterday). These will continue to rotate left-to-right across the face of the sun over the next several days.

Take a look; this is pretty cool (bonus points if you work in an office and go out and stand in the parking lot looking up at the sun for no apparent reason).

Space Weather

My favorite site to keep up on this sort of thing is spaceweather.com. Our “space weather” is almost-entirely affected by the sun, so most things on the site lean that way. If civilization as we know it is about to be ended by another Carrington Event, this will be one of the early places to hear about it.

Eclipse Glasses

Quick note about eclipse glasses. Although I heard a few mixed reports about whether or not eclipse glasses would degrade over time and therefore only be safe to use for the next few years, this appears to not be the case:

Such warnings are outdated and do not apply to eclipse viewers compliant with the ISO 12312-2 standard adopted in 2015.

So, keep track of those things, as long as you’ve got good ones.