MM 10


Q1.The primary purpose of sql server agent is to make our job easier”. How will u support this statement? Ans: SQL Server Agent jobs that are running at the time of a failover event on a SQL Server failover cluster instance do not resume after failover to another failover cluster node. SQL Server Agent jobs that are running at the time a Hyper-V node is paused do not resume if the pause causes a failover to another node. Jobs that begin but fail to complete because of a failover event are logged as started, but do not show additional log entries for completion or failure. SQL Server Agent jobs in these scenarios appear to have never ended. The SQL Server Agent is made up of the following components: Component Jobs Description SQL Alerts consist of a set of actions to occur when a specific event occurs (such as when a particular error occurs, or the database reaches a defined size). Alerts can include sending an email to the administrator, paging the administrator, or running a job to fix the problem. SQL Alerts consist of a set of actions to occur when a specific event occurs (such as when a particular error occurs, or the database reaches a defined size). Alerts can include sending an email to the administrator, paging the administrator, or running a job to fix the problem. Operators are people who can address problems with SQL Server. Operators can be identified through their network account or their email identifier. These are usually the people who alerts are sent to.



This includes: 1. SQL Server Agent Jobs are easy to report on since their data is stored in the msdb database. 4. SQL Server Agent Jobs have built in logging and notification features. or stop the job and send an error if the step 1 condition is never met. SQL Server Agent is a Microsoft Windows service that executes scheduled administrative tasks. so I already have to work with SQL Server Agent Jobs. then running SSIS packages from the agent consolidates the places that you need to monitor to one location. particularly when someone deleted a job by accident. Jobs contain one or more job steps. Launch a tool called “Activity Monitor” (to be discussed in future tutorial) . 6. Perform basic file operations (open. I commonly need to start SSRS reports by calling their job schedules. So you may want to run a T-SQL command as step 1. save and print) 3. Analyze the features of standard tool bar. SQL Server Agent Jobs are used by SSRS subscriptions for scheduling purposes. Ans: The Standard Toolbar The Standard toolbar allows you to perform the most of the generic activities that SSMS can perform. SQL Server Agent Jobs are easy to script out and load into our source control system. This means I can get an email each morning before I come into the office that tells me if everything is going well or if there are any problems that need to be tackled ASAP. We've done this on a few occassions. retry if it fails. This allows us to roll back to earlier versions of jobs if necessary. Some jobs run in parallel and some run serially. I don't know how Windows Scheduler performs in this area. another job is called that triggers several SQL Server Agent Jobs. Once all the jobs succeed. This is really useful for ETL processes where you are trying to monitor another server for some condition before running your ETL. SQL Server Agent Jobs can be chained together. 3. SQL Server Agent uses SQL Server to store job information. A common scenario for my ETL is to have several jobs run on a schedule in the morning. which are called jobs.1. If you are already using SQL Server Agent Jobs on your server. Each step contains its own task. 5. eventually move to step 2 if step 1 succeeds. SQL Server Agent Jobs can run more than just SSIS packages. 2. 7. table designer toolbar and text editor toolbar and the various functions carried by them. We have regualrly scheduled subscriptions for SSRS reports that provide us with data about our jobs. Q2. Write a new Query (all types) 2.

Because this option requires a lot of involvement from both the DBA administration and development side. HIERARCHYID: The HIERARCHYID data type is used to enable database applications to model hierarchical tree structures. . but is a variation of the VARBINARY(MAX) data type that allows unstructured data to be stored in the file system instead of inside the SQL Server database.The Text Editor toolbar In addition to allowing the user to navigate through the script. FILESTREAM: FILESTREAM is not a data type as such. TIME. DATETIME2. the text editor toolbar allows the user to: 1. While planning a database what are the various considerations we keep in mind? Explain how to create database with both graphical and query interface. Work with Intellisense options o Display an object member list o Display parameter info o Display quick info o Display word completion Q3. such as the organization chart of a business. I will spend more time on this topic than the rest. making working with time much easier than it ever has in the past. Ans: SQL Server 2008's new data types: • • • • Date and Time: Four new date and time data types have been added. They include: DATE. and DATETIMEOFFSET. Elaborate the new data types in SQL Server 2008 giving examples for each. Spatial: Two new spatial data types have been added-GEOMETRY and GEOGRAPHY--which you can use to natively store and manipulate location-based information. such as Global Positioning System (GPS) data.

Storage depends on the precision and scale selected. with a range of 00:00:00. and runs from 6 to 8 bytes. and you can’t choose to store one or the other. and runs from 8 to 10 bytes. and often reduces performance because WHERE clauses with these data and time data types often had to include functions to convert them to a more useful form. and an accuracy of 100 nanoseconds. DATETIMEOFFSET: DATETIMEOFFSET is similar to DATETIME2. Storage depends on the precision and scale selected. While they were useful in many cases. adds unwanted complexity to many queries because the data types often had to be converted to a different form to be useful. This often causes a lot of wasted storage (because you store data you don’t need or want).nnnnnnn] [+|-]hh:mm with a range of 0001-01-01 00:00:00. The accuracy is 1 day.Each of these data types are available in all editions of SQL Server 2008. one at a time. but has a greater range and precision. they had a lot of limitations. and it only takes 3 bytes to store the date.9999999 (in UTC).9999999. which should be adequate for most business and scientific applications. which include: • • • • DATE: As you can imagine. The format is YYYY-MM-DD hh:mm:ss[. which is often not granular enough for some applications. including: • • • • Both the date value and the time value are part of both of these data types. and runs from 3 to 5 bytes. . The format is YYYY-MM-DD hh:mm:ss:nnnnnnnm with a range of 0001-01-01 00:00:00.0000000 through 0001-01-01 00:00:00.0000000 through 9999-1231 23:59:59.nnnnnnn. but includes additional information to track the time zone. which often requires extra coding for time-aware applications. They are not time-zone aware. Storage depends on the precision and scale selected. TIME: TIME is stored in the format: hh:mm:ss. The range of supported dates is not adequate for some applications. SQL Server 2008 introduces four new date and time data types. Date and Time In SQL Server 2005 and earlier. Let’s look at each of these. To overcome these problems.NET CLR DATETIME data type. the DATE data type only stores a date in the format of YYYY-MM-DD. and an accuracy of 100 nanoseconds. and the range does not match the range of .0000000 through 9999-12-31 23:59:59. Precision is only . preventing these queries from using indexes. SQL Server only offered two date and time data types: DATETIME and SMALLDATETIME. which requires additional conversion code.0000000 through 23:59:59:9999999 and is accurate to 100 nanoseconds. DATETIME2: DATETIME2 is very similar to the older DATETIME data type. It has a range of 0001-01-01 through 9999-12-32.333 seconds.

spatial indexes consist of a grid-based hierarchy in which each level of the index subdivides the grid sector that is defined in the level above. But like conventional indexes. It is generally used to store XY coordinates that represent points. and polygons in a two-dimensional space. Unlike conventional indexes. can be used. lines.All of these new date and time data types work with SQL Server 2008 date and time functions. To take full advantage of these methods. GEOGRAPHY: The GEOGRAPHY data type is used to store ellipsoidal (roundearth) data. otherwise you will get lost very quickly. If this is a topic you want to learn more about. In addition. GEOMETRY and GEOGRAPHY data types are implemented as . They include: • • GEOMETRY: The GEOMETRY data type is used to store planar (flat-earth) data. Another feature of spatial data types is that they support special spatial indexes. GPS data that represents the lay of the land is one example of data that can be stored in theGEOGRAPHY data type. It is used to store latitude and longitude coordinates that represent points. For example storing XY coordinates in the GEOMETRY data type can be used to map the exterior of a building. the SQL Server query optimizer can use spatial indexes to speed up the performance of queries that return spatial data. Methods defined by the Open Geospatial Consortium standard.NET CLR data types. which means they can support various properties and methods specific to the data. a method can be used to calculate the distance between two GEOMETRY XY coordinates. lines. or the distance between two GEOGRAPHY latitude and longitude coordinates. For example. it becomes much easier to combine spatial data with other kinds of business data. Another example is a method to see if two spatial objects intersect or not. which have been enhanced in order to properly understand the new formats. Spatial data is an area unfamiliar to most DBAs. you will need a good math background. HIERARCHYID . and Microsoft extensions to that standard. a topic that well beyond the scope of this chapter. applications can be created to map business locations on a map. by storing spatial data in relational tables. you will have to be an expert in spatial data. In addition. by combining spatial data (such as longitude and latitude) with the physical address of a business. and polygons on the earth’s surface. some new date and time functions have been added to take advantage of the new capabilities of these four new data types. Spatial While spatial data has been stored in many SQL Server databases for many years (using conventional data types) SQL Server 2008 includes the introduction of two specific spatial data types which can make it easier for developers to integrate spatial data in their SQL Server-based applications. For example. For example.

it requires separate backups of the database and the files. the HIERARCHYID data type has been added to help resolve this problem. not as a way to create the tree structure. and can dramatically increase the size of a database. when developers wanted to use SQL Server to manage such unstructured data. and it exposes many methods that allow you to manipulate the date stored within it.While hierarchical tree structures are commonly used in many applications. . get the next level. It is designed to store values that represent the position of nodes of a hierarchal tree structure. Neither of these options was a perfect solution. it does not automatically represent a hierarchical structure. but it has never been particularly good at storing unstructured data. Storing unstructured data in VARBINARY(MAX) columns offers less than ideal performance. get the previous level. and it doesn’t prevent problems that arise when outside files are modified or moved and the database is not updated to reflect this. • • • • • • Organizational structures A set of tasks that make up a larger projects (like a GANTT chart) File systems (folders and their sub-folders) A classification of language terms A bill of materials to assemble or build a product A graphical representation of links between web pages Unlike standard data types. and include pointers inside a column that pointed to the file’s location. graphic files. In fact. the HIERARCHYID data type makes it easier to express these types of relationships without requiring multiple parent/child tables and complex joins. In the past. if not thousands of files to be keep track of. Word documents. and so on. For example. the HIERARCHYID data type is only used to store hierarchical data. and many more. the HIERARCHYID data type is a CLR user-defined type. there are methods to get the current hierarchy level. has a 2 GB size limit. Storing unstructured data in the file system requires that the files have a unique naming system that allows hundreds. FILESTREAM SQL Server is great for storing relational data in a highly structured format. Excel spreadsheets. it requires managing folders to store the data. For example. SQL Server has not made it easy to represent and store them in relational tables. It is the responsibility of the application to create and assign HIERARCHYID values in a way that represents the desired relationship. such as videos. They could store unstructured data in VARBINARY(MAX) columns inside the database. developers essentially had two choices. Think of aHIERARCHYID data type as a place to store positional nodes of a tree structure. In SQL Server 2008. or they could store the data outside of the database as part of the file system. security is a problem and often requires using NTFS permissions to keep people from accessing the files inappropriately. This allowed an application that needed access to the file to find it by looking up the file’s location from inside a SQL Server table.

FILESTREAM storage is implemented in SQL Server 2008 by storing VARBINARY(MAX) binary large objects (BLOBs) outside of the database and in the NTFS file system. so we don’t have to. While this sounds very similar to the older method of storing unstructured data in the file system and pointing to it from a column. and allows the Windows OS to do what is does best: manage large files. As you might expect. This allows SQL Server to do what it does best: manage structured data. SQL Server 2008 has introduced what is called FILESTREAM storage. If your application doesn’t meet the above conditions. you will want to thoroughly test your options before implementing one option or the other in any new applications you build. FILESTREAM storage offers these additional benefits: • • • Transact-SQL can be used to SELECT. If you want. FILESTREAM data is backed up and restored as part of the database file. When fast read access is important to your application. UPDATE. The size of the stored data is only limited by the available space of the file system. which includes: 1. Enabling a SQL Server database to use FILESTREAM data .To help resolve these problems. Instead of a simple link from a column to an outside file. as it is not supported for FILESTREAM data. When encryption is not required. FILESTREAM data uses the Windows OS system cache for caching data instead of the SQL Server buffer pool. the SQL Server Database Engine has been integrated with the NTFS file system for optimum performance and ease of administration. In addition. using FILESTREAM storage is not right for every situation. In addition. When applications are being built that use a middle layer for application logic. By default. Because this technology is so new. it is best used under the following conditions: • • • • When the BLOB file sizes average 1MB or higher. then using the standard VARBINARY(MAX) data type might be your best option. DELETE FILESTREAM data. which is essentially a hybrid approach that combines the best features of the previous two options. SQL Server handles all of the links between database columns and the files. there is an option available so you can backup a database without the FILESTREAM data. For example. it is much more sophisticated. Enabling the SQL Server instance to use FILESTREAM data 2. How to Implement FILESTREAM Storage Enabling SQL Server to use FILESTREAM data is a multiple-step process. Standard VARBINARY(MAX) data is limited to 2 GB. INSERT. for example.

or by using the sp_filestream_configure system stored procedure. As you the type the database name in. If you want to take advantage of it. When creating FILESTREAM-enabled columns “VARBINARY(MAX) FILESTREAM” data type. right click the Databases folder and select new Database. select “Microsoft SQL Server”. To begin. The first step can be performed using the SQL Server 2008 Configuration Manager (demoed here). we’ll create a Database using the graphical interface called the “SQL Server Management Studio”. choose Properties. the Logical Name for the file types Data and Log will automatically fill in as well. in a table. Let’s look at each of these steps. and the following dialog box appears. FILESTREAM storage is not turned on after you install a new SQL Server 2008 instance. . one step at a time. and any related helper objects such a Queries (saved ways to look data up). In addition to storing the actual data. well use the name “Test”. The “Log” file keeps track of any changes to that data. then click on the FILESTREAM tab. For this example. The “Data” file is where the actual data is saved on the hard drive. Enter a name in the “Database name” text box. you must enable it. a Database also stores the structure of how that data is saved (called a Table). which is a two step process. and then “SQL Server Management Studio”. click on SQL Server Services in the left window. specifying the By default. Click OK. From the Windows Start Menu. and then in the right window. right-click on the SQL Server instance you want to enable FILESTREAM storage on. start the SQL Server 2008 Configuration Manager. Once the Management Studio starts. To begin enabling FILESTREAM storage at the instance level. Create a Database A “Database” in SQL Server is a container that holds a group of related objects.3.

in Windows Server 2003. data files. Ans: Hard Disk: Disk space requirements will vary with the SQL Server 2008 components you install. Enumerate why SQL server 2008 is more secure than the previous versions of SQL server. Processor: Pentium III compatible processor with 1. Q5. and Full-Text Search Analysis Services and data files Reporting Services and Report Manager Integration Services Books on Online and SQL Server Compact Books Online Disk Space 280MB 90MB 120MB 850MB 240MB 2. Memory: RAM: Minimum: Recommended: Disk Space Requirement: Service\Resource Database Engine.Q4. Ans: Server Manager While previous versions of Windows Server featured separate management consoles for all of the various roles and features in the OS and. replication. This is a true one- . Other Devices: Pointing device: A Microsoft mouse or compatible pointing device is required. a simple Manage Your Server dashboard.048 Maximum: Operating system maximum 512 GB or MB more Display: SQL Server 2008 graphical tools require VGA or higher resolution: at least 1.024x768 pixel resolution. Windows Server 2008 provides the new Server Manager. Why is it important to keep the various hardware considerations in mind while installing SQL Server 2008? Explain various hardware considerations in support of your answer. as appropriate.0 GHZ or faster with a recommended speed of 2. is required for installation from disc.0 GHZ. Drive: A CD or DVD drive.

Virtualization (Hyper-V). both logical and useful.). and Reliability and Performance utilities. so there's no shell (Start Menu. DHCP Server. print) server and as a low-cost.stop shop for daily management needs and is the only tool that many Windows administrators will need to use on a regular basis. Internet Explorer. and many others. What won't work. a Server Core install is also more limited than that of a standard Windows Server 2008 installation. though a few GUI-based applications. including ASP .NET: Server Core's Web Server role is pretty much static only. compared to 18 roles in the full server. DNS. including AD. Print. and WMS. AD LDS. is anything that requires a true GUI or the . File Services. This cancels out some key Windows Server 2008 functionality. non-. Terminal Services. well-designed application. For the most part. supporting only older. Services. Server Core Unlike previous Windows Server versions. and little in the way of end user applications. What makes Server Manager even more useful is that each section of the console's UI gets its own dedicated home page. It supports just nine roles.NET Framework. along with links to fix problems. the only user interface you'll see in Server Core is a single command line window floating over an empty blue backdrop.NET technologies like ASP. Web Server. Web Server. File. Explorer windows. unfortunately. WMI Control. each of which includes information pertinent to the role or feature at hand. get more information. BitLocker Full-Drive Encryption . such things as Windows Media Player. It's the ultimate anti-demo. the traditional GUI-based server we've had since Windows NT 3. all of the familiar GUI-based management tools will work just fine remotely against this server.1 and a lightweight new command line-based environment called Server Core. etc. It's a thoughtful. DHCP. and access other tools. file. most Windows Server 2008 product editions can be installed in two modes. Because Server Core is still Windows Server 2008. Microsoft has stripped out virtually all the GUI. In this new installation mode. DNS Server. taskbar. and the new Windows Server Backup. Application Server. and Windows Mail are all missing. It also includes numerous valuable troubleshooting tools like Event Viewer. low-end Web server. configuration tools like Task Scheduler. DNS. are still available. My expectation is that Server Core will prove hugely popular as an infrastructure (AD. like Notepad and Task Manager. It's a product that should compete well with Linux-based solutions. The MMC-based Server Manager provides a user interface for managing each installed role and feature on the system. DHCP. Windows Firewall. So what's the point? Server Core is designed to reduce the attack surface of the server to be as small as possible. and Device Manager. including Active Directory Domain Services. As such. in addition to the missing roles.

RODC is somewhat limited in that it can only support a subset of the roles and functionality normally supported on Windows Server 2008. and then switched on. For example. need to be serviced. monolithic.) Read-Only Domain Controller Read-Only Domain Controller (RODC) is new functionality that allows administrators to optionally configure the AD database as read-only. DFS.2based hardware to store encryption keys and can be configured via Group Policy. With RODC. and these servers often connect back to the home office using slow or unreliable WAN links. they won't be able to access any of the data stored on the system's hard drives. RODC is an excellent solution for physically insecure remote servers. On the server.NET-based configuration store. because those servers are often less well physically protected than the machines back in the home office. (See the RODC section below for an example. IIS 7 is completely componentized so that only those components needed for the desired configuration are installed and. BitLocker is particularly valuable for machines stored in branch offices. even hackers who gain physical control of the server can't take over your network. thus. you can configure the most secure remote server possible. if you combine RODC with other new Windows Server 2008 technologies like BitLocker and Server Core. Internet Information Services 7 The new Web server in Windows Server 2008 is driven by a major new update to Internet Information Services (IIS). and is backed by a new . It sports a drastically improved management console. That way. So why would you want to do this? Today. It requires TPM 1. BitLocker also works really well with some of the other technologies discussed here to create a truly secure and useful branch office solution. configuration store. RODC-based servers can support technologies such as ADFS. And removing the stolen RODC from your AD is as simple as checking a switch: Only those users who logged on to that machine will need to change their passwords. If a thief walks off with a BitLocker-protected server. supports xcopy Web application deployment and delegated administration. and SMS (System Management Server).BitLocker is a full-drive encryption solution that first debuted in Windows Vista as a way to protect data stored on easily lost and stolen executive notebook computers. . many organizations are installing servers in branch offices and other remote locations. Like the server itself. DNS. That makes AD replication--and even authentication--an arduous and lengthy process. DHCP. only the user names and passwords of users who hit the server locally--and not the administrator account--are cached locally on the server. which replaces the previous. where only locally cached user passwords are stored on the machine and AD replication is unidirectional. Indeed. rather than bidirectional. the server is typically set up and configured in the home office. MOM (Microsoft Operations Manager). because most users' accounts will not have been cached on that machine. From then on. Group Policy (GP). You won't have to institute an organization-wide emergency. shipped to the remote location. Like BitLocker.

Windows Firewall is automatically configured in the background so that only the required ports are opened. How these updates happen depends on the configuration of your environment. This is a major change. Those that do are allowed online. aside from the initial logon dialog box. the system is given full access again and allowed back on the network. This feature allows you to setup security policies for your network: When a client system connects. instead of entire PC environments. In fact. such as those used by travelling employees--are pushed aside into a quarantined part of the network. and one that could hamper compatibility with third party products. These include TS Easy Print. Network Access Protection Microsoft first planned to ship simple and easily configurable network quarantining functionality in Windows Server 2003. Command line and scripting goodness .Terminal Services Terminal Services (TS) sees some major changes in Windows Server 2008. where they can be updated. function and look almost exactly as they would were they installed locally. NAP examines the device to make sure it meets the requirements of your security policies. so testing will be crucial. and compatibility with Cisco's Network Admission Control (NAC) quarantining technologies. which makes it easy to print to local printers from remote sessions. but once that's complete. so that users can access their remote applications on the road without having to configure a VPN client. which shipped in Windows Vista and can be downloaded for Windows XP with SP2 and above. 32-bit color support in TS sessions. Windows Server ships with a firewall that is enabled by default. and seamless copy and paste operations between the host OS and remote sessions. These applications download and run on user desktops and. TS Gateway lets you tunnel TS sessions over HTTPS outside the corporate firewall. This functionality requires the new Remote Desktop client. The new Windows Firewall is bidirectional and works seamlessly with all of the roles and features you can configure in Windows Server 2008. the Firewall is part of the new roles-based management model: As you enable and disable various roles and features. The new TS RemoteApp functionality allows admins to remotely deploy individual applications to desktops. Those that do not--typically machines that only connect infrequently to the network. TS gets a few small but useful changes as well. This is particularly useful because VPN connections are often blocked at wireless access points. Windows Firewall For the first time. whereas HTTPS rarely is. but it's here at last with Network Access Protection (NAP). NAP includes remediation failback to Windows Update or Microsoft Update if the local Windows Server Update Services server is unavailable. which can be confusing to users.

NET-based objects. One the command line side. and methods. with support for discoverable . and up to 4 CPU cores for each guest OS. It supports both 32-bit and 64-bit guest operating systems. Hyper-V One of the most important and future-looking technologies in Windows Server 2008 isn't even available in the initial shipping version of the product. Microsoft tells me it will ship Windows Server 2008 commandlets on its Web site over time. The issue. and service. Compared to market leader VMWare. properties. That means it's easy to configure. for example. you'll need to have a toe in both environments to best take advantage of the new capabilities. like Virtual PC and Virtual Server. Both are designed with the same premise. of course. Hyper-V is a hypervisor-based virtualization platform that brings various performance advantages when compared to application-level virtualization platforms like Virtual Server. And there are advantages to this bundling: From a management perspective.Those who prefer to automate their servers will rejoice at the new command line and scripting enhancements in Windows Server 2008. however.exe. Availability and licensing . though I'm a bit concerned by the haphazard and temporary nature of some of these changes. Windows Server 2008 doesn't help matters much: It doesn't ship with any PowerShell commandlets--fully contained scripts that can be executed from the command line--that can handle common management tasks. file and print services. Instead. In this version of Windows Server. Sadly. Server Core. Hyper-V is installed and managed as a role under Windows 2008. up to 32 GB of RAM in each guest OS. Hyper-V is compatible with virtual machines created for Microsoft's earlier virtualization products. For now. It provides all of the power of UNIX command line environments with none of the inconsistencies. manage. we're seeing the beginning of the transition from the old DOS-like command line to the new . is whether Windows-based administers will quickly move to this new command line interface. just like DHCP. and other standard roles. we get two major additions: A Server Core management utility called oclist. providing ways to configure and manage the roles that are possible under each environment.exe and a command line version of Server Manager called servermanagercmd. Microsoft is shipping a beta version of its Hyper-V virtualization platform with Windows Server 2008 and will update it automatically when the technology is finalized sometime after mid-2008.NET-based PowerShell environment. PowerShell is a complex but technically impressive environment. does not support PowerShell. however. Microsoft's offering is immature and unproven. but its inclusion in Windows Server 2008 is sure to garner Microsoft some attention and market share. Hyper-V ships only with x64-based versions of the product and relies on hardware virtualization features that are only available in the latest AMD and Intel chipsets. and it expects a healthy community to quickly evolve as well.

some of which include support for the Hyper-V virtualization technologies and some that do not. 64-bit x64.) . and Itanium). Microsoft sells versions with and without Hyper-V included. Windows Server 2008 is available in several different product editions. (Note that Hyper-V is only enabled on x64 versions of Windows Server 2008. These editions support different hardware platforms (32-bit x86.As with Windows Vista.