Thursday, July 8, 2010

MVP Award Kit

[caption id="attachment_663" align="aligncenter" width="600" caption="Most Valueable Professional Award"]Most Valueable Professional Award[/caption]

Resource System Database

The system objects are physically stored in the resource database, they are logically presented as the sys schema in each database.

The following code returns the build number of the resource database:
SELECT SERVERPROPERTY('ResourceVersion')

To return the date and time the resource database was last updated, the following code can be executed:
SELECT SERVERPROPERTY('ResourceLastUpdateDateTime')

Wednesday, July 7, 2010

Dedicated Administrator Connection (DAC)

SQLCMD is particularly useful for creating batch scripting jobs for administrative purposes. SQLCMD has replace OSQL. It is using OLEDB to connect the SQL Server. However, as an emergency utility to diagnose and hopefully correct server problems, it has no peer. By Using the –A argument, the SQLCMD utilizes an exclusive connection to SQL Server. If no other connection is possible, the SQLCMD –A command is the last and best hope for diagnosing server problems and preventing data loss. By default, only local DACs are allowed because the DAC components only listen on the loopback connection. However, remote DACs can be enabled using the sp_configure stored procedure by changing the remote admin connections option to true, as the following code illustrates:

sp_configure ‘remote admin connections’, 1
RECONFIGURE

Thursday, July 1, 2010

SQL Server Full Backup Internally

Q. What are the steps SQL Server performs internally at the time of FULL backup?
Ans. SQL Server follow the below steps once you execute the BACKUP command
1.Backup Process will lock the database and block all the transaction
2.Place a mark in the transaction log
3.Release the database lock
4.Extract all the pages in the data files and write them to the backup device
5.Lock the database and block all the transactions
6.Place a mark in the transaction log
7.Release the database lock
8.Extract the portion of the log between the marks and append it to backup

Q. Which operations do not allowed during the full backup?
1.Adding and removing database files
2.Shrinking the database