Sometimes I get really frustrated by the things I used to know, but somehow forgot.
For instance, I USED to know that, in a relational database, nothing is ever always true.
Huh?
Perhaps an example will be illuminating.
Indexes - we are told that they help reads and hurt writes. I suppose that's true, on some level, because of the processing the RDBMS has to do in order to perform the actual operation of writing to the table, and updating the indexes.
However, I had a situation today wherein I found myself creating an index to DRAMATICALLY speed up a write operation.
Both for a delete where and an update where, adding the index cut the execution (in DB2, measured in timerons) by 60 - 80 %. Wow.
Honestly, I should have known this. I've been doing this for a while. I get used to pat ideas and the looking at a problem in a very particular way, or on a small set of data.
Bottom line, in relational databases, nothing ever always.
Thursday, August 29, 2013
Tuesday, July 30, 2013
It's so weird to me ...
Spent the morning trying to decide if/how to write about my daughter, Livie's week at Baptist summer camp.
It's just so weird to me ...
I read verses like this, and they humble me: http://www.biblegateway.com/passage/?search=Isaiah+55%3A9-10&version=NIV
But, in spite of such reminders, we try so hard to make the working of the cosmos fit our strict cosmological views.
I've heard the idea expressed, again and again, by people of great faith, that their entire faith somehow falls flat on its face if the first couple chapters of Genesis are not a literal, accurate historical record.
Wait; what? Why?
Because the Holy Spirit could never inspire an allegory or morality tale that, while holding great Truth, nonetheless wasn't literal, historical fact? (See parables of Jesus)
Because we know the mind of God, and he would never bring to fruition His great Creative Work through a process so unintuitive as billions of years of the emergence of Life through a bottom-up process, rather than sort of drawing us in the dirt like a back-yard football play?
Because the Spirit of the Living God could not possibly be present in the very cells and subatomic structures and the fundamental Nature of living beings as they grow and change and reproduce as the eons go by?
Because it would be so sensible for an omnipotent God to create men with curious nature, put them in a garden, give them infinite time, access to sin, and the presence of a tempter; and then say "Woah, what? Boy, didn't see THAT coming." when they ate ... what was it? Not the fruit of the icky awful nasty sinfulness? No, the fruit of the knowledge of good and evil. There's a fruit for that? A literal fruit for that? OK...
Look, I respect that you believe that. I really do. For all I know, you could be right, and it really went down in exactly that way. I'm not saying it DIDN'T happen, just that I find it unlikely.
Neither am I saying that I believe in a godless form of evolution. Science doesn't talk about God because it's limitations prevent it from doing so. It's not designed for intuitive speculation, and it's not any good at discussing what it can't measure or observe.
What I AM SAYING is that it's so weird that we limit God in the ways we do. The argument I hear is "Jesus quoted from Genesis, so if Genesis isn't true (historical fact), then my entire faith collapses." My response: Jesus told parables. There's no reason Jesus couldn't use Genesis if it's a morality tale, or an allegory.
Why does science have to be the enemy? Why can science, in its limited but rather thrilling way, not be, after all these eons, finally giving us our first tentative glimpses into how God did what God did?
You don't have to buy that. You probably won't even actually hear it, if history is any guide.
But, please, please, please, do me this one favor:
Don't persecute and vilify those who really, truly do love Jesus and work hard every day to be His disciple, but don't buy into your version.
Especially my kids.
It's just so weird to me...
It's just so weird to me ...
I read verses like this, and they humble me: http://www.biblegateway.com/passage/?search=Isaiah+55%3A9-10&version=NIV
But, in spite of such reminders, we try so hard to make the working of the cosmos fit our strict cosmological views.
I've heard the idea expressed, again and again, by people of great faith, that their entire faith somehow falls flat on its face if the first couple chapters of Genesis are not a literal, accurate historical record.
Wait; what? Why?
Because the Holy Spirit could never inspire an allegory or morality tale that, while holding great Truth, nonetheless wasn't literal, historical fact? (See parables of Jesus)
Because we know the mind of God, and he would never bring to fruition His great Creative Work through a process so unintuitive as billions of years of the emergence of Life through a bottom-up process, rather than sort of drawing us in the dirt like a back-yard football play?
Because the Spirit of the Living God could not possibly be present in the very cells and subatomic structures and the fundamental Nature of living beings as they grow and change and reproduce as the eons go by?
Because it would be so sensible for an omnipotent God to create men with curious nature, put them in a garden, give them infinite time, access to sin, and the presence of a tempter; and then say "Woah, what? Boy, didn't see THAT coming." when they ate ... what was it? Not the fruit of the icky awful nasty sinfulness? No, the fruit of the knowledge of good and evil. There's a fruit for that? A literal fruit for that? OK...
Look, I respect that you believe that. I really do. For all I know, you could be right, and it really went down in exactly that way. I'm not saying it DIDN'T happen, just that I find it unlikely.
Neither am I saying that I believe in a godless form of evolution. Science doesn't talk about God because it's limitations prevent it from doing so. It's not designed for intuitive speculation, and it's not any good at discussing what it can't measure or observe.
What I AM SAYING is that it's so weird that we limit God in the ways we do. The argument I hear is "Jesus quoted from Genesis, so if Genesis isn't true (historical fact), then my entire faith collapses." My response: Jesus told parables. There's no reason Jesus couldn't use Genesis if it's a morality tale, or an allegory.
Why does science have to be the enemy? Why can science, in its limited but rather thrilling way, not be, after all these eons, finally giving us our first tentative glimpses into how God did what God did?
You don't have to buy that. You probably won't even actually hear it, if history is any guide.
But, please, please, please, do me this one favor:
Don't persecute and vilify those who really, truly do love Jesus and work hard every day to be His disciple, but don't buy into your version.
Especially my kids.
It's just so weird to me...
Tuesday, July 16, 2013
Getting immediate notifications for deadlocks in SQL Server
Today I learned that I can get immediate notification of deadlocks in SQL Server. This is very useful, since one of our applications is prone to deadlocks (due to it's remarkable configurability), and these can be difficult to reproduce, especially in production.
First - a disclaimer. This method does not email the deadlock graph to you, only an alert saying that the deadlock has occurred. It is assumed that you are running a server-side trace to capture the necessary information for trouble-shooting. This is only to give you the alert.
Info on the error message I encountered in using sqlmail with alerts:
Error: An attempt was made to send an email when no email session has been established
Link ; http://www.sqldbadiaries.com/2010/07/27/an-attempt-was-made-to-send-an-email-when-no-email-session-has-been-established-sql-server-2005/
Procedure for setting up alerts:
http://sqlmag.com/blog/enabling-email-alerts-sql-server-deadlocks
Test Script to simulate deadlock:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49692
First - a disclaimer. This method does not email the deadlock graph to you, only an alert saying that the deadlock has occurred. It is assumed that you are running a server-side trace to capture the necessary information for trouble-shooting. This is only to give you the alert.
- Assure that the 1205 message is actually logged. (very good info on this in Michael K. Campbell's article for Practical SQL Server)
EXEC master..sp_altermessage 1205, 'WITH_LOG', TRUE;
GO
- Assure that SQLMail is configured
- NOTE: The step I forget most often is to assure that mail is enabled under SQL Server Agent -> Properties, as is outlined here.
- Create an alert for 1205 message.
- Test with scripts found here: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49692
- NOTE: This will only set up the notification. You also have to configure a default monitor to detect deadlocks. The mail will only prompt you to go and have a look at the deadlock trace!
References used in compiling this procedure:
Info on the error message I encountered in using sqlmail with alerts:
Error: An attempt was made to send an email when no email session has been established
Link ; http://www.sqldbadiaries.com/2010/07/27/an-attempt-was-made-to-send-an-email-when-no-email-session-has-been-established-sql-server-2005/
Procedure for setting up alerts:
http://sqlmag.com/blog/enabling-email-alerts-sql-server-deadlocks
Test Script to simulate deadlock:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49692
Monday, July 08, 2013
backup Db2- unable to force applications
When trying to backup a db on db2 LUW 9.5, I get the following message, even after running quiesce.
SQL1035N The database is currently in use. SQLSTATE=57019
There is some good advice involving authority here: http://www.dbforums.com/db2/1663529-backup-db2-unable-force-applications.html#post6596923
However, it did not apply to my situation.
In desperation, I decided to just restart the instance.
When I did, I got an error indicating invalid credentials.
I had to go into the Windows Service and change the password for the user.
That cleared up the issue.
Whaddya know...
SQL1035N The database is currently in use. SQLSTATE=57019
There is some good advice involving authority here: http://www.dbforums.com/db2/1663529-backup-db2-unable-force-applications.html#post6596923
However, it did not apply to my situation.
In desperation, I decided to just restart the instance.
When I did, I got an error indicating invalid credentials.
I had to go into the Windows Service and change the password for the user.
That cleared up the issue.
Whaddya know...
Wednesday, July 03, 2013
DB2 (and WebSphere) infocenter vs Developerworks
Just a quick note for those who may encounter it.
IBM's InfoCenters, or the ones for DB2 and WebSphere at any rate, are great at containing a fantastic amount of words that really don't tell you anything.
For task-based procedures, I like to go to DeveloperWorks and do a site search.
IBM's InfoCenters, or the ones for DB2 and WebSphere at any rate, are great at containing a fantastic amount of words that really don't tell you anything.
For task-based procedures, I like to go to DeveloperWorks and do a site search.
Tuesday, July 02, 2013
Tips for working an office-style job from your home.
Tips for Working from Home:
Make a space
This
space needs to be comfortable, but not TOO comfortable, and have few
distractions. It needs to offer the
quiet environment you need and allow you to focus on your work without thinking
about kids or other distractions
Don’t watch the kids, do chores, etc
For full
time WFH, it is unlikely that you’ll be able to do your best work if you’re
also attending to children. This is the
reason a lot of people want to work from home.
I suppose if you can do it and get away with it, OK, but for me, they
would be wanting too much attention and cause too many interruptions. My
children know that, when Dad’s at work and the office door is closed, they stay
away. When my wife has to work, we get a
baby-sitter.
If
someone calls you and needs you to do something, say no. If the spouse wants you to watch kids while
they run errands, say no. You are AT WORK (PERIOD).
Create a social Context
The lack
of human contact can be very isolating.
Create your own social outlet through a religious organization, hobby or
enthusiasts group, etc. It’s tough to
justify this if you’re working long hours and you have a family, but, at least
for me, it really is necessary to maintain an even keel.
Pretend someone is watching you.
Discipline
is tough, and it’s easy to let it break down when no one can see what you’re
doing.
Get Exercise!
You don’t
realize how much you move when going to the office, and being at the
office. Much of this very simple
movement can be lost if you work from your home. It is VITAL that you find a way to get
exercise. Go for a walk over lunch, join
a gym, do tai chi, whatever suits you, but for heaven’s sake, do something!
Thursday, May 23, 2013
Find out where you're logged on
As a sysadmin, I end up logged in all over the place.
Periodically, I'm asked to change my password, and if I'm not logged out from every server, it can cause all sorts of issues.
Update: 2013-11-11
Ignore everything below. This is so much easier than I was making it.
PsLoggedOn will simply scan your network and tell you where you're logged on. Not sure how I missed this!
http://technet.microsoft.com/en-us/sysinternals/bb897545
Example:
PsLoggedon.exe -l MyDomain\MyUser
*facepalm*
___
There is a WMIC command that can be used to see where you're logged in at on the network. This is probably the recommended way if you're running newer servers.
L
However, we still have a lot of older servers that don't fully support WMIC. I therefore take the following approach:
From command prompt, run
I then run
Note the >>, so that the SERVERLIST.txt is not overwritten by the output redirection.
I then execute PSLOGGEDON (download from sysinternals/PSTools) as follows:
NOTE: loggedon_output.txt is not truncated at any point. If you're like me and tend to run this from the same place over and over again, you'll need to clean it up manually before you begin.
Good luck :-)
Periodically, I'm asked to change my password, and if I'm not logged out from every server, it can cause all sorts of issues.
Update: 2013-11-11
Ignore everything below. This is so much easier than I was making it.
PsLoggedOn will simply scan your network and tell you where you're logged on. Not sure how I missed this!
http://technet.microsoft.com/en-us/sysinternals/bb897545
Example:
PsLoggedon.exe -l MyDomain\MyUser
*facepalm*
___
There is a WMIC command that can be used to see where you're logged in at on the network. This is probably the recommended way if you're running newer servers.
L
However, we still have a lot of older servers that don't fully support WMIC. I therefore take the following approach:
From command prompt, run
NET VIEW | FIND /I "DB" > SERVERLIST.txtThis populates the list with all DB servers (per our naming conventions).
I then run
NET VIEW | FIND /I "AS" >> SERVERLIST.txtThis, per our naming conventions, appends the app servers (hosting jboss or WebSphere).
Note the >>, so that the SERVERLIST.txt is not overwritten by the output redirection.
I then execute PSLOGGEDON (download from sysinternals/PSTools) as follows:
for /F %i in (SERVERLIST.txt) do PsLoggedon.exe -L %i >> loggedon_output.txt 2>&1This will read the systems in SERVERLIST.txt and, for each one, execute the PSLoggedon.exe -L command. Output will be piped to loggedon_output.txt.
NOTE: loggedon_output.txt is not truncated at any point. If you're like me and tend to run this from the same place over and over again, you'll need to clean it up manually before you begin.
Good luck :-)
Subscribe to:
Posts (Atom)
Get Restart log using PowerShell
I'm often curious about a restart on a Windows server system. An easy way to get a list of the restart and what initiated it is to use t...
-
Most of what we're going to want to look at when you're having production issues are available through DMV's. If granti...
-
I’ve been having some trouble getting DBCA to run in order to create databases. Thought I’d share it with you, and thus document it for la...
-
I'm often curious about a restart on a Windows server system. An easy way to get a list of the restart and what initiated it is to use t...