Microsoft SQL Server 2014 for Oracle DBAs Module 7

Slides:



Advertisements
Similar presentations
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Advertisements

© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Reprint Outstanding Transactions Report © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
Feature: Purchase Requisitions - Requester © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Dos and don’ts of Columnstore indexes The basis of xVelocity in-memory technology What’s it all about The compression methods (RLE / Dictionary encoding)
Brian Alderman | MCT, CEO / Founder of MicroTechPoint Pete Harris | Microsoft Senior Content Publisher.
MIX 09 4/15/ :14 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Feature: Payroll and HR Enhancements © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
Co- location Mass Market Managed Hosting ISV Hosting.
Dual Partitioning for improved performance in VLDBs Ashwin Rao Karavadi, Rakesh Parida Microsoft IT.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Windows 7 Training Microsoft Confidential. Windows ® 7 Compatibility Version Checking.
Multitenant Model Request/Response General Model.
Announcing Demo Announcing.
Module 9: Managing Schema Objects. Overview Naming guidelines for identifiers in schema object definitions Storage and structure of schema objects Implementing.
Session 1.
Built by Developers for Developers…. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
 Rico Mariani Architect Microsoft Corporation.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Assign an Item to Multiple Sites © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
NEXT: Overview – Sharing skills & code.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
SQL Server Indexes Indexes. Overview Indexes are used to help speed search results in a database. A careful use of indexes can greatly improve search.
Feature: Suggested Item Enhancements – Sales Script and Additional Information © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows.
Feature: Customer Combiner and Modifier © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
demo Instance AInstance B Read “7” Write “8”

customer.
06 | Modifying Data in SQL Server Brian Alderman | MCT, CEO / Founder of MicroTechPoint Tobias Ternstrom | Microsoft SQL Server Program Manager.
demo © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
demo Demo.
Session 1 Module 1: Introduction to Data Integrity
Feature: Void Historical/Open Transaction Updates © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
demo QueryForeign KeyInstance /sm:body()/x:Order/x:Delivery/y:TrackingId1Z
Feature: Suggested Item Enhancements – Analysis and Assignment © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and.
Windows Azure SQL Data Sync Name Title Microsoft Corporation.
projekt202 © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
The CLR CoreCLRCoreCLR © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks.
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.

IoCompleteRequest (Irp);... p = NULL; …f(p);
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
Microsoft SQL Server 2014 for Oracle DBAs Module 8
Installation and database instance essentials
Introduction to SQL Server Management for the Non-DBA
Возможности Excel 2010, о которых следует знать
Entity Based Staging SQL Server 2012 Tyler Graham
Title of Presentation 11/22/2018 3:34 PM
Office Mac /30/2018 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Title of Presentation 12/2/2018 3:48 PM
Sunil Agarwal | Principal Program Manager
8/04/2019 9:13 PM © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Windows 8 Security Internals
Виктор Хаджийски Катедра “Металургия на желязото и металолеене”
PENSACOLA ENERGY WORK PLAN OCTOBER 10, 2016
Title of Presentation 5/12/ :53 PM
Шитманов Дархан Қаражанұлы Тарих пәнінің
Title of Presentation 5/24/2019 1:26 PM
Using Smart Unit Tests to find bugs earlier in the development cycle
日本初公開!? Vista の新機能を実演 とっちゃん わんくま同盟 7/23/2019 9:09 AM
Title of Presentation 7/24/2019 8:53 PM
Presentation transcript:

Microsoft SQL Server 2014 for Oracle DBAs Module 7 11: Monitoring and performance tuning Microsoft SQL Server 2014 for Oracle DBAs Module 7   Managing schema objects

Managing indexes and views Module Overview 8: Managing schema objects Managing indexes and views  

Lesson 1: Managing tables, constraints, object identifiers, and naming 8: Managing schema objects Demonstration: Referential integrity via constraints  

Object identifiers and naming 8: Managing schema objects Object names and column names are not case sensitive in Oracle, but are sorted in the data dictionary in upper case unless forced to be case sensitive using delimiters Object and column names are stored in system catalog in the same case as specified in the DDL In Oracle and SQL Server, object names have to be unique within the same schema Defining schemas and ownership differ very slightly between Oracle and SQL Server  

There is a generic table definition syntax in Oracle and SQL Server Managing tables 8: Managing schema objects There is a generic table definition syntax in Oracle and SQL Server There are various types of tables in Oracle and SQL Server Components of column definition are column name, data type, default value and constraints (optional)  

40074A Managing constraints 8: Managing schema objects Types of constraints found in Oracle and SQL Server are: NOT NULL CHECK UNIQUE PRIMARY KEY FOREIGN KEY Constraints can be defined in-line with column definition or out-of-line as table constraints Constraints on single columns can be defined as column constraints or table constraints, and multi-column constraints are defined as table constraints Primary key constraints are enforced using unique indexes and NOT NULL constraints in both Oracle and SQL Server  

Demonstration: Referential integrity via constraints 8: Managing schema objects In this demonstration you will see how to: Define a table with a Primary Key Validate with Foreign Keys Insert data and view an exception and a success Demonstration Steps Open a New Query window within SQL Server Management Studio and select the AdventureWorks2012 database. Enter the following script to disable and drop the existing constraint on SalesTaxType: USE [AdventureWorks2012] GO ALTER TABLE [Sales].[SalesTaxRate] NOCHECK CONSTRAINT [CK_SalesTaxRate_TaxType] DROP CONSTRAINT [CK_SalesTaxRate_TaxType] GOCreate a new table to allow dynamic addition of tax types: CREATE TABLE [Sales].[SalesTaxType]( [TaxType] [tinyint] NOT NULL, [Name] [dbo].[Name] NOT NULL CONSTRAINT [PK_SalesTaxType_TaxType] PRIMARY KEY CLUSTERED ( [TaxType] ASC ) ON [PRIMARY] Populate the table with row constructors indicating tax type: INSERT [Sales].[SalesTaxType] ([TaxType], [Name]) VALUES (1, 'State/Province Sales Tax'), (More notes on the next slide)

Lesson 2: Managing triggers 8: Managing schema objects Demonstration: Referential integrity via triggers  

Trigger creation and maintenance 8: Managing schema objects SQL Server INSTEAD OF triggers similar to BEFORE triggers in Oracle SQL Server triggers are at the statement level Oracle uses – pseudo-row structures :new and :old SQL Server - pseudo-tables DELETED and INSERTED Unlike Oracle, SQL Server can define First and Last Trigger in a set.  

Demonstration: Referential integrity via triggers 8: Managing schema objects In this demonstration you will see how to: Define a trigger Validate and auto commit or rollback transaction (insert) Demonstration Steps Open a New Query window and select the AdventureWorks2012 database. Enter the following script to drop the foreign key constraint we created in the last demo: ALTER TABLE [Sales].[SalesTaxRate] NOCHECK CONSTRAINT [FK_SalesTaxRate_SalesTaxType_TaxType] GO DROP CONSTRAINT [FK_SalesTaxRate_SalesTaxType_TaxType] GOCreate a trigger for inserts or deletes to the SalesTaxRate table to see if the inserted type exists in the SalesTaxType table: IF EXISTS (SELECT * FROM sys.triggers WHERE object_id = OBJECT_ID(N'[Sales].[tIU_SalesTaxRate]')) DROP TRIGGER [Sales].[tIU_SalesTaxRate] CREATE TRIGGER [tIU_SalesTaxRate] ON [Sales].[SalesTaxRate] FOR INSERT, UPDATE AS BEGIN DECLARE @rows int SELECT @rows = count(*) FROM inserted i (More notes on the next slide)

Lesson 3: Managing indexes and views 8: Managing schema objects Demonstration: Partitioned indexes  

SQL Server provides indexing on XML and Spatial data types Working with indexes 8: Managing schema objects Unique and non-unique non-clustered B-tree indexes are found in both Oracle and SQL Server SQL Server clustered indexes are similar to Oracle index-organized tables SQL Server indexes can be created, dropped, rebuilt, or reorganized offline or online SQL Server provides indexing on XML and Spatial data types SQL Server 2014 includes in-memory optimized columnstore indexes to speed up data warehousing queries and compress data storage  

Oracle views can be defined with constraints and can be read-only Managing views 8: Managing schema objects Oracle views can be created even with lack of permissions or absence of the base objects, using FORCE clause In SQL Server definition of the view can be stored in “encrypted” form in the system catalog Oracle views can be defined with constraints and can be read-only WITH CHECK OPTION is found in both DBMSs  

Demonstration: More on columnstore indexes 8: Managing schema objects In this demonstration you will see how to: Create a non-clustered columnstore index Work with a clustered columnstore index Demonstration Steps In Object Explorer, expand Databases, then AdventureWorks2012, and then Tables. Scroll down to the Production.ProductInventory table and expand that table. Right-click the Indexes folder and select New Index. Type IX_ProductInventory_Shelf_Bin in the new index name box, leave the index type set to non- clustered, and leave the Unique checkbox unchecked. Click the Add and select the Shelf and Bin columns from the column selection dialog. Review, but don’t change any of the options on the Options page. On the Included Columns page or tab, click Add and select the Quantity column from the column selection dialog. On the Storage page, select the AW2012Idx filegroup for the new index. Click OK to create the index. The non-unique, nonclustered index you just crated is useful in physical inventory processing. It allows the application to quickly look up inventory by Shelf and Bin values. We created a covered index. When a query consists only of the following columns: ProductID, Shelf, Bin, and Quantity in the statement, it receives benefits. This is possible without creating a larger index, where all the columns are stored at every level of the B-tree. Because the data is in the leaf level, we have fewer scans against the entire table. This is possible for a few reasons: Quantity was “Included” in the index ProductID is part of the primary key Primary keys are automatically included in other indexes Right-click the Production.ProductInventory table and choose Select Top 1000 Rows. It should generate the following query: /****** Script for SelectTopNRows command from SSMS ******/ SELECT TOP 1000 [ProductID] (More notes on the next slide)

Demonstration: Partitioned indexes 8: Managing schema objects In this demonstration you will see how to: Define a partition function Define a partition scheme Assign an Index to a partition scheme Rebuild an Index for a single partition Demonstration Steps Open a New Query window and select the AdventureWorks2012 database. Enter the following script: CREATE PARTITION FUNCTION PF_ProductListPriceHistory(datetime) AS RANGE RIGHT FOR VALUES ('20010701','20011001','20020101','20020401', '20020701','20021001','20030101','20030401', '20030701','20031001','20040101','20040401', '20040701','20041001') GOGenerate a Partition Scheme and associate it with the Partition Function. CREATE PARTITION SCHEME PS_ProductListPriceHistory PARTITION PF_ProductListPriceHistory TO ([PRIMARY], [2001Q3],[2001Q4],[2002Q1],[2002Q2], [2002Q3],[2002Q4],[2003Q1],[2003Q2], [2003Q3],[2003Q4],[2004Q1],[2004Q2], [2004Q3],[2004Q4]) GOOnce the partition function and scheme have been created, create the index using the following script: USE [AdventureWorks2012] GO CREATE NONCLUSTERED INDEX [IX_ProductListPriceHistory_StartDate_EndDate] ON [Production].[ProductListPriceHistory] (More notes on the next slide)

Managing indexes and views Module Overview 8: Managing schema objects Managing indexes and views  Next up – Database security

© 2014 Microsoft Corporation. All rights reserved © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.