Consider It Pure Joy

Consider it pure joy, my brothers and sisters, whenever you face trials of many kinds, because you know that the testing of your faith produces perseverance. Let perseverance finish its work so that you may be mature and complete, not lacking anything.” (James 1:2-4; NIV)

What on earth is James talking about? Consider it joy when you encounter trials? I think most of us would agree that trials are something to be avoided. They are certainly not something to accept, much less be joyful about. This flies in the face of everything our culture believes. Many of our actions are built upon the idea that if we work hard, do good, and are smart then trials in life can be avoided, and they should be.

The problem is that our focus is in the wrong place. This life we live, and the circumstances we encounter along the journey, aren’t about us. It’s about God, His Kingdom, and His purposes. When we encounter trouble, discouragement sets in because the life we had planned is interrupted. We mourn over the loss of comfort, peace, stability, or gain. On the contrary, God says that losing this life for Him is gain (Matthew 16:25). His perspective is an eternal one, knowing that our time in this life is very short and that its purpose is to prepare us for a much longer time in His presence.

Knowing that, James’ words start to make a little more sense. When we encounter these trials, our flesh (the part of us bound to this world) suffers. During that time, if we place our faith in Jesus for who He is and what He has promised, our faith grows. Not only that, but as the flesh decreases in its dominance over us the Spirit increases.  The affect of that might seem quite small at first, but don’t miss the power. Believers who have begun surrendering to Jesus in their trials can testify to the outcome James points to. When once you’ve made it through a trial and allowed God to use it in your life for His purposes, you know that you can take on the next one. And when the next one comes (and it will) you’re looking forward to what God is going to do through it. So as time goes on trials are transformed from something that you once dreaded into something that you EMBRACE. Now perseverance has started forming in you. Those petty fears that kept you from serving the Lord in this area or that melt away. Not only are you no longer afraid of the circumstances surrounding that decision but  you have JOY, knowing that God is going to use them in you and those around you.

Let me be careful to point out that this is not some natural tolerance or toughness you build as a result of going through difficulty. You don’t have to be saved to be tough. In fact, sometimes that’s a sign of drifting away from the Lord because we’ve come to rely on ourselves instead of God. In contrast, this is all about surrendering to God and letting Him work, not making it about our actions. We recognize that we are weak and rejoice in the fact that our weakness is used to bring Him glory (2 Corinthians 12:9).

Can you imagine the Christian who is not deterred by trials but rather fueled by them? Who doesn’t grow weaker as they endure life but stronger? Trials are guaranteed in life, no matter how much wealth, health, power, or privilege you have. The only question is whether you’ll allow them to drive you further into the flesh as Satan intends, or allow God to produce perseverance in you as He intends, making you “…mature and complete, not lacking anything.”

Is Optimizing for AdHoc Queries Worth It?

As you probably know, there is a server configuration option called “optimize for ad hoc workloads”. For more details on that option check out the MSDN article. The real question is, how do I know the extent to which my environment uses AdHoc queries? Well, as usual there is a DMV for that. Use the query below to get an idea of how many plan caches are being stored but only used once. The number changes often, so it’s a good idea to baseline your typical number. For instance, I’ve created a SQL Agent job to record the number to a table every ten minutes.  If you maintain high numbers then it might be a good idea to optimize for ad hoc workloads. As always, however, I would advise testing thoroughly first. Happy hunting.

USE Diagnostics

INSERT INTO Diagnostics.dbo.AdHocTracking
	SELECT COUNT (*) FROM sys.dm_exec_cached_plans
	WHERE objtype = 'Adhoc'
	AND usecounts = '1'

Credit to the Red Gate blog for my initial background information.

Managing CDC Jobs on an Availability Group

So, here’s the deal. You’ve got Change Data Capture going in your environment and want to move your database to an Availability Group on SQL Server 2012. That’s great, lots of advantages there. But what happens to CDC when your database fails over to a different node? Since the capture process runs through SQL Agent jobs you will no longer be getting the CDC information post-failover. This is the scenario I ran into recently. In order to mitigate the problem I’ve created a simple script to handle the enabling and disabling of jobs on both replicas. Of course, the jobs will need to be created on each replica before it will work. But this is an easy way of making sure you can take advantage of the benefits of AG’s while still keeping up your CDC captures. I have this running every five minutes on each node. Feel free to adapt/improve/delete it to your heart’s content. Note that I have hard-coded the replica_id. I know, not the most elegant method. But good enough for a first version.

****Update****

Through painful experience I’ve discovered that the replica id can change if you remove the replica and add it back in. A slightly better method of checking utilizes sys.dm_hadr_availability_group_states. In this case we’re checking against the instance name, which will always remain the same.

IF (select primary_replica from sys.dm_hadr_availability_group_states) = ‘YourReplicaName’

****Update 2****

For SQL Server 2014 and above you are not allowed to even run the USE statement against a database that is on a read-only replica (ie your secondary replica used for reporting). For that reason I’ve altered it to use sp_start_job instead. The updated version below also simplifies other syntax a bit.

--Check to see if this instance is the Primary Replica.
IF (select primary_replica from sys.dm_hadr_availability_group_states) = 'YourReplicaName'
	BEGIN
		--If this is the Primary and the capture job is disabled, enable and start it.
		IF (select enabled from MSDB.dbo.sysjobs where name = 'cdc.YourJobName_capture') = '0'
			BEGIN
				EXEC msdb.dbo.sp_update_job @job_name = N'cdc.YourJobName_capture', @enabled = 1;
				EXEC msdb.dbo.sp_start_job N'cdc.YourJobName_capture' ;  
			END
		--If this is the Primary and the cleanup job is disabled, enable it.
		IF (select enabled from MSDB.dbo.sysjobs where name = 'cdc.YourJobName_cleanup') = '0'
			BEGIN
				EXEC msdb.dbo.sp_update_job @job_name = N'cdc.YourJobName_cleanup', @enabled = 1;
			END
	END
--Actions to take if this instance is not the Primary Replica.
ELSE
	BEGIN
		--If this is not the Primary and the capture job is enabled, disable it.
		IF (select enabled from MSDB.dbo.sysjobs where name = 'cdc.YourJobName_capture') = '1'
			BEGIN
				EXEC msdb.dbo.sp_update_job @job_name = N'cdc.YourJobName_capture', @enabled = 0;
			END
		--If this is not the Primary and the capture job is enabled, disable it.
		IF (select enabled from MSDB.dbo.sysjobs where name = 'cdc.YourJobName_cleanup') = '1'
			BEGIN
				EXEC msdb.dbo.sp_update_job @job_name = N'cdc.YourJobName_cleanup', @enabled = 0;
			END
	END

****Update 3****

Check out this post to learn about firing off jobs based on SQL alerts. This would be a better approach than checking on a timed interval.

Web Hosting Tools

Over the last year or so I’ve been getting more into web hosting for myself and friends. Below are the solutions I’ve chosen to use and I would recommend them to anyone.

  • Name.com: This is the site I’m using both to register my domain and to host the site. They are easy to use, affordable, and have great tools along with instruction on how to use them.
  • WordPress: If you’re like me, you enjoy using the web and would like to harness the power of today’s innovations but don’t have the programming skills (or time) to write it from scratch. Enter WordPress. Sign up for a hosting solution (such as Name.com mentioned above), install WordPress, and your site is ready to go. From there it only requires simple gui-based configuration to customize your site and start taking advantage of the online world. Plus, there are tons of free WordPress plugins that will enhance the capabilities of your site for free.
  • MailChimp: If you’re in need of a newsletter signup utility look no further. MailChimp will easily integrate with WordPress to have you signing up subscribers in no time.

Windows 8 Evaluation

My opinion of Windows 8 after using it for a bit:
  1. I think it will work well for personal machines. I’m going back to Windows 7 on my work laptop. In our case the apps we use just aren’t compatible enough with it yet and the interface doesn’t yield itself to higher work efficiency.
  2. Evaluate very carefully whether or not the software that is essential to you will work. Windows 8 is a big technology jump so you need to use the compatibility wizard and be sure. Don’t assume that if it works with Windows 7 it will be fine.
  3. All of the benefits remain. It is super fast, even more so than 7. It’s a fresh approach to interacting with a PC and I think that the majority of users will enjoy it as they get used to it.

Curb Your Office Toolbar Fury

When they introduced the ribbon menu in Office 2007 it seemed like both the best and worst idea ever. While it provides a more simple approach to those new to Office it is infuriating for us that had the old style down to a science. Many of us did not feel like learning an entirely new way of doing the same tasks, or we just refused out of spite. Well, Microsoft has now made it easy to make the transition. This handy, interactive guide will let you do an action the way you know and love, then it will immediately show you the ribbon way of doing it. Funny thing is they’ve had it out for a while and just didn’t tell anyone. Way to win Microsoft.

Ribbon Guide

What to expect when you’re expecting… to change cell carriers.

I recently decided to go back to Verizon from using Straight Talk. When we had our son we cut back on our expenses a lot and are only just now sorting out how much of that is truly necessary. Anyway, we decided to go back to the smart phone world and to do so on a network we knew was reliable, Verizon.

People had warned me ahead of time that moving your number from a prepaid carrier can be difficult. We did as much research ahead of time as possible and moved forward confidently. My wife was certain she wanted an iPhone, and their prices dropped on Apple’s website first so we ordered it from there. You can choose all of the options for your new Verizon plan from there and everything so it all seemed very streamlined. The problem is, when we received the phone it could not activate. Something became stuck in the process of porting the number. I spent a large portion of a weekend on the phone with Verizon support. They were able to port the number over but it became stuck in their system, which they said could take 7-9 more days to resolve. We were exasperated at this point, so we just went into the Verizon store on Monday and said forget it, we don’t even care if we lose the old number. Their response to us? Can’t touch it. You ordered the phone through Apple so we can’t work with it. We ended up buying two completely different phones and returning the first to Apple. We also both got new numbers instead of having Verizon port our old ones over.

Eventually we were able to run blissfully through fields with new iPhones and everything worked great, but it was a painful process to get there. Below are my tips on how to avoid this.

  1. Order your phone either through the actual Verizon store or off of their website. According to the guy I talked to they cannot work with any other devices if you bring them in, not even from their resalers in the same area.
  2. If you’re going to order the phone off of Apple.com or another site instead of the Verizon one, opt to get a new number. The guy I talked to said this is always how they do transfers. They get the phone up and running with a temporary number and then port over your old one.
  3. Instead of bringing your old number over to the new carrier at all, make it a flexible virtual number by transferring it to Google Voice. This is what we did with my number. I can now point it at any device, including my new cell phone. I can even tell the service to ring the house phone or my wife’s if I don’t answer. There are a wide range of features and there is only a $20 one-time fee for transferring a current number.
  4. No matter what option you choose for porting an old number over, DO NOT touch the old service until EVERYTHING is up and running. This causes bad things to happen. Just let it sit completely alone. Don’t even have your old phone on. The systems don’t play nicely together otherwise.

I hope you can avoid my pain and suffering. In the end, having known a few simple things would have probably made the process go flawlessly.

Welcome!

Welcome to my site!

I’m glad you stopped by and I hope it will be a blessing to you. My goal is to share all I can about God, family, and tech with you. For more insight into who I am check out the About Me page. Otherwise stay tuned for more content coming soon!