Introduction to Powershell
Easy Index suggestion
DECLARE @DBID INT SELECT @DBID = DB_ID() SELECT OBJECT_NAME([OBJECT_ID]) ‘TABLE NAME’,INDEX_TYPE_DESC ‘INDEX TYPE’,IND.[NAME],CASE WHEN AVG_FRAGMENTATION_IN_PERCENT <30 THEN ‘To Be Re-Organized’ ELSE ‘To Be Rebuilt’ END ‘ACTION TO BE TAKEN’ ,AVG_FRAGMENTATION_IN_PERCENT ‘% FRAGMENTED’ FROM sys.dm_db_index_physical_stats(@DBID, NULL, NULL, NULL, NULL) JOIN sys.sysindexes IND ON (IND.ID =[OBJECT_ID] AND IND.INDID = INDEX_ID) WHERE AVG_FRAGMENTATION_IN_PERCENT > 0 AND DATABASE_ID = […]
Install SQL Server in Linux Server 7.3
HI All Microsoft SQL Server vNext (CTP1) – 14.0.1.246 can now be installed on Linux. I am using Google Cloud Platform to create it.you can do this using https://console.cloud.google.com. get free google cloud usage worth 300 $. I have selected Red Hat Enterprise Linux 7. It requires minimum RAM of 3.5 GB.so i have selected n1-standard-2 (2 […]
Database Mail not working with GMAIL
Before starting the blog ,i have to thank Mr.Abdul Fareed he is the man behind the blog enable database mail using the below command sp_configure ‘Database Mail XPs’,1 reconfigure with override You can configure database mail from here. After configuring database mail you have to change the Gmail setting if you are getting the below […]
Execute SQL Server Query on Multiple SQL Servers using Powershell
Hi Folks Last week i had a chat with my friend Raj. he want to execute a query on multiple SQL Server. I suggest him to create a script using CONCATENATE,But he was not satisfied with my Answer. so i decided to automate this here is the script here is the code requirements create a […]
SQL Server Installation Using Configuration File
In this installation sql server required settings are saved to a configuration file and this file is used as a parameter to install sql server. Configuration file creation is a one time job. And this is done as below Run setup.exe as attended installation(GUI) based installation select your requirement once when you are done with […]
Who altered the user roles
Hi Folks If you want to trace out who have alter the user roles in the SQL Server.here is the simplest way. Open SQL Server management studio and execute the below query select * from sys.traces Copy the output of sys.traces and replace it in the query path of below query SELECT TextData,StartTime,NTUserName,ApplicationName FROM fn_trace_gettable(‘C:Program […]
When does DBCC Checkdb gets completed
When the database CHECKDB task gets completed .This does is a frequent question asked my Team Leads/Managers or else any one. Buy UN fortunately SQL Server Management Studio does not help us n o this. No Worries we from SQL Server 2005 and above we have DMV to help us out. use master go SELECT […]
SQL Server DBA Team Knowledge Wave 1
Please register for Junior SQL Server DBA What to do & What not to do on Sep 13, 2014 2:00 PM IST at: https://attendee.gotowebinar.com/register/1233616123437806338 This webminar is usefull to the Junior DBA. Best Practices to follow SQL Server Optimal Settings. Database Optimal Settings Monitoring SQL Server Performace Activity Monitor Perfmon Change log how to do […]