Category: Database

Microsoft SQL Database Stuck in Restoring Mode

These are the possible resolutions from highest to lowest recommendations -- Normal method of restoring…

Enable Jumbo Frames on a Windows Host

Overview: Whether the engineer or sysadmin works in the realm of 'networking', 'database', or 'Windows',…

Latin1_General_CI_AI vs SQL_Latin1_General_CP1_CI_AS

The SQL_Latin1_General_CP1_CI_AS collation is a SQL collation and the rules around sorting data for unicode…

PowerShell: Backup, Archive, and Remove a Microsoft SQL Database

$sqlServer='sqlsherver007' $databaseName="someDatabaseName" $saCredential=get-credential $backupDestination="\\Archive03\MSSQL_Backups" function triggerSqlBackup($sqlServer,$databaseName){ # Ensure the the Jump Box has SQL PowerShell…

PowerShell: Microsoft SQL Database Migration

Update 9/25/20: There's another version of this script has has been rewritten form scratch. IMO,…

PowerShell: Obtaining SQL Database Default Paths

# This function returns an array of 3 string values reflecting default Data, Log, and…

Loading the SQL Server Management Objects (SMO)

function loadSMO{ $ErrorActionPreference = "Stop" $sqlpsRegistry="HKLM:\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.SqlServer.Management.PowerShell.sqlps" try{ if (Get-ChildItem $sqlpsRegistry -ErrorAction "SilentlyContinue") { throw "SQL…

PowerShell: Automating Microsoft Failover Cluster Maintenance – FileServer, SQL AlwaysOn, Hyper-V Guest VMs, Disks Operations

##################################################################################################### # MsClusterMaintenance_v0.0.2.ps1 # Author: KimConnect.com # License: GPLv3 # Description: this program automates the…

PowerShell: 1-Liner to Discover SQL Servers on the Network

Run this command on server with SQL CLI installed (this will only detect SQL servers…

Microsoft SQL Server Storage Capacity Planning

This would be a recommended mounted volumes for most environment: 80GB RAID10 C:\ Operating System…

MS SQL: Admin_Report_Notification

/* Admin_Report_Notification */DECLARE @tab char(1) SET @tab = CHAR(9)EXEC msdb.dbo.sp_send_dbmail@profile_name = 'Report DBMail Profile',@recipients =…

MS SQL: Archive and Shrink Database

--Archive Database: with maximum allowed runtime and a set number of recordsdeclare @EndDate datetime, @Recs…

PowerShell: Microsoft SQL Administration

Script to Install Microsoft Clustering Service $proxy="http://proxy:8080"$exclusionList="localhost;*.kimconnect.com"function checkProxy{try{$connectionTest=iwr download.microsoft.com#$connectionSucceeds=Test-NetConnection -Computername download.microsoft.com -Port 443 -InformationLevel Quietif…

MS SQL: Using Profiler to Trace Failed Logins

Story: There has been an issue with a service account triggering login errors at the…

SQL Language (Condensed)

SELECT [DISTINCT | MIN | MAX] column1 [AS alias]FROM table_nameWHERE condition [IS NULL|IS NOT NULL]…

Some Old SQL Snippets

--Visibar_TestSELECT STK_ROOM, BIN, INV_CODE, LOC_DESCFROM LOCATION_DESCRIPTIONWHERE (STK_ROOM IN (@Stock)) AND (BIN IN (@Bins)) -- Query…

MongoDB: Backup and Restore

Manual Methods:Using mongodump and mongorestoreMaking a backup using mongodump- Permissions required: grant find action, backup…

Some MySQL Admin Stuff

make sure it's running ps -ef | grep mysql Creating MySQL DB HOWTO on creating…

Install phpMyAdmin in Centos 5.3

# Prerequisite: must install RPMForge Repo prior   yum install httpd php php-mysql php-gd php-mbstring…

MySQL on Localhost

Modern versions of MySQL is memory intensive; thus, it is a pre-requisite that an adequate…