Category: Scripts

  • Database Permissions extraction script

    Database Permissions extraction script

    Dear DBAs, Few days back one of my junior colleague reported me that while performing database refresh, he extracted the permissions of database before refresh and applied the permissions back on it after restore but still all permissions were not applied correctly and user is reporting access related issues. I checked and found that the…

  • SQL DBA Cheatcode Part 3 : Few Important Queries for any DBA

    SQL DBA Cheatcode Part 3 : Few Important Queries for any DBA

    In continuation of our DBA Cheatcode series :-   I started this series on Queries\T-SQL commands that we use in our day to day operations or those queries which should be handy for any SQL DBA(Junior or senior) out there. In this series, I’ll try to share as many queries as I have or I…

  • How to move Indexes (Cluster and Non Cluster) from Primary File group to New File group?

    How to move Indexes (Cluster and Non Cluster) from Primary File group to New File group?

    How to move Indexes (Cluster and Non Cluster) from Primary File group to New File group?

  • How to create Drop and Recreate Script of all Indexes in a database?

    How to create Drop and Recreate Script of all Indexes in a database?

    I found this interesting script once so thought of sharing with everyone. Special thanks to the Unknown-Creator of this script.  This script generates the ‘create’ & ‘drop’ index script for each and every index in a database. I have tried this number of times and it does what is expected from it. What all you need…

  • SQL DBA Cheatcode Part 2 : Few Important Queries for any DBA

    SQL DBA Cheatcode Part 2 : Few Important Queries for any DBA

    Hi Friends, From last few days, I was thinking about writing a series on Queries\T-SQL commands that we use in our day to day operations or those queries which should be handy for any SQL DBA(Junior or senior) out there. In this series, I’ll try to share as many queries as I have or I…

  • SQL DBA Cheatcode Part 1 : Few Important Queries for any DBA

    SQL DBA Cheatcode Part 1 : Few Important Queries for any DBA

    Hi Friends, From last few days, I was thinking about writing a series on Queries\T-SQL commands that we use in our day to day operations or those queries which should be handy for any SQL DBA(Junior or senior) out there. In this series, I’ll try to share as many queries as I have or I…

  • Common Human Errors as DBA (part 2)

    Common Human Errors as DBA (part 2)

    You must have read my previous post (Part-1) about Common Human Errors as DBA and how to avoid them. Here is another post of the same series. Third error – Data or Log file Shrinking – sometimes, one may not be checking how much free space is available in data or log files and shrinking databases…

  • Hide Your Real Data – Data masking/ Data Scrambling/ Data Obfuscation

    Hide Your Real Data  – Data masking/ Data Scrambling/ Data Obfuscation

    Data masking/ Data Scrambling/ Data Obfuscation – is the task for hiding actual data before sharing it with Users, UAT Testers, Vendors, Developers or anyone else who MUST NOT have access to production data or real time data. A DBA must proactively take care of this task if no one informed about the requirements. Sensitive…

  • Common Human Errors as DBA (part 1)

    Common Human Errors as DBA (part 1)

    “Human Error” is not a new word. Most of the time if there is screwed up done by any one – these golden words are used. For sure, these are the Human Errors and its hard to control. Here I am trying to consolidate some common human errors that are done by DBAs at different…

  • Database Accidents : Unwanted Restore

    Database Accidents : Unwanted Restore

    Number of times, while working as a DBA many accidents happen. Most common of them is when a database is restored without checking if a backup is available or not. As a thumb rule – a DBA must take backups of everything before performing any action. At any point of time, I must be in…