Showing posts with label sqlserver. Show all posts
Showing posts with label sqlserver. Show all posts

Thursday, April 4, 2013

Restore site or list from backup without attaching database

A great improvement to Restore/Backups was made to SharePoint 2010. In MOSS2007 the restore/backup functionality was restricted to Farm, Web Applications and Content Databases.

In the 2010 version, using just the OOTB options, we can be as granular as choosing an individual list. This greatly improves the flexibility of this functionality. Not surprisingly, the feature is called Granular Backup.
(...)

Saturday, May 12, 2012

Regain control of SQL Server

I started using a VM from a template someone else built in the last couple of days. My account was a local machine admin, but not a SQL Server admin. I actually had no access configured in SQL Server for my account. But I needed to get control over it and had no one available to help me in that moment.

In order to get sysadmin permissions on SQL Server, I did this:
  1. Shut down SQL Server Services
  2. Open a command line as Administrator
  3. Change to you SQL Server Binn dir
    • cd "c:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn"
  4. Run SQL Server in single-user mode
    • sqlservr.exe -m -s MSSQLSERVER
  5. Open a new command line as Administrator
  6. Connect to SQL Server
    • sqlcmd -S .\ (or sqlcmd -S .\MSSQLSERVER)
  7.  Execute commands
    • 1> sp_addsrvrolemember 'domain\user', 'sysadmin'
    • 2> GO
  8. CTRL+C in both windows to exit sessions
  9. Restart SQL Server Services 
  10.  
    PS: You may need to be quick connecting to SQL (step 6) after starting it in single-user mode (step 4), otherwise some other process may pick up the session (remember, obviously, only one connection will be allowed...we're running in single-user mode!). Not a bad idea to have both command line windows open and ready to click Enter.

Thursday, August 18, 2011

SQL Server performance

Something that appeared as a central point of discussion among same colleagues: are views in SQL Server materialized?
By default, no. If you want to materialize views, to increase performance, you should look for indexed views.
It is almost unnecessary to say when to use them: if you have some data being pulled very frequently from a subset of tables joined by some logic, with few updates. You will need more disk space, but the performance will certainly increase.

Some reading links on the subject:
Creating an Indexed View in SQL Server 2005 and 2008
Chapter 14 — Improving SQL Server Performance