Free Newsletters:
DatabaseJournal  
DBANews
Search Database Journal:
 
HOME News MS SQL Oracle DB2 Access MySQL PostgreSQL PHP SQL Etc Scripts Links Discussion
internet.com

» HOME
» NEWS
» FEATURES
» SERIES
MS SQL
Oracle
MS Access
MySQL
DB2
» RESOURCES
Products
Scripts
Links
» DISCUSSION
» TECH JOBS

Marketplace Partners
Be a Marketplace Partner




internet.commerce
Be a Commerce Partner
Promote Your Website
Imprinted Promotions
Computer Hardware
Server Racks
Holiday Gift Ideas
Promotional Pens
Remote Online Backup
Condos For Sale
Data Center Solutions
Baby Photo Contest
Corporate Gifts
Web Design
GPS Devices
Compare Prices




MySpace Joins eBay, Yahoo in Open Profile Push

News Corp. Unit Under Fire for Ties to Hacker

Are Non-PC Devices Hurting 'Net Innovation?

internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Linked Data Planet Conference & Expo

CA ERwin® Data Modeler Proven database design and modeling. Efficiently analyze, design and deploy effective database solutions. Whitepaper: Manage SQL Server Deployments
Try it free: CA ERwin® Data Modeler


Solaris 8 Migration Assistant
Rapidly move your Solaris 8 application environments to new systems running Solaris 10 with the Solaris 8 Migration Assistant. Reduce migration risk while taking advantage of increased performance, reliability and security of the latest SPARC hardware platforms and Solaris 10 OS. »

 
Sun Eco Innovation: Good for Business, Good for the Environment
A complete solution to help you optimize and refresh your datacenter while properly recycling equipment and eliminating eWaste, including money-saving promotions to lower hardware acquisition costs. »

 
Sun Eco Innovation: Power Calculators
Power consumption has increasingly become a priority in customer's minds when purchasing new systems or storage. Sun's Power Calculators provide data on power consumption of Sun products allowing IT managers to better plan the power requirements in the datacenter to achieve better energy and cost savings. »

 
Optimize the Web Tier: Consolidate to Get More Performance in Less Space and Lower Power Consumption
Expansion in the Web tier is generally accomplished by adding more servers whenever extra capacity is needed. As the pool of servers grows larger, however, the complexity of the environment can grow exponentially. »

Production Manager (hands on)
Aquent
US-MA-Cambridge

Justtechjobs.com Post A Job | Post A Resume
MS SQL
March 5, 2004
MS SQL Server Distributed Partitioned Views
By Don Schlichting

This article will explore the use of Distributed Partitioned Views for accessing multiple MS SQL Severs when configured as a Federated Database.

Introduction

When performance gains are needed on very large databases, and your stored procedures are already optimized, and the application is already n-tiered out, and your hardware is already upgraded, its time for distributing the database work over several servers. For SQL Server, this is done by horizontally partitioning large tables over multiple servers. If we think of splitting one table with many columns, into several tables of only a few columns, as Vertical Partitioning, then Horizontal Partitioning is the act of taking one table with many rows, and splitting it into many tables with only a few rows. If these new smaller tables are placed on different servers, it is called a Federated Database configuration. The word Federated is used because all the servers involved may cooperate to balance the processing load. They will act as one federation. Once your data is split among several servers, a new type of statement is needed for retrieving records. These new statements are called Distributed Partitioned Views. They use standard SQL statements, along with the key word UNION, to pull data from all the distributed servers. DML statements (INSERT, UPDATE, and DELETE) can also be used when just a few special rules are observed on the underlying tables. While performance gains are going to vary from application to application, gains of 20% to 30% seem common.

There are three main configuration tasks. Start with attaching all of the severs to each other via Linked Servers, followed by creating matching tables on each server, and finally writing the new views.

In this example, we will distribute the SQL pubs "Authors" table across two different servers. The rules and procedures are identical regardless of the number of servers involved.

Linked Servers

For a detailed explanation of linked servers see previous article Linked Servers PART1.

The first step in creating the federation is to link all of the servers involved together. Start Query Analyzer as "sa," run from the first server. This code will link the second server to the first with an alias of "server2."

USE master
GO

EXEC sp_addlinkedserver
	@server = 'server2',
	@srvproduct = 'SQLServer OLEDB Provider',
	@provider = 'SQLOLEDB',
	@datasrc = 'InfoNet'

The @server variable is our alias. The @datasrc is the actual Sql server name. If there was more than one instance on the server, ServerName\InstanceName would have been used.

If the first server will be running all the views, and your Windows login has the appropriate rights to both machines, then special logins are not needed. However, if a different client will be executing the views, then login mappings may be needed. See Linked Servers PART3 and http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q238/4/77.asp&NoWebContent=1 for detailed explanations of linked server login options and client problems. We will assume remote clients may be wanted in the future, so a linked server login, mapping the local "sa" account to remote "sa" account, is being used as an example. For production, create a new login rather than expose "sa."

EXEC sp_addlinkedsrvlogin 'server2', 'false', 'sa', 'sa', 'secret'

To test the link, execute:

SELECT *
FROM server2.pubs.dbo.authors

All of the rows from Authors should be returned. We now need to repeat the same from server 2. This will create a link back to server1. Everything is the same except for the server name and alias. Login to the second server's Query Analyzer as "sa" and run:

USE master
GO

EXEC sp_addlinkedserver
	@server = 'server1',
	@srvproduct = 'SQLServer OLEDB Provider',
	@provider = 'SQLOLEDB',
	@datasrc = 'dons13'
GO

EXEC sp_addlinkedsrvlogin 'server1', 'false', 'sa', 'sa', 'secret'
GO

SELECT *
FROM server1.pubs.dbo.authors

If there were additional servers involved, each would require links to every other. The same type of design we had with NT multi-Domain security trusts. If there were four servers in our federation, it would have this landscape:

Server1 has a linked server to Server2, Server3, and Server4.

Server2 has a linked server to Server1, Server3, and Server4.

Server3 has a linked server to Server1, Server2, and Server4.

Server4 has a linked server to Server1, Server2, and Server3.

There is not an automated way to either create, or test these reciprocal links.

Go to page: 1  2  Next  

Tools:
Add databasejournal.com to your favorites
Add databasejournal.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed

MS SQL Archives

Whitepaper: Enterprise Information Integration--Deployment Best Practices for Low-Cost Implementation
Flash Demo: Learn how IBM Information Server Blade is easy to manage, highly scalable and efficient.
Webcast: Five Virtualization Trends to Watch. Produced for HP, Citrix, and Intel.
Download: SQL Compare Pro 6--The fastest, easiest way to compare and synchronize two databases.
IT in 2018: Download Free eBook By The Author Of "Does IT Matter?" Simple Registration Is Required.


Latest Forum Threads
MS SQL Forum
Topic By Replies Updated
How To Transfer Access Data Records To SQL ?? ankurdjariwala 1 May 8th, 12:24 PM
problem with federated server linking majidkhan 1 April 29th, 10:00 AM
"SELECT rowguidcol" from tables on linked servers? brentbordelon 1 April 25th, 04:12 PM
"SELECT rowguidcol" vs. "SELECT <actual name>" rgarrison 9 April 16th, 03:46 PM







JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES