Posts

Monitor backup and restore progress in SQL Server

If the backup or restore is running from a SQL Agent job or maybe someone kicked off the process from another machine, you can use DMV -  sys.dm_exec_requests  to find the progress.   I really thank Microsoft for introducing DMV's and making a DBA's life a lot easier. You can run this script, which will give you output simliar to to the screenshot below. Here we can see the percent complete and estimated completion time. This script will work for any backup or restore that is currently running regardless of what method was used to run the backup or restore. SELECT session_id as SPID,  command,  a.text AS Query,  start_time, percent_complete,  dateadd(second,estimated_completion_time/1000, getdate()) as estimated_completion_time  FROM sys.dm_exec_requests r  CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) a  WHERE r.command in  ('BACKUP DATABASE','RESTORE DATABASE')

How to Tweak the New Multi-Monitor Taskbar in Windows 8

Image
For years, users have wondered why on earth Microsoft wouldn’t make the taskbar customizable and usable across multiple monitors. The release of Windows 8 won’t tell us why it took so long, but at least we’ll get some new features. Here’s a quick look for those that haven’t already seen them. The new Taskbar in Windows 8 finally spans multiple monitors, and can be customized so that the taskbar buttons on each monitor are the buttons for windows open on that monitor. You can also make both taskbars show all windows if you choose. To access the new settings, head into Taskbar Properties by right-clicking on the Taskbar and choosing Properties. Once there, you’ll see the “Multiple displays” section at the bottom of the dialog, where you can quickly check the box to enable or disable showing the taskbar across displays. The “Show taskbar buttons on” drop-down lets you choose where the buttons appear. For example, the screenshot at the beginning of this article was from t...

Find PID of process that use a port on Windows

netstat -a -n -o | find "123456"

Port 80 occupied by System

J ust follow these steps to diagnose and resolve your issue: Get pid that is listening port 80:  netstat -nao | find “:80″ Open task manager, go to processes tab and check “PID” in  Menu/View/Select Columns… , then look for the process using the PID found in last step. If it is a  normal application  or IIS, disable it or uninstall. Some programs (such as Skype) have the option to disable its use of port 80. If it is a  System Process —PID 4—you need to disable the HTTP.sys driver which is started on demand by another service, such as Windows Remote Management or Print Spooler on Windows 7 or 2008. There is two ways to disable it but the first one is safer: Go to device manager, select “show hidden devices” from menu/view, go to “Non-Plug and Play Driver”/HTTP, double click it to disable it (or set it to manual, some services depended on it). Reboot and use  netstat -nao | find “:80″  ...

Net Tcp Binding not working after system restart

Hacky (unacceptable) Workaround:  I can get it working again if  I remove NET.TCP from the site's EnabledProtocols  Iisreset  Add NET.TCP back to the site's EnabledProtocols.  The site continues to work until iisreset is issued again. IIS is doing something when I add NET.TCP to the EnabledProtocols that isn't happening when IIS starts when NET.TCP has already been added.  

WCF - Error 500.21 Handler "svc-Integrated" has a bad module "ManagedPipelineHandler" in its module list"

WCF - Error 500.21 Handler "svc-Integrated" has a bad module "ManagedPipelineHandler" in its module list" If you  see this error you havent installed the prerequistes for ASP.NET 4. Try this Open Visual Studio Command Prompt Type the following:  aspnet_regiis.exe -i Run the command Try your service again...  Happy Face - it should be working :-)   This basically installs the necessary ASP pieces to get your service up and working!

Backing up a complete database

This script will take a full database backup to disk BACKUP DATABASE AdventureWorks2012 TO DISK = 'T:\Backups\AdvWorksData2015.bak' WITH FORMAT; GO Although there are other options available in the backup database command, this one is the simplest. Nothing geeky in the new year post :)