Author: Peter Whyte

  • DBA Scripts: Get OS and Hardware Info

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Server & Configuration › Server Inventory What Is This Server Actually Running On Before you can reason about performance, capacity, or whether a setting makes sense, you need the basics: how much CPU and memory the box actually has, what OS it’s running,…

  • DBA Scripts: Generate Restore With Move Script

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Migration & Deployment › Migration Script Generators Generating RESTORE … WITH MOVE for a Different Drive Layout Restoring onto a server whose drives do not match the source means naming a WITH MOVE clause for every database file. This script writes them for…

  • DBA Scripts: Generate Linked Server Script

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Migration & Deployment › Migration Script Generators Recreating Linked Servers and Login Mappings for a Migration If linked server queries fail on the new server after a migration, with Msg 7416 Access to the remote server is denied because no login-mapping exists or…

  • DBA Scripts: Generate User Mapping Script

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Migration & Deployment › Migration Script Generators Recreating Database Users, Roles, and Role Memberships for a Migration The databases are moving to a new server and the users, custom roles, role memberships and database owner have to match the source, including after a…

  • DBA Scripts: Generate Agent Job Script

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Migration & Deployment › Migration Script Generators Recreating Every SQL Agent Job for a Migration, in the Right Order The new server is up and its SQL Agent jobs are not, or a DR target needs the same jobs as production before cutover.…

  • DBA Scripts: Generate Login Script

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Migration & Deployment › Migration Script Generators SID-Preserving Login Recreation for a Migration The databases are restored on the new server and every database user comes back orphaned, or the application’s login is refused. Both trace back to logins recreated by hand with…

  • DBA Scripts: SQL Agent and Jobs

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Maintenance & Automation A SQL Agent job that silently stopped running is one of the quietest failure modes in SQL Server, nothing errors, nothing alerts, the maintenance work it used to do just stops happening until someone notices the symptom weeks or months…

  • DBA Scripts: SQL Server Maintenance Job Framework

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Maintenance & Automation If you’re already running Ola Hallengren’s maintenance solution, this framework won’t replace it, but the approach might still be useful: three small, readable T-SQL generator scripts that build the same category of scheduled job framework, full and log backups, backup…

  • DBA Scripts: Generate Index Maintenance Jobs

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Maintenance & Automation › Maintenance Job Framework A Readable Generator for Index Rebuilds and Statistics Updates If you’re already running Ola Hallengren’s maintenance solution, this won’t replace it, but the approach here might still be useful: a small, readable T-SQL generator that builds…

  • SQL Server Replication Monitoring Scripts

    This is the set I reach for when replication starts acting up. Latency creeping, agents stuck, or subscribers falling behind, these queries cut through the noise fast. I’ve used them in production environments for years. What’s Inside If you run transactional replication, keep these handy. They save time when things go sideways. For the full…