Monthly Archives: May 2015

Firefox 38 slow as hell – fix

Firefox 38 is extremely slow, typing is slow, switching tab is slow, pretty much every you do is incredibly slow. Firefox has acknowledge this issue, firefox update 38 slow

While they have advised their solution which did not quite work for me, here is my easy solution.

Uninstall Firefox and Download Firefox 37, problem solved.

Login timeout expired LinkedServer SQL

I had a database crash, after restoring it my linked queries which were working perfectly fine started to give this error

Login timeout expired

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.

I spent quite a bit of time on it but couldn’t find the cure. Eventually found this stackexchange post  which sort of put me in right direction. The answer says

SQL Agent will use Shared Memory to connect to the local server. The Instances will attempt to use named pipes to talk to each other. You can adjust this by creating an alias in the SQL Server Client Network Utility (cliconfg.exe) and setting the alias to use TCP.

What I did here is run cliconfg.exe, added a server alias and set it to use TCP, I then went to SQL Server Configuration Manager and enabled TCP (which was disabled) and the query ran flawlessly!

No exactly sure if adding alias was required but the issue is not resolved. This is for SQL Server 2005.

How to setup WAMP virtual hosts

In this tutorial, I will be showing how to install WAMP or port 8080 (default port is 80) and how to setup WAMP. For me basically everything went fine. The problem I encountered was when setting up the virtual hosts. Download WAMP here and Install. Use a good text editor such as Sublime Text

1. Navigate to C:\wamp\bin\apache\apache2.4.9\conf\httpd.conf and edit lined no 513, simply remove # sign in front of the line. This will enable virtual hosts

Include conf/extra/httpd-vhosts.conf

2. Navigate to line 240 and change the code as follows (change denied to granted). This will fix the issues you might encounter later when setting up virtual sites.

<Directory />
AllowOverride none
Require all granted
</Directory>

3. Edit Line 62 and 63, change ports to 8080 (default is 80)

Listen 0.0.0.0:8080
Listen [::0]:8080

4.  Now goto C:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf and edit/copy the following code. Make this file minimal as possible to avoid errors. Remove log files and other dummy email address.

<VirtualHost *:8080>
DocumentRoot “D:/Projects/website”
ServerName localsite
ServerAlias www.localsite
</VirtualHost>

<VirtualHost *:8080>
DocumentRoot “C:/wamp/www”
ServerName localhost
</VirtualHost>

5. Now start WAMP. You can do it from command prompt

net start wampapache

6. Access the site localsite:8080 (do NOT forget the port)

7. Make sure you have made an entry in Windows host file (location: C:\Windows\System32\drivers\etc\host) as such

127.0.0.1       localhost
127.0.0.1         localsite

If you get any error, reply in the comment below

 

Restore SQL Server 2005 Master Database

[SQL Server 2005 master Database Download 700 KB]

You are running SQL Server 2005, your master database has got corrupted because of sudden power failure or other reasons. The SQL Server will not start. You have tried registry setting, playing with changing protocol, disabled via protocol but nothing worked. Do do not have backup of the masters, there is no way you can start your server, you are on the versge of loosing all you precious data. Do not panic, you can recover it by copying a fresh master.mdf file but there are tricks so please read on.

1. The first hurdle is you do not have a backup of SQL Server 2005 master database. Well I have attached on master db SQL Server 2005. It is from fresh install and contains master.mdf mastlog.ldf files (both are required). When you copy this to the default location, all you existing logins will be lost which you can recreated. Also all the database will be detached which you will need to re-attached.

2. Depending on which version of OS are you using (32 bit or 64 bit), appropriate changes need to be made. If  your SQL Server folder is C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data that means you are using 32 bit  OS. In this case, copy the master and master log files in the folder and create another folder C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\DATA (note Program Files (x86) folder. This is required because the mdf files I created was on 64bit OS so the default path for other databases is this folder. If you already have C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\DATA as your current folder, simply copy the unzipped files and you should be all set.

3. If you were  using 32 bit OS (no x86 folder),  copy all the system databases into (x86) folder. They must be copied here so SQL Server can start. This step is required only for 32 bit OS.

4. Start SQL Configuration Manager and start SQL Server. It should not start.

5. In case of error,  got computer management, event viewer and see the error logs. If it is about missing a database etc, simply copy it to x86 folder.

6. In SQL Server Management Studio, attach  your database by right clicking on database and click attach. Select the mdf file of the database you want to attached.

7. Create new logins if needed.

Your database should be all set.

Please make sure to backup your database files just in case. Also note that I do not take any responsibility if anything goes wrong.


Error Messages  that I encountered  during trouble shoot

While troubleshooting my own problem, I received the following errors which I fixed by copying relevant data. The only way to find our the actual error is be looking at event viewer. I will leave the following error for reference purposes.

The first error that means my master database has gone corrupt. Most likely occurred because of power failure.

The log scan number (406:48:1) passed to log scan in database ‘master’ is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during startup.

After copying master.mdf and mastlog.ldf, I got this msg in event viewer

FileMgr::StartLogFiles: Operating system error 2(The system cannot find the file specified.) occurred while creating or opening file ‘C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mssqlsystemresource.ldf’. Diagnose and correct the operating system error, and retry the operation.

After creating x86 folder and copying the two files, I got errors about the other files

FileMgr::StartLogFiles: Operating system error 2(The system cannot find the file specified.) occurred while creating or opening file ‘C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\modellog.ldf’. Diagnose and correct the operating system error, and retry the operation.

 

Performance counter shared memory setup failed with error -1. Reinstall sqlctr.ini for this instance, and ensure that the instance login account has correct registry permissions.