Posted by: Manpreet Singh on: June 22, 2009
ISCSI is a great new technology in the world of storage. It is the standard which provide storage interface by carrying SCSI command over TCP/IP network. It helps organizations to consolidate storage and provide host with a illusion of locally – attached disk storage. Microsoft fully supports Microsoft SQL Server when it is deployed on ISCSI storage that has received the “Designed for Windows” Logo Program qualification. Microsoft windows server presents the ISCSI storage as ordinary drives attached to computer. To users and applications, including SQL Server, the remote destination is encapsulated. There are certain points which needs o be remember before using ISCSI technology with Sql server 2005 or later. Some of them are as follows
Posted by: Manpreet Singh on: June 1, 2009
Restore is very important part of whole database administration process. Understanding the internal working of restore process helps administrators to create disaster recovery processes for organizations. Restoring a SQL database is the process of using full or differential backup files and their subsequent Transaction log files to roll the database forward to a certain point. Recovery is the overall set of Processes that SQL Server runs to ensure that the database is in a consistent state when it is brought online, which might include such processes as rolling back uncommitted transactions.
Restore is a multi-phase process and include three main phases: data copy, redo, and undo.
Data Copy Phase
During this phase of restore, the contents of the database, files, or pages being restored are initialized the data is then copied from one or more full backups and, optionally, differential backups, and then resetting the contents of the affected database, files, or pages to the time that they were captured by those backups. The oldest file used in the backup set of files (also known as the roll-forward set) will contain the LSN for the redo phase.
Redo Phase
The redo phase is also known as the roll-forward phase. This is when the transaction logs are processed to ensure the consistency of your databases. If you specified a specific point in time to recover to (date or marked transaction), this will be done in the redo phase. Even with all things rolled forward that have been committed, there might still be some uncommitted transactions. Also, Restore avoids unnecessary roll forward. Generally, if data was read-only when it was backed up and has remained read-only, roll forward is unnecessary and is skipped.
Undo Phase
Undo is the last step in ensuring the consistency of your database. In this phase, any changes made by uncommitted transactions are undone, or rolled back. At the end of undo, no more backup files can be processed, and the database is brought online. Undo will not be done if WITH NORECOVERY is specified. Also, If the data is already transactionally consistent at the start of the recovery process, the undo phase is skipped. After the database is transactionally consistent, recovery brings the database online.
Posted by: Manpreet Singh on: May 26, 2009
Whenever we install new SQL server instance on server, it include four system databases by default named: Master, Model, Tempdb, and MSDB. It also contains a fifth, stealth database that you will never see using any of the normal SQL tools or commands. This database is referred to as the resource database, but its actual name is mssqlsystemresource.
Master
The master database is arguably most important database in SQL working. It composed of system tables that keep track of the server installation as a whole and all other databases that are subsequently created. Although every database has a set of system catalogs that maintain information about objects it contains, the master database has system catalogs that keep information about disk space, file allocations and usage, it also contain system wide configuration settings regarding SQL instance , endpoints information , login accounts, databases on the current instance, and the existence of other SQL servers (for distributed operations).
The master database is critical to your system, so always keep a current backup copy of it. Operations such as creating another database, changing configuration values, and modifying login accounts all make modifications to master, so after performing such actions, you should back up master.
Model
Model database is act as a template database to every new database which is created on SQL server instance. Every time when we create a new database, SQL Server simply makes a copy of model database to form the basis of the new database. If someone like every new database to have certain objects or permissions, he or she can put them in model database, and all new databases will inherit them. We can also change most properties of the model database by using the ALTER DATABASE command, and those property values will then be used by any new database you create.
Tempdb
The tempdb database is used as a temporary storage for system objects, data and intermediate results. It is unique among SQL Server databases because it is re-created every time SQL Server is restarted. It’s used for temporary tables explicitly created by users, for worktables that will hold intermediate results created internally by SQL Server during query processing and sorting, for maintaining row versions used in snapshot isolation and certain other operations, and for materializing static cursors and the keys of keyset cursors. Because the tempdb database is re-created, any objects or permissions that you create in the database will be lost the next time we restart our SQL Server instance. An alternative is to create the object in the model database, from which tempdb is copied.
The tempdb database sizing and configuration is critical for optimal functioning and performance of SQL Server, so I’ll discuss tempdb in more detail in its own section later in this chapter.
Mssqlsystemresource
Mssqlsystemresource database is a hidden and read-only database that contains Executable system objects, such as system stored procedures and functions. It is stored as mssqlsystemresource.mdf / .ldf file combination and installed in the same location as the master database in C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\data as it is SQL Server requirement that both the master and resource databases will remain in same location. However, if we start our SQL Server instance in single-user mode, we can make a single connection, and that connection will be able to use the mssqlsystemresource database. Its content is specific to a version / patch level and because it cannot be included in regular a SQL Server backup we should always make a manual copy of both .mdf and .ldf files after SQL Server instance is installed and Before and after a service pack of hot fix is applied
MSDB
MSDB database is mainly used by the SQL Server Agent service, which performs scheduled activities such as backups and replication tasks, and the Service Broker, which provides queuing and reliable messaging for SQL Server. All the information in msdb is accessible from Object Explorer in SQL Server Management Studio, so we usually don’t need to access the tables in this database directly. We can think of the msdb tables as another form of system tables: Just as you can never directly modify system tables, you shouldn’t directly add data to or delete data from tables in msdb.
Posted by: Manpreet Singh on: May 25, 2009
Yesterday, I and my friend were taking manual backup of database on development server through management studio and suddenly management studio stop responding. I knew that this is happening due to the load added by backup process. We were wondering if there is any TSQL statement through which we can find the status of task running, e.g percentage completed etc. after some googling , I found a DMV(dynamic management view) through which we can found all the information (almost) which we want for any process .
SELECT Session_Id, Reads, Writes, Cpu_Time, Logical_Reads, Total_Elapsed_Time,
Blocking_Session_Id, Percent_Complete, Command,
(select text from sys.dm_exec_sql_text(sql_handle)) as Text FROM
sys.dm_exec_requests(nolock) WHERE session_id = 55
sys.dm_exec_requests is very informative DMV as it provide vast amount of information about any process which is running. the only thing which we need is a SPID of that process . For example if we are taking a backup of any database then, the query column Percent_Complete will give us percentage of work completed. I hope this statement will help you find the amount of work done without going through all the GUI tools and special parameter like STATS etc.
Yesterday, I and my friend were taking manual backup of database on development server through management studio and suddenly management studio stop responding. I knew that this is happening due to the load added by backup process. We were wondering if there is any TSQL statement through which we can find the status of task running, e.g percentage completed etc. after some googling , I found a DMV(dynamic management view) through which we can found all the information (almost) which we want for any process .
SELECT Session_Id, Reads, Writes, Cpu_Time, Logical_Reads, Total_Elapsed_Time,
Blocking_Session_Id, Percent_Complete, Command,
(select text from sys.dm_exec_sql_text(sql_handle)) as Text FROM
sys.dm_exec_requests(nolock) WHERE session_id = 55
sys.dm_exec_requests is very informative DMV as it provide vast amount of information about any process which is running. the only thing which we need is a SPID of that process . For example if we are taking a backup of any database then, the query column Percent_Complete will give us percentage of work completed. I hope this statement will help you find the amount of work done without going through all the GUI tools and special parameter like STATS etc.
Posted by: Manpreet Singh on: May 19, 2009
Installing Active Directory needs static IP address. This can be assign by selecting network card properties and then typing in the IP address we wish to use. The subnet mask must also be provided. Both values must be correctly chosen given the networking configuration of the network that the cluster will be a part of. AS AD requires DNS, An address must be provided – in this case we can specify 192.168.100.1. DNS can be installed later with the other components.

Installing AD and DNS
















Posted by: Manpreet Singh on: May 18, 2009
One of my pal is working on a project where they don’t have any dedicated SQL server DBA (they rather have developer DBA). One day he called me and told that he was having a problem with one of their SQL server instances. The instance was installed in my supervision so I was quite sure that someone has changed something. I asked him whether he has changed anything in day or two, he told me, and he has change the service account of SQL server. I know that both the things are correlated, but still I am quite confused as I haven’t found anything wrong with domain account which they were using. When I asked him how he has change that service account, he told me that he has changed it through services.msc. Bingo!! This was the part of puzzle for which I am looking for. I have done nothing after that but simply reconfigure SQL server service account through SQL server configuration manager again and it solves the problem. This problem comes due to the fact that when we first install Microsoft SQL Server to run under a Microsoft Windows NT account, SQL Server sets for that Windows NT account various Windows user rights and permissions on certain files, folders, and registry keys. If we later change the startup account for SQL Server (the MSSQLServer service) and the SQL Server Agent service by using SQL Server Enterprise Manager (SEM) or SQL Server Configuration Manager (SSCM), SEM automatically assigns all the required permissions and Windows user rights to the new startup account But, if we use the Services add-in that is in Control Panel or in Administrative Tools to change the startup account information for the MSSQLServer service or the SQL Server Agent service, there are additional permissions and user rights that we must set for proper working of SQL server service.
Detailed information is given in this article