Top Banner
Presenter: Juhi Mahajan
90
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript

Presenter: Juhi Mahajan

SQL Server Versions

Presenter: Juhi Mahajan

SQL Server 2012 Editions

Specialized Editions Developer Web Express

Presenter: Juhi Mahajan

Hardware Requirements

Presenter: Juhi Mahajan

Software Requirements

Presenter: Juhi Mahajan

Manageability Enhancements SQL Server Management Studio IntelliSense Enhancements A new Insert Snippet menu Transact-SQL Debugger Enhanced Resource Governor number of resource pools Resource Governor maximum cap for CPU usage introduced resource pools can be affinitized to an individual schedule or a

group of schedules

Contained Databases Startup Options RelocatedPresenter: Juhi Mahajan

Programmability Enhancements FileTable Contained Database Sequences

Filestream Enhancements New Data/Time Functions ResultSet Enhancement Fetch & Offset Error Handling Enhancements

Presenter: Juhi Mahajan

CONTAINED DATABASES

Presenter: Juhi Mahajan

Databases in SQL Server

tables, views procedures users DB1 Instance tables, views procedures users DB1

tables, views procedures users DB1

Presenter: Juhi Mahajan

Contained Database A contained database is a concept in which a database includes all the settings and metadata required to define the database and has no configuration dependencies on the instance of the SQL Server Database Engine where the database is installed.

NOTE: SQL Server Denali aka SQL Server 2012 supports only partial contained databasePresenter: Juhi Mahajan

Terms Database boundary The boundary between a database

and the instance of SQL Server. The boundary between a database and other databases Uncontained An user entity that crosses beyond application boundary. In other words you can access resources outside your application boundary. Contained An user entity that resides within an application boundary. Partial Contained database Its a contained database which also allows you to access the objects outside. Full Contained database Full containment wont allow you to access the objects outside the application boundary.

Presenter: Juhi Mahajan

TermsContained user - There are two types of users for contained databases. Contained database user with password - Contained database users with passwords are authenticated by the database. Windows principals - Authorized Windows users and members of authorized Windows groups can connect directly to the database and do not need logins in the master database. The database trusts the authentication by Windows.

Presenter: Juhi Mahajan

TermsDatabase Boundary - Because partially contained databases separate the database functionality from those of the instance, there is a clearly defined line between these two elements called the database boundary. Inside of the database boundary is the database model, where the databases are developed and managed. Ex: sys.tables Outside of the database boundary is the management model, which pertains to instance-level functions and management. Ex: sys.endpoints

Presenter: Juhi Mahajan

Benefits of using Partially Contained Databases Database Movement Benefit of Contained Database Users with AlwaysOn Initial Database Development

Database Administration

Presenter: Juhi Mahajan

Limitations of Partially Contained Databases Partially contained databases cannot use replication, change data capture, or change tracking. Schema-bound objects that depend on built-in

functions with collation changes Binding change resulting from collation changes, including references to objects, columns, symbols, or types. Replication, change data capture, and change trackingPresenter: Juhi Mahajan

Identifying Database ContainmentThere are two tools to help identify the containment status of the database. sys.dm_db_uncontained_entities - This view shows any entities in the database that have the potential to be uncontained, such as those that cross-the database boundary. This includes those user entities that may use objects outside the database model. database_uncontained_usage event - This XEvent occurs whenever an uncontained entity is identified at run time. This includes entities originated in client code. This XEvent will occur only for actual uncontained entities.Presenter: Juhi Mahajan

Example of Contained DatabaseWe will do the following steps: Enable Contained Database Create Contained Database Create User in Contained Database

Try if the user can access outside Contained Database

Presenter: Juhi Mahajan

Enable Contained Database

Presenter: Juhi Mahajan

Create Contained DatabaseThere is a new parameter in CREATE database command, its called CONTAINMENT. As of now this parameter allows NONE and PARTIAL as values. You need to specify this parameter during database creation

In GUI if you go to options tab you need to specify Containment parameter.Presenter: Juhi Mahajan

Create User in Contained DatabaseCreate contained user in the database. The user can be a windows login or SQL login. If its SQL login then you will be able to provide the password for the user itself.

Now lets connect to the server with contained database user. You need to specify the database name in the connection string or else you wont be able to connect to the serverPresenter: Juhi Mahajan

Create Uncontained Object in Contained databaseThere is possibility to have uncontained object in contained database, that means the object which refer the objects outside the database scope. MS has introduced a new catalog view to check uncontained objects sys.dm_db_uncontained_entities.

Presenter: Juhi Mahajan

Create an Uncontained Object in Contained Database

When user tries to execute this procedure, he gets permission denied error

Presenter: Juhi Mahajan

SEQUENCE

Presenter: Juhi Mahajan

Sequence - Definition

SEQUENCE allows you to define a single point of repository where SQL Server will maintain in memory counter. Only The last-used value is stored in memory and so no storage is required. Sequence object provides, as the name suggests, a sequence number based in the specification in which the sequence object was created.

NOTE: To view all Sequences in database use sys.sequencesPresenter: Juhi Mahajan

Sequence Vs. IdentityIdentity Sequence

Table SpecificYou cannot obtain the new value in your application before using it You cannot add or remove the property from an existing column You cannot generate new values in an UPDATE statement when needed, rather only in INSERT statements The semantics of defining ordering in a multirow insert are confusing, and in SELECT INTO statements are actually not guaranteed You cannot define: minimum and maximum values, allow cycling, and caching options You can reseed an identity property, but you cannot change the step size

Table IndependentYou can obtain the new value before using it in an INSERT statement You can add or remove a default constraint defined for a column with an expression that generates a new sequence value You can generate new values in an UPDATE statement

The semantics of defining ordering in a multi-row insert are very clear using an OVER clause, and are even allowed in SELECT INTO statements You can define minimum and maximum values, whether to allow cycling, and a cache size option for performance You can alter any of the properties of a sequence object besides the data type, including the current value, increment, minimum value, maximum value, cycle and cache size

You cannot obtain a whole range of new identity values in one shot, letting the application assign the individual values

You can obtain a whole range of new sequence values in one shot using the stored procedure sp_sequence_get_range, letting the application assign the individual values for increased performance

Presenter: Juhi Mahajan

Create Sequence Syntax

Example:

Presenter: Juhi Mahajan

Working with SequenceThe new NEXT VALUE FOR T-SQL keyword is used to get the next sequential number from a Sequence.

NOTE: The NEXT VALUE generated by Sequence cannot be rolled backPresenter: Juhi Mahajan

Sequence Object with an OVER ORDER BY ClauseThe NEXT VALUE FOR function supports generating sorted sequence values by applying the OVER clause to the NEXT VALUE FOR call. Multiple calls to the NEXT VALUE FOR function for the

same sequence generator in a single statement must all use the same OVER clause definition. An OVER clause applied to the NEXT VALUE FOR function does not support the PARTITION BY sub clause. The OVER clause is not allowed in UPDATE or MERGE statements.Presenter: Juhi Mahajan

Syntax for ALTER SEQUENCEALTER SEQUENCE [schema_name. ] sequence_name[ RESTART [ WITH ] ] [ INCREMENT BY ] [ { MINVALUE } | { NO MINVALUE } ] [ { MAXVALUE } | { NO MAXVALUE } ] [ CYCLE | { NO CYCLE } ] [ { CACHE [ ] } | { NO CACHE } ] [ ; ]

Presenter: Juhi Mahajan

Limitations of SequenceYou are not allowed to use NEXT VALUE FOR in a: UNION, EXCEPT, INTERSECT, or with DISTINCT directly in a statement that uses a DISTINCT, UNION (except UNION ALL), EXCEPT or INTERSECT operator. check constraints, default objects, computed columns, views, user-defined functions, user-defined aggregates, sub-queries, common table expressions, or derived tables. TOP, OVER, OUTPUT, ON, WHERE, GROUP BY, HAVING, ORDER BY, COMPUTE, or COMPUTE BY clause. MERGE or UPDATE

Presenter: Juhi Mahajan

Presenter: Juhi Mahajan

Filestream Data Type File Stream data type stores the file on a physical folder

instead of the database file itself, but we can "insert" or "select" the file just like it was stored on SQL Server database. Designed to solve the problem of unstructured large object (LOB) storage, it combines the performance of file system streaming APIs with the transactional integrity of the relational database. With this data type, the unstructured data is stored in the NTFS file system, and the SQL Server engine manages the link between the FILESTREAM columns and the files in the file systemincluding backing up and restoring file system data.Presenter: Juhi Mahajan

When to use FileStreamuse FILESTREAM When: Objects that are being stored are, on average, larger than 1

MB Fast read access is important. You are developing applications that use a middle tier for application logic. For smaller objects, storing varbinary(max) BLOBs in the database often provides better streaming performance.

Presenter: Juhi Mahajan

Features of FileStream Data Type FILESTREAM storage is implemented as a varbinary(max)

column in which the data is stored as BLOBs in the file system. The standard varbinary(max) limitation of 2-GB file sizes does not apply to BLOBs that are stored in the file system. FILESTREAM data must be stored in FILESTREAM filegroups. When a table contains a FILESTREAM column, each row must have a unique row ID. FILESTREAM data containers cannot be nested. Multiple data containers can be added to a FILESTREAM filegroup. FILESTREAM filegroups can be on compressed volumes. For the FILESTREAM data type the drive volume that has the files must be in NTFS format. Presenter: Juhi Mahajan

Enabling Filestream FunctionalityFILESTREAM is not automatically enabled when you install or upgrade SQL Server. You must enable FILESTREAM by using SQL Server Configuration Manager and SQL Server Management Studio.For Enabling the FileStream support sp_configure system stored procedure must be executed.

NOTE: In order to enable the FILESTREAM feature you need to be a member of the SYSADMIN or SERVERADMIN Presenter: Juhi Mahajan fixed server roles.

Working with FileStream The first step in using FILESTREAM is to have a database that

supports it. As the FILESTREAM uses a special type of filegroup, you must specify the CONTAINS FILEGROUP clause for least one filegroup. For a FILESTREAM filegroup, FILENAME refers to a path. The path up to the last folder must exist, and the last folder must not exist. After you run the sample code, you should see the FileStream folder on your drive. This folder contains a filestream.hdr file and an $FSLOG folder.

Presenter: Juhi Mahajan

Create a Filestream Data

Presenter: Juhi Mahajan

Creating a Table to use FileStream

Presenter: Juhi Mahajan

Using FILESTREAM Storage in Client ApplicationsTo support working with FILESTREAM BLOB data in Win32 applications, SQL Server provides the following functions and API: PathName returns a path as a token to a BLOB. An

application uses this token to obtain a Win32 handle and operate on BLOB) data. GET_FILESTREAM_TRANSACTION_CONTEXT() returns a token that represents the current transaction of a session. An application uses this token to bind FILESTREAM file system streaming operations to the transaction.

Presenter: Juhi Mahajan

PathNameReturns the path of a FILESTREAM binary large object (BLOB). PathName is read-only. Syntax: column_name.PathName (@option) @option : An integer expression that defines how the server component of the path should be formatted. Default 0 Value Description 0 Returns the server name converted to BIOS format 1 Returns the server name without conversion 2 Returns the complete server path

Presenter: Juhi Mahajan

GET_FILESTREAM_TRANSACTION_CONTEXT

Returns a token that represents the current transaction context of a session. The token is used by an application to bind FILESTREAM file-system streaming operations to the transaction. Syntax: GET_FILESTREAM_TRANSACTION_CONTEXT ()Return Value: varbinary(max) NULL : If the transaction has not been started, or has been canceled or committed.Presenter: Juhi Mahajan

FILETABLEA FileTable is a specialized user table with a pre-defined schema that stores FILESTREAM data, as well as file and directory hierarchy information and file attributes.

FileTable feature allows organizations to store files and documents within a special table in SQL Server and the ability to access those files and documents from windows.

Presenter: Juhi Mahajan

FILETABLEA FileTable provides following functionality: It stores data related to all the nodes in that hierarchy, for both directories and the files they contain Every row contains the following items: A FILESTREAM column for stream data and a file_id (GUID) identifier. Both path_locator and parent_path_locator columns for representing and maintaining the file and directory hierarchy. 10 file attributes such as created date and modified date that are useful with file I/O APIs. A type column that supports full-text search and semantic search over files and documents.Presenter: Juhi Mahajan

Benefits of the FileTable Feature Windows API compatibility for file data stored within a SQL

Server database. Windows API compatibility includes the following: Non-transactional streaming access and in-place updates to FILESTREAM data. A hierarchical namespace of directories and files. Storage of file attributes, such as created date and modified date. Support for Windows file and directory management APIs. Compatibility with other SQL Server features including management tools, services, and relational query capabilities over FILESTREAM and file attribute data.

Presenter: Juhi Mahajan

Steps for Creating a FileTableEnable FileStream on SQL Server Instance Enable non-transactional access to files at the database level Configuring FILESTREAM File Groups and Database Files, and Specifying a Directory for FileTables Creating a FileTable Copying Documents and Files to the FileTable

Presenter: Juhi Mahajan

Enable FileStream on SQL Server Instance

NOTE: To check out if FileStream options are enabled at the database level use sys.database_filestream_options

Presenter: Juhi Mahajan

Enable non-transactional access to files at the database level When you enable non-transactional access to files at the database

level, you can optionally provide a directory name by using the DIRECTORY_NAME option. In the FileTable folder hierarchy, this database-level directory

becomes the child of the share name specified for FILESTREAM at the instance level, and the parent of the FileTables created in the database. Syntax: CREATE DATABASE database_name WITH FILESTREAM ( NON_TRANSACTED_ACCESS = FULL, DIRECTORY_NAME = N'directory_name' ); GO Presenter: Juhi Mahajan

Creating a FileTable Create a FileTable by calling the CREATE TABLE (Transact-SQL)

statement with the AS FileTable option FileTable has a fixed schema, you do not have to specify a list of columns You can specify the following settings for the new FileTable: FILETABLE_DIRECTORY FILETABLE_COLLATE_FILENAME Names to be used for the 3 primary key and unique constraints that are automatically created NOTE: When a FileTable is created, some system-defined indexes and constraints are created. To see these objects, query the catalog view sys.filetable_system_defined_objects. These objects cannot be altered.

Presenter: Juhi Mahajan

Indexes Created with FileTableColumns[path_locator] ASC [parent_path_locator] ASC, [name] ASC [stream_id] ASC

Index typePrimary Key, non-clustered Unique, non-clustered Unique, non-clustered

Presenter: Juhi Mahajan

Constraints that are created when you create a new FileTableDefault constraints on the following columns: o creation_time o is_archive o is_directory o is_hidden o is_offline o is_readonly o is_system o is_temporary o last_access_time o last_write_time o path_locator o stream_id Check constraints The system-defined check constraints enforce the following requirements: o Valid filenames. o Valid file attributes. o Parent object must be a directory. o Namespace hierarchy is locked during file manipulation.

Presenter: Juhi Mahajan

Get Properties of FileTableIdentify Directory or File Use the file_type column of the FileTable file_type is NULL for Directories Root Level Path of the File Use FileTableRootPath Relative path of particular file or directory Use GetFileNamespacePath()

Presenter: Juhi Mahajan

Presenter: Juhi Mahajan

DATEFROMPARTS FunctionThe DATEFROMPARTS function, returns a date value with the date part set to the specified year, specified month and the specified day, and the time portion set to the default: Syntax: DATEFROMPARTS ( year, month, day ) Arguments: Year: Integer expression specifying a year. Month: Integer expression specifying a month, from 1 to 12. Day: Integer expression specifying a day. Return Type: DatePresenter: Juhi Mahajan

TIMEFROMPARTS FunctionThe TIMEFROMPARTS function returns a full time value Syntax:TIMEFROMPARTS ( hour, minute, seconds, fractions, precision )

Arguments: Hour: Integer expression specifying hours. Minute: Integer expression specifying minutes. Seconds: Integer expression specifying seconds. Fractions: Integer expression specifying fractions. Precision: Integer literal specifying the precision of the time value to be returned. Return Type: Time ( precision )Presenter: Juhi Mahajan

DATETIMEFROMPARTS FunctionThe DATETIMEFROMPARTS function returns a full datetime value Syntax: DATETIMEFROMPARTS ( year, month, day, hour, minute, seconds, milliseconds ) Arguments: Year: Integer expression specifying a year. Month: Integer expression specifying a month. Day: Integer expression specifying a day. Hour: Integer expression specifying hours. Minute: Integer expression specifying minutes. Seconds: Integer expression specifying seconds. Milliseconds: Integer expression specifying milliseconds. Return Type: Datetime Presenter: Juhi Mahajan

DATETIMEOFFSETFROMPARTS functionThe DATETIMEOFFSETFROMPARTS function returns a full datetimeoffset data type as shown in the below query result. The OFFSET argument is basically used to represent the time zone offset value hour and minutes. If the offset arguments are omitted, then the time zone offset is assumed to be 00:00, that is, there is no time zone offset. Syntax: DATETIMEOFFSETFROMPARTS ( year, month, day, hour, minute, seconds, fractions, hour_offset, minute_offset, precision )

Presenter: Juhi Mahajan

DATETIMEOFFSETFROMPARTS functionArguments: Year: Integer expression specifying a year. Month: Integer expression specifying a month. Day: Integer expression specifying a day. Hour: Integer expression specifying hours. Minute: Integer expression specifying minutes. Seconds: Integer expression specifying seconds. Fractions: Integer expression specifying fractions. Hour_offset: Integer expression specifying the hour portion of the time zone offset. Minute_offset: Integer expression specifying the minute portion of the time zone offset. Precision: Integer literal specifying the precision of the datetimeoffset value to be returned. Return Type: datetimeoffset ( precision ) Presenter: Juhi Mahajan

EOMONTH FunctionThe EOMONTH function calculates the last date of the month based on the date which is passed as an input parameter. Syntax: EOMONTH ( start_date [, month_to_add ] ) Arguments: start_date: Date expression specifying the date for which to return the last day of the month. month_to_add: Optional integer expression specifying the number of months to add to start_date. If this argument is specified, then EOMONTH adds the specified number of months to start_date, and then returns the last day of the month for the resulting date. If this addition overflows the valid range of dates, then an error is raised. Return Type: Presenter: Juhi Mahajan Date

Presenter: Juhi Mahajan

Throw Statement

Microsoft introduced the TRYCATCH construct in SQL Server 2005 which helped database developers to effectively handle errors within their T-SQL code. SQL Server 2012, THROW statement doesnt require an error number to exist within the sys.messages table however, the error number used should be greater than 50000. All exceptions raised using the THROW statement will have a severity of 16 and the statement before the THROW statement must be followed by the semicolon (;) statement terminator.

Presenter: Juhi Mahajan

THROW (Transact-SQL)Syntax: THROW [ { error_number | @local_variable }, { message | @local_variable }, { state | @local_variable } ] [ ; ] Arguments: error_number: Is an integer constant or variable that represents the exception; must be greater than or equal to 50000 and less than or equal to 2147483647. Message: Is an string or variable that describes the exception. message is nvarchar(2048). State: Is a constant or variable between 0 and 255 that indicates the state to associate with the message. state is tinyint. NOTE: If the THROW statement is specified without parameters, it must appear inside a CATCH block. This causes the caught exception to be raised. Any error that occurs in a THROW statement causes the statement batch to be endedPresenter: Juhi Mahajan

Presenter: Juhi Mahajan

Offset & FetchSQL Server 2012 introduces two new arguments with the ORDER clause: OFFSET & FETCH OFFSET lets you to skip the rows before the value you specified. FETCH will retrieve the rows after OFFSET value. FETCH is an optional parameter, if you didnt specify FETCH then all the rows after the OFFSET value specified will be retrieved.

Presenter: Juhi Mahajan

ORDER ClauseSyntax: ORDER BY order_by_expression [ COLLATE collation_name ] [ ASC | DESC ] [ ,...n ] [ ]

::= { OFFSET { integer_constant | offset_row_count_expression } { ROW | ROWS } [ FETCH { FIRST | NEXT } {integer_constant | fetch_row_count_expression } { ROW | ROWS } ONLY ] Presenter: Juhi Mahajan }

Limitations on ORDER BY Clause the total size of the columns specified in an ORDER BY

clause cannot exceed 8,060 bytes Columns of type ntext, text, image, geography, geometry, and xml cannot be used in an ORDER BY clause In a query that uses UNION, EXCEPT, or INTERSECT operators, ORDER BY is allowed only at the end of the statement The ORDER BY clause is not valid in views, inline functions, derived tables, and subqueries, unless either the TOP or OFFSET and FETCH clauses are also specified. OFFSET and FETCH are not supported in indexed views or in a view that is defined by using the CHECK OPTION clausePresenter: Juhi Mahajan

Limitations on ORDER BY Clause OFFSET and FETCH can be used in any query that allows

TOP and ORDER BY with the following limitations: The OVER clause does not support OFFSET and FETCH. OFFSET and FETCH cannot be specified directly in INSERT,

UPDATE, MERGE, and DELETE statements, but can be specified in a subquery defined in these statements. In a query that uses UNION, EXCEPT or INTERSECT operators, OFFSET and FETCH can only be specified in the final query that specifies the order of the query results. TOP cannot be combined with OFFSET and FETCH in the same query expression (in the same query scope).Presenter: Juhi Mahajan

Using OFFSET and FETCH to limit the rows returned Using OFFSET and FETCH as a paging solution

requires running the query one time for each "page" of data returned to the client application. To achieve stable results between query requests using OFFSET and FETCH, the following conditions must be met: The underlying data that is used by the query must not

change. The ORDER BY clause contains a column or combination of columns that are guaranteed to be uniquePresenter: Juhi Mahajan

Presenter: Juhi Mahajan

Using WITH RESULTSETS SQL Server 2012 introduces a new feature WITH RESULT SETS

which lets you redefine the name and data types of the columns being returned from the stored procedure. WITH RESULT SETS clause with the EXECUTE statement. The WITH RESULT SETS clause can also be used with a stored procedure, which returns multiple result sets and for each result set you can define the column name and data types for each column separately. If you want to restrict a stored procedure to return a result set you can use the RESULT SETS NONE clause. The WITH RESULT SETS option cannot be specified in an INSERTEXEC statement. The number of columns being returned as part of result set cannot be changed. Presenter: Juhi Mahajan

Presenter: Juhi Mahajan

Default Schema for GroupsWith SQL Server 2012, the security management associated with schemas for groups is not only simplified, but now default schemas can be created for Windows groups. By assigning default schemas to Windows groups, organizations can simplify database schema administration and database schema management.The default schema for a group can be defined by using the DEFAULT_SCHEMA option of CREATE USER or ALTER USER. If no default schema is defined for a group, SQL Server assumes dbo is the default schema.Presenter: Juhi Mahajan

T-SQL for Creating Groups-- Create User based on Local Group [SQL01\CDBUsers] CREATE USER [SQL01\CDBUsers] GO --Allocate Database Role Membership ALTER ROLE DB_DATAREADER ADD MEMBER [SQL01\CDBUsers] ALTER ROLE DB_DATAWRITER ADD MEMBER [SQL01\CDBUsers]; GO --Create Default Schema for Group CREATE SCHEMA Users AUTHORIZATION [SQL01\CDBUsers]; GO -- Set the default schema for Group ALTER USER [SQL01\CDBUsers] WITH DEFAULT_SCHEMA = Users GO --Create Table with Group and Default Schema CREATE TABLE Users.t1(c1 int) GO --Insert Value INSERT INTO Users.t1 VALUES (1)

Presenter: Juhi Mahajan

User-Defined Server RolesWith SQL Server 2012, user-defined roles have been introduced at the server level to increase flexibility, increase manageability, and facilitate compliance with better separation of duties when administering the server.USE [master] CREATE SERVER ROLE [DBAControlServer] AUTHORIZATION [sysadmin] ALTER SERVER ROLE [DBAControlServer] ADD MEMBER [PROTOTYPE\Finance] GRANT CONTROL SERVER TO [DBAControlServer] GO GRANT CREATE ANY DATABASE TO [DBAControlServer] GRANT CREATE AVAILABILITY GROUP TO [DBAControlServer] DENY ALTER ANY LOGIN TO [DBAControlServer] DENY ALTER ANY SERVER AUDIT TO [DBAControlServer] GO Presenter: Juhi Mahajan

Scalability and Performance Enhancements Columnstore Indexes Partition Support Increased Online Index Create, Rebuild, and Drop

Presenter: Juhi Mahajan

Presenter: Juhi Mahajan

Availability Enhancementso AlwaysOn Availability Groupso AlwaysOn Failover Cluster Instances (FCI) o Support for Windows Server Core

Presenter: Juhi Mahajan

Changed Startup Options

In SQL Server 2012, the startup Parameter option has been relocated to its own tab and can be easily accessed from SQL Server Configuration Manager.CONFIGURING STARTUP PARAMETERS USING SQL SERVER 2012 1. Launch SQL Server Configuration Manager from Configuration Tools folder 2. Click on SQL Server Services from the Left Pane. You should now see all the services associated with SQL Server on the right pane. 3. From the right pane, right-click on the SQL Server Instance you wish to configure startup options for and then click Properties 4. You will notice a new tab called Startup Parameter. You can now specify the startup option by typing the parameter in the Specify a Startup Parameter box. 5. Once done, click OK button. 6. Restart SQL Server Database Engine for changes to take effect. Presenter: Juhi Mahajan

List of Startup OptionsDefault startup options -d master_file_path Description

Is the fully qualified path for the master database file If you do not provide this option, the existing registry parameters are used. Is the fully qualified path for the error log file Is the fully qualified path for the master database log filePresenter: Juhi Mahajan

-e error_log_path

-l master_log_path

List of Startup OptionsOther startup options Description

-c

Shortens startup time when starting SQL Serverfrom the command prompt.

-f

Starts an instance of SQL Server with minimal configuration.

-m

Starts an instance of SQL Server in single-user

mode.-s Allows you to start a named instance of SQL Server.Presenter: Juhi Mahajan

AlwaysOn Availability Groups The AlwaysOn Availability Groups feature is a high-

availability and disaster-recovery solution that provides an enterprise-level alternative to database mirroring. An availability group supports a failover environment for a discrete set of user databases, known as availability databases, that fail over together. An availability group supports a set of read-write primary databases and one to four sets of corresponding secondary databases. Optionally, secondary databases can be made available for read-only access and/or some backup operations. Deploying AlwaysOn Availability Groups requires a Windows Server Failover Clustering (WSFC) cluster. Each availability replica of a given availability group must reside Presenter: Juhi Mahajan on a different node of the same WSFC cluster

Benefits Supports up to five availability replicas Supports alternative availability modes, as follows: Asynchronous-commit mode. Synchronous-commit mode. Supports a flexible failover policy for greater control

over availability-group failover Supports encryption and compression, which provide a secure, high performing transport.

Presenter: Juhi Mahajan

Availability group that contains the maximum number of availability replicas

Presenter: Juhi Mahajan

Achieving high availability and disaster recovery with AlwaysOn Availability Groups

Presenter: Juhi Mahajan

Presenter: Juhi Mahajan

SSIS Enhancements SSIS Toolbox You now work with the SSIS Toolbox to add tasks

and data flow components to a package, rather than with the Visual Studio toolbox Parameters The package designer includes a new tab to open the Parameters window for a package. Variables button This new button on the package designer toolbar provides quick access to the Variables window. SSIS Toolbox button This button is also new in the packagedesigner interface and allows you to open the SSIS Toolbox when it is not visible.

Scripting Engine The scripting engine in SSIS is an

upgrade to Visual Studio Tools for Applications (VSTA) 3.0 and includes support for the Microsoft .NET Framework 4.0.Presenter: Juhi Mahajan

SSIS Enhancements Undo and Redo You can now make edits in either the

control flow or data flow designer surface, and you can use Undo to reverse a change or Redo to restore a change you had just reversed. Status Indicators After executing a package, the status of each item in the control flow and the data flow displays in the package designer.

Presenter: Juhi Mahajan

New Task Added Control Flow Expression Task Expression Task can used to

construct a variable value at runtime. Execute Package Task The Execute Package Task has been updated to include a new property, ReferenceType, You use this property to specify the Location of the package to execute.

Presenter: Juhi Mahajan

New Task Added Data Flow Source and Destination Assistants These assistants help

you easily create a source or a destination and its corresponding connection manager. ODBC Source and Destination The ODBC Source supports Table Name and SQL Command as data-access modes, whereas data-access modes for the ODBC Destination are Table Name Batch and Table Name Row By Row. DQS Cleansing Transformation Its purpose is to help you improve the quality of data by using rules that are established for the applicable knowledge domain. You can create rules to test data for common misspellings in a text field or to ensure that the column length conforms to a standard specification.Presenter: Juhi Mahajan

SSRS Enhancements New Renderers Excel 2010 Renderer Word 2010 Renderer SharePoint Shared Service Architecture Service Application Configuration Subscriptions Power View It is a browser-based Silverlight

application that requires Reporting Services to run in SharePoint integrated mode using SharePoint Server 2010 Enterprise Edition.Presenter: Juhi Mahajan

SSAS Enhancements Server Modes for Analysis Services Instances:

Multidimensional, Tabular, and SharePoint Removal of the 4 Gigabyte Limit on String Storage for MOLAP Engine DistinctCount Performance Improvement in ROLAP Processing PowerPivot for Excel (SQL Server 2012) PowerShell for PowerPivot for SharePoint

Presenter: Juhi Mahajan