Signs and Travel Advisories

Tags: programming

Blinders, blinkers, and winkers are three names for the same class of horse gear. Coming in various shapes and sizes, they all keep horses focused on the road ahead by blocking out distractions.

Humans, though, are different. We’re so smart that we don’t need to put blinders on to completely ignore the obvious information at our periphery, even when it’d do us some serious good. Our intent and determination can blind us to even the most obvious signs of disaster, and more subtle clues can be missed even when we’re carefully searching.

Way Wrong Wrong Way

I use the Oracle Instant Client on a number of systems, and I’ve always used a URL format similar to that of Oracle’s Java thin client connections. From within Python’s SQLAlchemy toolkit, the URL format looks like:

oracle://user:password@hostname:port/database_sid

Systems with TNS configurations can alternatively use the following format:

oracle://user:password@tnsname

I was feeling a bit sorry for myself, because I was using the Instant Client rather than the full blown Oracle client complete with a tnsnames.ora definition file. This meant manually updating connection strings for a number of schemas that had migrated to another data center. While doing the updates, I tried to use the Oracle service name rather than database SID, as that would be one less thing to change after future migrations, but I couldn’t see a way to use a service name rather than SID name through SQLAlchemy’s configuration mechanism.

SQLAlchemy and cx_Oracle are both open source. This could be a fun thing to fix! With a fresh virtual environment and dependencies downloading, I filled the download time by reading the Instant Client FAQ. Right in the middle was this gem::

Naming methods that require TNS_ADMIN to locate configuration files
continue to work if the TNS_ADMIN environment variable is set.

Oh. So I can set a TNS_ADMIN environment variable just like with a full client install? So I’m done? No code change needed. I could have avoided all of this trouble in the first place had I read through the documentation more carefully when I started using the Instant Client.

There’s a happy balance between immediately jumping into action and hunkering down with documentation and research. I struggle with finding that middle path. I live at both ends of the spectrum depending on the subject.

For instance, technology and programming challenges ahead? Let’s get to work! We’ll figure it out as we go!

Meanwhile, when I should write a landing page to gather interest in a course I’d like to offer, I stall. “Not yet”, I say, “I need to read these 27 books on marketing and adult learning.”

Are you blowing past helpful signs and travel advisories on your way to a goal, or have you spent so much time studying the atlas that you’re still right where you started?