BibleGateway.com Verse Of The Day


“ Now Jesus was going up to Jerusalem. On the way, he took the Twelve aside and said to them, “We are going up to Jerusalem, and the Son of Man will be delivered over to the chief priests and the teachers of the law. They will condemn him to death and will hand him over to the Gentiles to be mocked and flogged and crucified. On the third day he will be raised to life!”” (Matthew 20: 17-19)  listen to chapter  (Read by Max McLean. Provided by The Listener's Audio Bible.)

Powered by BibleGateway.com

Friday, March 14, 2008

Trashy Yet Effective Oracle Trick

I need to post this so I can remember it next time I screw up...


I was running an Oracle import (imp) on my local Oracle 10g XE instance today, and realized I did it incorrectly and imported everything into the SYSTEM schema. Oh crap, I can't just wipe everything out, it's my SYSTEM schema! I need surgical precision to only remove the crap and leave all the Oracle stuff unscathed.

I could go through and drop each table I created, but there were hundreds.

Then, like a tornado in a trailerpark, it hit me. An idea that walks the fine line between genius and insanity. All the new table names started with a common prefix, which for sake of discussion I will call "BLAH_". So in Squirrel I run the following query:

select 'drop table system.' || table_name || ';' from all_tables where owner = 'SYSTEM' and table_name like 'BLAH_%'

Then cut and paste the results back into the Squirrel query runner and run the results as a script.

I'm sure there's an "official" way to accomplish the same thing, but screw that, this was extremely quick and kind of fun.

Trashy yet effective.

No comments: