A good defrag script is worth its weight in gold. This time, I copied this from Microsoft and am shamelessly posting it here because I don't know when MS will bury it somewhere where it cannot be located anymore! Just because you de-fragmented does not actually mean that it did it! It means, it tried. … Continue reading SQL Server: Identify And Defragment Indexes Using DBCC SHOWCONTIG & DBCC INDEXDEFRAG
Requirement: Recently I got a request from a user that he wanted to copy a specific set of tables and their indexes into a new database to ship to the vendor for analysis. The problem was that the DB had thousands of tables (8,748 to be precise). Hunting and pecking for specific tables from that … Continue reading PowerShell – Copy SQL Server Tables – Structure, Data & Indexes To Another Database/Instance
Today, as I was working with a table and I needed to find the “archived” version of the table. Typically, the archive table would have a name with “Archive” suffixed to the actual table name. Since I could not find the archive table by just matching on the table name, I had to improvise. I … Continue reading SQL Server – Find Tables With Similar Table Structure
Same SQL written in 3 different ways “There are a thousand ways to skin a cat” or so they say. Let us look at just three ways of writing the same SQL and build the case for using the USING clause. The query below is to get the current Oracle session’s effective “parallel” related parameter … Continue reading Oracle – Simplify Your Joins – Using “USING” In JOIN Clause?!
Oracle's logical storage structures: To developers who work with Oracle, the concept of tablespace is familiar. We create tables and indexes in tablespaces taking appropriate care not to place all of our data into one tablespace. Let us take a quick look at the logical structure of an Oracle database A database has one or … Continue reading Oracle’s APPEND Hint – The Key Secret To Fast BULK Loading With NOLOGGING!