Policy-Based Management
Policy-Based Management enables the efficient management of multiple SQL Server instances from a single location. Easily create policies that control security, database options, object naming conventions, and other settings at a highly granular level. Policies can evaluate servers for compliance with a set of predefined conditions and prevent undesirable changes being made to servers.
Data compression
Data compression reduces the amount of storage space needed to store tables and indexes, which enables more efficient storage of data. Data Compression does not require changes be made to applications in order to be enabled.
Transparent Data Encryption
Transparent Data Encryption enables data to be stored securely by encrypting the database files. If the disks that contain database files become compromised, data in those files is protected because that data can only be de-encrypted by an authorized agent. SQL Server performs the encryption and de-encryption directly, so the process is entirely transparent to connecting applications. Applications can continue to read and write data to and from the database as they normally would. Backup copies of encrypted database files are also automatically encrypted.
Add Hot CPUs and Hot memory
Hot-add CPUs, a feature available with the 64-bit edition SQL Server Enterprise, allows CPUs to be dynamically added to servers as needed, without the need to shut down the server or limit client connections. Hot-add memory enables memory to be added in the same way.
Change Data Capture
Use Change Data Capture (CDC) to track changes to the data in your tables. CDC uses a SQL Server Agent job to capture insert, update and delete activity. This information is stored in a relational table, from where it can be accessed by data consumers such as SQL Server 2008 Integration Services. Use CDC in conjunction with Integration Services to incrementally populate data warehouses, enabling you to produce more frequent reports that contain up-to-date information. It also allows sync-enabled mobile and desktop applications to perform efficient data synchronization between client and server, without requiring changes to the database.
LINQ
Language Integrated Query (LINQ) is a .NET Framework version 3.5 feature that provides developers with a common syntax to query any data source from client applications. Using LINQ to SQL or LINQ to Entities, developers can select, insert, update, and delete data that is stored in SQL Server 2008 databases using any .NET programming language such as C# and VB.NET.
FILESTREAM data
FILESTREAM enables binary large object (BLOB) data to be stored in the Microsoft Windows NTFS file system instead of in a database file. Data that is stored using FILESTREAM behaves like any other data type and can be manipulated using T-SQL select, insert, update and delete statements. Unlike traditional BLOB storage, FILESTREAM data is logically shackled to the database while being stored efficiently outside the database in the NTFS file system. FILESTREAM data participates in all SQL Server transactions and backup operations, along with the rest of the database.
DATE / TIME Data Types
SQL Server 2008 introduces several new date and time based data types. DATETIME2 references the Coordinated Universal Time (UTC) instead of the system time for greater accuracy and can store date and time data to a precision of 100 nanoseconds. The new DATE and TIME data types enable you to store date and time data separately. The new DATETIMEOFFSET data type introduces time zone support by storing date, time and offset such as ‘plus 5 hours’.
Spatial data with GEOGRAPHY and GEOMETRY data types
New GEOGRAPHY and GEOMETRY data types allow spatial data to be stored directly in a SQL Server 2008 database. Use these spatial data types to work with location-based data that describes physical locations, such as longitude and latitude.
GEOGRAPHY enables you to represent three-dimensional geodetic data such as GPS applications use. GEOMETRY enables you to represent two-dimensional planar data such as points on maps. Spatial data types help you to answer questions like ‘How many of our stores are located within 20 miles of Seattle?’
Monday, January 25, 2010
SQL 2005 What's New
Database Administration:
Database Mirroring
Extend log shipping capabilities with the database mirroring solution. You will be able to use database mirroring to enhance availability of your SQL Server systems by setting up automatic failover to a standby server.
Online Restore
With SQL Server 2005, database administrators are able to perform a restore operation while an instance of SQL Server is running. Online restore improves the availability of SQL Server because only the data being restored is unavailable; the rest of the database remains online and available.
Dedicated Administrator Connection
SQL Server 2005 provides a dedicated administrator connection that administrators can use to access a running server even if the server is locked or otherwise unavailable. This capability enables administrators to troubleshoot problems on a server by executing diagnostic functions or Transact-SQL statements.
Snapshot Isolation
Snapshot Isolation (SI) level is provided at the database level. With SI, users can access the last committed row using a transitionally consistent view of the database. This capability provides greater scalability.
Data Partitioning
Data partitioning is enhanced with native table and index partitioning that enables efficient manageability of large tables and indexes.
Development:
Hosted CommonLanguage Runtime
With SQL Server 2005 developers can create database objects using familiar languages such as Microsoft Visual C# .NET and Microsoft Visual Basic .NET. Developers can also create two new objects—user-defined types and aggregates.
Native XML Support
Native XML data can be stored, queried, and indexed in a SQL Server database—allowing developers to build new classes of connected applications around Web services and across any platform or device.
Security Enhancements
The security model in SQL Server 2005 separate users from objects, provides fine-grain access, and enables greater control of data access. Additionally, all system tables are implemented as views, providing more control over database system objects.
Transact-SQL Enhancements
SQL Server 2005 provides new language capabilities for developing scalable database applications. These enhancements include error handling, recursive query capabilities, relational operator PIVOT, APPLY, ROW_NUMBER and other row ranking functions, and more.
Reliable Messaging for Asynchronous Applications
Service Broker is a robust messaging infrastructure that provides reliable transactional delivery of critical messages between servers—with the scalable high-performance that is expected with asynchronous queuing.
Visual Studio Integration
Tight integration with Microsoft Visual Studio and the .NET Framework streamlines development and debugging of data-driven applications. Developers can build database objects, such as stored procedures, using any .NET language and can seamlessly debug across .NET and Transact-SQL (TSQL) languages.
Business Intelligence:
Integration Services (SSIS)
SQL Server Integration Services (SSIS) is a next generation data integration platform that can integrate data from any source. SSIS provides a scalable and extensible platform that empowers development teams to build, manage, and deploy integration solutions to meet unique integration needs.
Reporting Services
SQL Server Reporting Services is a comprehensive, server-based reporting solution designed to help you author, manage, and deliver both paper-based and interactive Web-based reports.
Database Mirroring
Extend log shipping capabilities with the database mirroring solution. You will be able to use database mirroring to enhance availability of your SQL Server systems by setting up automatic failover to a standby server.
Online Restore
With SQL Server 2005, database administrators are able to perform a restore operation while an instance of SQL Server is running. Online restore improves the availability of SQL Server because only the data being restored is unavailable; the rest of the database remains online and available.
Dedicated Administrator Connection
SQL Server 2005 provides a dedicated administrator connection that administrators can use to access a running server even if the server is locked or otherwise unavailable. This capability enables administrators to troubleshoot problems on a server by executing diagnostic functions or Transact-SQL statements.
Snapshot Isolation
Snapshot Isolation (SI) level is provided at the database level. With SI, users can access the last committed row using a transitionally consistent view of the database. This capability provides greater scalability.
Data Partitioning
Data partitioning is enhanced with native table and index partitioning that enables efficient manageability of large tables and indexes.
Development:
Hosted CommonLanguage Runtime
With SQL Server 2005 developers can create database objects using familiar languages such as Microsoft Visual C# .NET and Microsoft Visual Basic .NET. Developers can also create two new objects—user-defined types and aggregates.
Native XML Support
Native XML data can be stored, queried, and indexed in a SQL Server database—allowing developers to build new classes of connected applications around Web services and across any platform or device.
Security Enhancements
The security model in SQL Server 2005 separate users from objects, provides fine-grain access, and enables greater control of data access. Additionally, all system tables are implemented as views, providing more control over database system objects.
Transact-SQL Enhancements
SQL Server 2005 provides new language capabilities for developing scalable database applications. These enhancements include error handling, recursive query capabilities, relational operator PIVOT, APPLY, ROW_NUMBER and other row ranking functions, and more.
Reliable Messaging for Asynchronous Applications
Service Broker is a robust messaging infrastructure that provides reliable transactional delivery of critical messages between servers—with the scalable high-performance that is expected with asynchronous queuing.
Visual Studio Integration
Tight integration with Microsoft Visual Studio and the .NET Framework streamlines development and debugging of data-driven applications. Developers can build database objects, such as stored procedures, using any .NET language and can seamlessly debug across .NET and Transact-SQL (TSQL) languages.
Business Intelligence:
Integration Services (SSIS)
SQL Server Integration Services (SSIS) is a next generation data integration platform that can integrate data from any source. SSIS provides a scalable and extensible platform that empowers development teams to build, manage, and deploy integration solutions to meet unique integration needs.
Reporting Services
SQL Server Reporting Services is a comprehensive, server-based reporting solution designed to help you author, manage, and deliver both paper-based and interactive Web-based reports.
Saturday, January 23, 2010
Monday, January 18, 2010
Fixed Server Roles
Members of the bulkadmin fixed server role can run the BULK INSERT statement.
Members of the dbcreator fixed server role can create, alter, drop, and restore any database.
The diskadmin fixed server role is used for managing disk files.
Members of the processadmin fixed server role can terminate processes that are running in an instance of SQL Server.
Members of the securityadmin fixed server role manage logins and their properties. They can GRANT, DENY, and REVOKE server-level permissions. They can also GRANT, DENY, and REVOKE database-level permissions. Additionally, they can reset passwords for SQL Server logins.
Members of the serveradmin fixed server role can change server-wide configuration options and shut down the server.
Members of the setupadmin fixed server role can add and remove linked servers, and also execute some system stored procedures.
Members of the sysadmin fixed server role can perform any activity in the server. By default, all members of the Windows BUILTIN\Administrators group, the local administrator's group, are members of the sysadmin fixed server role.
For details on role-level permission, execute sp_srvrolepermission rolename, e.g., sp_srvrolepermission processadmin
Members of the dbcreator fixed server role can create, alter, drop, and restore any database.
The diskadmin fixed server role is used for managing disk files.
Members of the processadmin fixed server role can terminate processes that are running in an instance of SQL Server.
Members of the securityadmin fixed server role manage logins and their properties. They can GRANT, DENY, and REVOKE server-level permissions. They can also GRANT, DENY, and REVOKE database-level permissions. Additionally, they can reset passwords for SQL Server logins.
Members of the serveradmin fixed server role can change server-wide configuration options and shut down the server.
Members of the setupadmin fixed server role can add and remove linked servers, and also execute some system stored procedures.
Members of the sysadmin fixed server role can perform any activity in the server. By default, all members of the Windows BUILTIN\Administrators group, the local administrator's group, are members of the sysadmin fixed server role.
For details on role-level permission, execute sp_srvrolepermission rolename, e.g., sp_srvrolepermission processadmin
Trap InputBuffer for all processes
declare @spid varchar(10)
declare @sql varchar(50)
Create Table #inputbuffer ([EventType] nvarchar(30),[Parameters] int,[EventInfo] nvarchar(4000),[SPID] varchar(10))
declare activesp cursor fast_forward for
select spid from master.dbo.sysprocesses where dbid > 1
open activesp
fetch next from activesp into @spid
while @@fetch_status = 0
begin
set @sql = 'dbcc inputbuffer(' + @spid + ')'
insert into #inputbuffer([EventType], [Parameters], [EventInfo])
exec (@sql)
update #inputbuffer set spid = @spid where spid is null
fetch next from activesp into @spid
end
close activesp
deallocate activesp
if @@cursor_rows <> 0
begin
close sprocket
deallocate sprocket
end
select * from #inputbuffer
drop table #inputbuffer
GO
declare @sql varchar(50)
Create Table #inputbuffer ([EventType] nvarchar(30),[Parameters] int,[EventInfo] nvarchar(4000),[SPID] varchar(10))
declare activesp cursor fast_forward for
select spid from master.dbo.sysprocesses where dbid > 1
open activesp
fetch next from activesp into @spid
while @@fetch_status = 0
begin
set @sql = 'dbcc inputbuffer(' + @spid + ')'
insert into #inputbuffer([EventType], [Parameters], [EventInfo])
exec (@sql)
update #inputbuffer set spid = @spid where spid is null
fetch next from activesp into @spid
end
close activesp
deallocate activesp
if @@cursor_rows <> 0
begin
close sprocket
deallocate sprocket
end
select * from #inputbuffer
drop table #inputbuffer
GO
Sunday, January 17, 2010
Re-organize or Rebuild index?
select object_name(A.object_id), I.Name, A.avg_fragmentation_in_percent,*
from sys.dm_db_index_physical_stats(db_id(),NULL,NULL,NULL,'detailed') as A -- detailed shows the record_count
inner join sys.indexes as I
On A.object_id = I.object_id And A.index_id = I.index_id
avg_fragmentation_in_percent:
<=30 - Reorganize
>30 - Rebuild
from sys.dm_db_index_physical_stats(db_id(),NULL,NULL,NULL,'detailed') as A -- detailed shows the record_count
inner join sys.indexes as I
On A.object_id = I.object_id And A.index_id = I.index_id
avg_fragmentation_in_percent:
<=30 - Reorganize
>30 - Rebuild
Database Recovery phases
There are 3 phases to a database recovery:
1. Data Copy: Involves copying all data, log, index pages from the backup file/media to the databases files.
2. Redo/Roll-forward: Involves applying the logged transactions to the data copied from the backup to roll forward that data to the recovery point. This includes uncommitted data too; therefore, the database is in an inconsistent state.
3. Undo: Involves rolling back the uncommitted transactions, bringing the database in a consistent state.
Finally, the Recovery brings the database online for users.
When NORECOVERY option is used, the restore process only completes the 1 phase - Data Copy. Therefore, neither committed transactions are rolled forward nor uncommitted transactions are undone/rolled back.
1. Data Copy: Involves copying all data, log, index pages from the backup file/media to the databases files.
2. Redo/Roll-forward: Involves applying the logged transactions to the data copied from the backup to roll forward that data to the recovery point. This includes uncommitted data too; therefore, the database is in an inconsistent state.
3. Undo: Involves rolling back the uncommitted transactions, bringing the database in a consistent state.
Finally, the Recovery brings the database online for users.
When NORECOVERY option is used, the restore process only completes the 1 phase - Data Copy. Therefore, neither committed transactions are rolled forward nor uncommitted transactions are undone/rolled back.
Subscribe to:
Posts (Atom)