Posts

Showing posts from November, 2018

Database Mirroring problem with SQL Server 2016 management Studio, ERROR :927

Image
Recently i have installed SQL SERVER 2016 RTM version on my machine and started working on it. One day  i have configured Mirroring and found the below error. The error showing as "Database sample is in the middle of restore".  First i though i am doing wrong. Later i realized that this is bug with Microsoft SQL Server Management Studio 18. Try the same steps with SQL Server Management Studio 2014, this works perfectly and you are able to configure database successfully

How to Start and Connect to MongoDB environment.

Image
---To Start MongoDB service run below command in command prompt with Admin privileges "C:\Program Files\MongoDB\Server\4.0\bin\mongod.exe"  ---To connect to the MongoDB environment run below command n command prompt with Admin privileges "C:\Program Files\MongoDB\Server\4.0\bin\mongo.exe" If you see below first i ran the command prompt with Administrator account but i have installed mongodb with 'Hi' account . So first i changed the user from Administrator account to Hi account by using CD Going inside of mongodb, open another command prompt and run the below command

Log_reuse_wait_desc showing as Availability_Replica

Recently in one my Always On Availability replica environment I got an issue where one of the availability replica database log file has grown completely, and we got a request to shrink the issue. When we run the below command we found that “log_reuse_wait_desc” showing as “Availability_Replica What this means is this indicates that the logged changes in the availability database at the primary replica that have not arrived and that these changes were applied to the availability database at one of the secondary replicas. Until logged changes arrive and are applied, the changes cannot be truncated from the availability database log at the primary replica. Troubleshooting: "Log Send Queue" and "Redo Queue" are measurable data points during availability database synchronization. You can monitor these data points in order to determine whether an availability database log cannot be truncated because of the log uses type AVAILABILITY_REPLICA. ·     Log Send

Log Re usage Wait Desc showing as Availability_Replica

https://support.microsoft.com/en-us/help/2922898/error-9002-the-transaction-log-for-database-is-full-due-to-availabilit Log_re_usage_wait_desc showing as Availability_Replica

Getting mount points/drive/disk free space available information in PowerShell, Send-MailMessage

CLEAR # This will output specific details for mountpoints $TotalGB = @{Name = "Capacity(GB)" ;expression = { [ math ]:: round(( $_ . Capacity / 1073741824 ) , 2 )}} $FreeGB = @{Name = "FreeSpace(GB)" ;expression = { [ math ]:: round(( $_ . FreeSpace / 1073741824 ) , 2 )}} $FreePerc = @{Name = "Free(%)" ;expression = { [ math ]:: round(((( $_ . FreeSpace / 1073741824 ) / ( $_ . Capacity / 1073741824 )) * 100 ) , 0 )}} function get-mountpoints { $volumes = Get-WmiObject win32_volume -Filter "DriveType='3'" $volumes | Select Name , Label , DriveLetter , FileSystem , $TotalGB , $FreeGB , $FreePerc | Format-Table -AutoSize } get-mountpoints ------another query we can use the below one clear #servername $servers = @( "server1" , "server2" ) Get-WmiOBject ` -ComputerName $servers ` -Class Win32_Volume | Select-Object @{N = "Name" ;E

Getting Drive space information through PowerShell.

Invoke-Command ` -ComputerName "ServerName" ` {     Get-WMIObject   Win32_Logicaldisk |     Select-Object PSComputername , DeviceID , @{Name = "SizeGB" ;Expression = { $_ . Size / 1GB -as [ int ] }} ,     @{Name = "FreeGB" ;Expression = { [ math ]:: Round( $_ . Freespace / 1GB , 2 )}} } ` -Credential "UserNameHere"