SQL Alert when you’re low on disk space

Resources, SQL
I found this gem while troubleshooting a SQL Server with a backup drive that filled up often. It uses the WMI provider will alert when ANY drive on the server goes below 10GB. You can change the value '10000000000' below to adjust this. You'll also want to change your operator from 'Support' to your operator name.  Note that this requires Database Mail to be set up with an operator and valid email. Should work for SQL 2005 thru 2012 as is, mine was set up on SQL 2005. The ability to use WMI Provider in SQL Alerts seems very useful, I have seen uses for WMI SQL Alerts, but they involved more code than just creating the alert. If you're interested in exploring the metrics WMI exposes to you, check out…
Read More

Copying indexes from Oracle to SQL Server

Oracle, Resources, SQL
I'm working with a client that has access to an Oracle 10g database containing transactional data that they copy to their new SQL Server 2012 as a data warehouse. (We recently migrated the straight from SQL 2000 into SQL 2012, but that's another story.) They already had scripts to copy the tables and data to a staging database, and then copy new records to their data warehouse. Queries were slow against this data, as no indexes were created on the target tables. I wanted to copy the Oracle indexes to SQL Server, but found no simple way to do this, so I created a script to do so. I used Toad for Data Analysts to connect to the Oracle database, which is a really fantastic program for working with Oracle.…
Read More