Configure SQL Server DBMAIL using T-SQL
Configuring dBMail involves 3 main steps Step 1: Creating Mail Profile Step2: Creating Mail Account Step3: Mapping Account to Profile. Below script will let you do this 3 steps and configures your...
View ArticleHow to bring a database online which is in restoring mode ?
For Example, In log shipping the secondary or a stand-by database will be in restoring mode while applying the logs from primary for every 15 minutes. In order to perform a DR test, we need to bring...
View ArticleSQL Server 2012- Sample Databases
I was not able to find the sample databases for SQL server 2012 as most of the sites I have visited have only 2000 sample databases which we will be not able to restore to 2012. Here I have uploaded...
View ArticleAll about SQL server Statistics in simple words:
What is SQL server Statistics? SQL Server statistics will be used by optimizer to create the optimized execution plans where estimating the number of rows that can be returned, density of pages and...
View ArticleFinding top 10 large tables in each database in an instance of SQL server
It is a good practice to find and monitor your large SQL server tables, we may surprise in some cases where our large audit or logging tables that are not being cleaned up frequently and fill into...
View ArticleHow to run a SQL Query on list of servers and save output to excel using...
You will see how much is powershell is useful for DBA after using this script. Step 1: Create a text file with list of servers you want to run the script on and name it ‘serverlist’ to...
View ArticleHow to list SQL Server Service Accounts using T-Sql?
There might be times for audit to list all the service accounts from all SQL Servers, In order get this done we need a flexible SQL script to run and get them listed. Here is the script
View ArticleDatabase Mirroring Failover- all databases in a instance
--Script to failover all databases in a instance. declare @mirroring table (query varchar(200)) insert into @mirroring select 'use master;' insert into @mirroring SELECT ' ALTER DATABASE...
View ArticleAuto Fix orphan users on all Databases
DECLARE @DB_Name varchar(100) DECLARE @Command nvarchar(2000) DECLARE database_cursor CURSOR FOR SELECT name FROM sys.databases where database_id>4 and name not like '%master%' OPEN...
View ArticleHow to backup couchbase buckets and upload to S3.
This script can be configured in cron job to scheduled to run hourly and i will create one repo everyContinue reading
View Article