Wednesday, June 15, 2005

ORACLE: Enabling function-based indices (indexes?)

I was happily using function based indices to provide case insensitivity like so:

CREATE UNIQUE INDEX MyIndexName ON MyTable (
LOWER (SomeColumn) ASC
);

Worked like a charm. The uniques was case insensitive and the normal query like:
SELECT blah, foo, bar
FROM MyTable
WHERE LOWER(SomeColumn) = LOWER (:bindparam);

was happily using the index.

Until one day at (naturally) a client site, one of my fellow engineers found that the above query was performing a full table scan. And, despite what Tom Kite keeps saying, in this case, a full table scan is bad.

Only after some spelunking through Tom's Book Expert One-on-One Oracle did I find the magic. The database needs the following session/system variables in place to actually use the function-based indices:
QUERY_REWRITE_ENABLED=TRUE
QUERY_REWRITE_INTEGRITY=TRUSTED

I'll chock these up to the huge pile of stuff that "Oracle needs to have to work the way it should but is next to impossible to find unless you already know it."

Hopefully this saves someone else some time.

[Listening to: Tripping Daisy - Piranha]

Wednesday, June 08, 2005

Enabling the "Shut Down" option in Windows Server 2003

Once again I spent way too long trying to figure out how to allow my non-administrator user the ability to shutdown windows. Strangely enough Google was of little help. I guess the terms "shutdown", "enable", "user", "dialog" are too vague?

By default a normal user only has log off username in the list of options when you hit shutdown from the start menu. Just so I don't have to search for this again:

Run Administraive Tools/Local Security Settings
Navigate to:
Security Settings/
Local Policies/
User Rights Assignment/

Add the user/group in question to "Shut down the system".

Also, just in case others fall into the same trap, here's some food for the GoogleBots:
"shutdown windows" dialog "log off" enable
"shutdown windows" dialog "log off" allow
"shutdown windows" dialog "only log off"
"shutdown windows" dialog "shut down missing"
"shutdown windows" dialog missing
"shut down windows" dialog missing
"shutdown privilege" "windows 2003"
"shutdown privilege" "windows server 2003"
enable shutdown windows server 2003

Thursday, June 02, 2005

Assert.IsEqualGraph -- Comparing object graphs

Keith Brown over at PluralSight has a useful method to Assert the equality of 2 object graphs: Assert.IsEqualGraph.

I have a couple other quasi-useful Assertion type methods that I'll post here (if I ever get around to using the stupid computer again that is.)

[Listening to: Ozzy Osbourne - Over the Mountain]