One of the first things you will want to do after installing visual studio is to set it up to automatically pull down the correct symbols for system components when debugging. You do this by configuring Visual Studio to use the Microsoft Symbol Sever.
In VS 2005, do the following:
- Open Visual Studio. Goto Tools->Options
- Expand the “Debugging“ node
- Click on the “Symbols“ node under “Debugging“
- Click on the icon that looks like the new folder icon to add a new .pdb location
- Type the following for the location “smysrv*symsrv.dll*c:\symbols*http://msdl.microsoft.com/downloads/symbols“
- In the Cache symbols from symbol servers to this directory, enter the local path you used in step 5. In this case “c:\symbols“
- Click Ok.
To test it out, try attaching to some windows process like iexplore.exe (if you have IE running). Goto debug->windows->modules. You should now see that symbols are loaded for all the system dlls and iexplore.exe. You can also open the local path used in step 5 and you should see folders for all the dlls that have been debugged so far.
Happy Debugging!
Another question I got at the denver launch was how can someone check to see if a database (in SQL 2005) was backed-up or not. There is a couple of ways you can get this information
- Use the SQL Management Studio. Open the studio, right click on the database in question, choose restore, restore database... On the general tab you will see the backup sets associated to this database.
- If you have a backup file and want to get more information, you can use commands RESTORE FILELISTONLY, RESTORE HEADERONLU, RESTORE LABELONLY. Please refer to books online to get detailed information about these commands.
- Go and query the MSDB tables directly.MSDB contains all the information you will need about the what backups have ran. for instance, to query all the backup sets for a database called “FOO“ you could execute “Select * from backupset where database_name='foo'“. Other tables you might be interested in are: Backupfile, Backupfilegroup, Backupmediafamily, Backupmediaset, Backupset. Complete descriptions of these tables can be found in books online.
A while ago a friend told me that he was having problems rebuilding the master database in SQL 2005 running on WindowsXP SP2. I wanted to verify the steps to rebuild master when runnnig on Windows XP since I rarely work on XP boxes just to make sure there were no hidden gotchas in the process. Here is what I did to rebuild the master db in the environment described above:
Step 1. Put SQL Server into Single User Mode
The first thing you will want to do is stop the SQL Sever Sevicer (sqlservr.exe) and the associated services (Agent, Full Text, Etc). There are a few ways to do this, but the easiest way would be to use the SQL Configuration Manager (Start->All Programs->Microsoft Sql Server 2005->Configuration Tools->Sql Server Configuration Manager). From this console you can manage the various SQL server services running on the machine. Right Click on each service listed and stop the service. The services are stopped, you can proceed to Step 2.
Step 2. Start the SQL server in Single User Mode
Open a command window and navigate to the folder where Sqlservr.exe resides (generally <install drive>:\Program Files\Microsoft Sql Server\MSSQL.1\MSSQL\Binn). Run “sqlserver.exe -m” to start the sql server from single user mode.
Step 3. Rebuild the system databases
In SQL 2005, the rebuildm.exe program is nto supported. To rebuild the master database you need to use the setup.exe found on the SQL 2005 installation media. To rebuild, use the following command “start /wait setup.exe /qn INSTANCENAME=<instance> REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=<New SA Password>”. Please refere to Books on Line for compelete details on how to use Setup.exe.
Step 4. Restart the SQL Server Services in regular mode
End the command shell you started earlier. Ctrl-C to stop SQL server in single user mode, then close the command window. Go back to the Sql Server Configuration Manager and restart the SQL services.