Sie sind auf Seite 1von 176

please contact chuotlun4mat@gmail.

com

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Requirement and installation

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Requirement and license SQL server 2008 Editions: Edition Enterprise (x86,x64,IA64) Description Enterprise-class scalability High availability Full Bussiness Intelligence (BI) capabilities Built-in BI capabilities for departmental applications. SQL server Standard licensed for 75 or fewer computers. SQL server 2008 Enterpirse licensed for development and test only . Upgradable for production use For running local branch location database reporting remote synchronization Low total-cost-of-ownership option for web hosts and Web sites SQL server Express is free and can be redistributed by ISVs (subject to agreement ) SQL compact 3.5 is free , embedded database ideal for building stand-alone and occasionally connected applications

Standard (x86,x64) Small Business (x86,x64) SQL server 2008 Developer (x86,x64,IA64) Workgroup (x86,x64)

Web (x86,x64) Express (SSE)(x86,x64) SSE with tools (x86,x64) SSE with Adv Services (x86,x64) Compact 3.5 SP1 (x86) Compact 3.1 (x86)

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Installation SQL server Enterprise First your setup requirement after DVD running

Install start

First screen setup center

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Pass through setup center Above picture introduce planning installation Installation page

Maintenance page

Tools page

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Resource page

Advanced page

Option page

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Now we start install SQL server 2008 enterprise edition Click Installation page and then choose New SQL server standalone installation or

Rule checking progress

Enter product key and Next

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Accept license term and Next

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Setup support Files , Install

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Next step to setup Install SQL server 2008

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

It will check your requirement of your server and your result is reported for completely checking, if everything is alright ,Next

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Select feature for stand-alone ,Next

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Instant configuration

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Disk space requirement , Next

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Server configuration

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Note : Microsoft recommended that if you are in a domain you should use user account in domain for service management (Your service : SQL server agent , SQL server Database Engine , SQL server Browser ). These services operating with fully option if it is in domain Tab collation in Server configuration page choose your support language engine

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Choose user account to use SQL server

Error and Usage Reporting

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Installation Rules

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Ready to install

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Installation progress

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Complete install

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Start SQL server management

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Login screen

You complete your installation SQL server 2008 enterprise edition

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Optimizing SQL searches with Indexes

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Indexes in SQL server 2008 Clustered and Non Clustered Indexes Filtered XML Spatial Full-Text Clustered and non Clustered Indexes Clustered Indexes

Only one per table

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Data is ordered based on the key fields Provides excellent searching ability Required by some other indexes High maintenance cost when updates are frequent

Non clustered Indexes

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Up to 249 per table Uses pointer to link to data Affected by changes to clustered indexes

XML indexs Primary XML Index Secondary XML Indexes A shredded and persisted representation of the XML BLOBs

Spatial indexes Can be created only on a column of type geometry or geography Table must have a Primary key You can create up to 249 spatial indexes on a table Spatial indexes cannot be specified on indexed views Create indexes :
Design by chuotlun4mat@gmail.com 176

please contact chuotlun4mat@gmail.com

On database table right click on Indexes choose New indexes

Next screen choose indexes type you want to create and add column of table then click OK

Using T-SQL to create indexes [Create] / [Drop] / [alter] index [index name] on [table name](column name,); Filtered Indexes Create nonclustered index [index name] on [Tablename]( [field] ) where [condition]; Indexes for VIEW Requirement :

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

The ANSI_NULLS and QUOTED_IDENTIFIER option set to ON for CREATE VIEW The ANSI_NULL option set to ON for CREATE TABLE statements that create tables referenced by the view The view must not reference any other views All base tables referenced must be in the same database View must be created with SCHEMABINDING

User-defined functions use SCHEMABINDING option. Style of Create command is like creating index for table Index performance Disabling Query Statistic Collection Right click on index of table choose properties and then choose option .Check or uncheck Automatically recompute statistic to enable or disable Query Statistic Collection .

Addressing fragmentation and fill factor consideration. Right click on index of table choose properties and then choose fragmentation for addressing fragmentation or choose option to set fill factor
Design by chuotlun4mat@gmail.com 176

please contact chuotlun4mat@gmail.com

Note: to understanding fill factor or Query statistic please contact chuotlun4mat@gmail.com for full version . Database engine Tuning Advisor

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Choose your database machine , database , table to checked

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Choose tunning option

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Execute your SQL command and Click recommended tab

and then view

SQL server tuning advisor will show you what should do for performance of query.

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Full-Text Search

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Full-Text search terminology Full-text index Stores information about significant words and their location within a given column This information is used to quickly compute full-text queries that search for rows with particular words or combinations of words Full-text catalog A full-text catalog contain zero or more full-text indexes Each catalog can serve the indexing needs of one or more tables within a database Word breaker For a given language a word breaker tokenizes text based on the lexical rules of the language Token A word or a character string identified by the word breaker . Stemmer For a given language , a stemmer generates inflectional forms of a particular word based on the rules of that language Filter Given a specified file type , for example .doc , filter extract text form a file stored in a varbinary(max) or image column Population or Crawl Is the process of creating and maintaining a full-text index

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Noise list A list of stopwords that are filtered from the queries on that full-text index . they are frequently occurring words that do not help the search . Installing Full-Text search Click SQL server installation Center

Install new feature on Installation center

Choose source to install

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Setup support Rules

Installation type

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Select Full-Text search

Disk space requirement

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Server configuration

Error and reporting

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Installation rules

Ready to install

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Installation progress

Complete

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Creating a Full-Text Catalog and Full-Text Index Connect to SQL database server ,choose your tables , right click on tables

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Welcome screen click next

Select an index

Select table column

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Select change tracking

Select Catalog , Index FileGroup , and Stoplist

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Note : to understanding option which you choose, feel free to contact chuotlun4mat@gmail.com Define Population Schedules (Optional)

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Ready to create

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Progress

You can modify your creating through Full-Text properties

Configuring Full-Text searches Creating Full-Text Catalogs An object that contains the full-text indexes CREATE FULLTEXT CATALOG {NAME} as DEFAULT Creating Full-Text Indexes
Design by chuotlun4mat@gmail.com 176

please contact chuotlun4mat@gmail.com

Contains all the significant terms and their location CREATE FULLTEXT INDEX ON [TABLE_NAME]([Column name],) KEY INDEX [PRIMARY_KEY] Using the INFLECTIONAL Statement After configuring FULL-TEXT search you use inflectional for advanced language searching

Troubleshooting Full-Text search Dynamic Management Views Full-Text error log Dynamic management Views Sys.dm_fts_index_keywords Sys.dm_fts_index_keyworks_by_document Sys.dm_fts_parser Full-Text search error log

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

SQL server 2008 Security

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Authentication mode: Windows authentication vs SQL authentication Right click on database engine or database server :

Choose :

Need to restart sqlserver

Choose SQL server services , right click on SQL serverrestart Done for set authentication mode.

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Database-Level role

Server-role

Securable scope : Server databaseSchema

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

SQL server 2008 Data encryption SQL server 2008 Encryption Hierarchy Window level SQL server level Database level Encryption Hierarchy Components Asymmetric keys An asymmetric keys is made up of a private key and the corresponding public key. Each key can decrypt data encrypted by the other Asymmetric encryption and decryption are relatively resourceintensive , but they provide a higher level of security than symmetric encryption An asymmetric key can be used to encrypt a symmetric key for storage in a database Symmetric keys A symmetric key is one key that is used for both encryption and decryption Encryption and decryption by using a symmetric key is fast , and suitable for routine use with sensitive data in the database Certificates A public key certificate , usually just called a certificates , is a digitally-signed statement that binds the value of public key to the identity of the person , device or service that holds the corresponding private key Extensible Key Management (EKM)

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

EKM is a new feature in SQL server 2008 It enables parts of the cryptographic key hierarchy to be managed by an external source such as Hardware Security Module (HSM) Column encryption Application are impacted , No encryption delays for less sensitive data Transparent data encryption Encryption is hidden from users and applications , entire database is encrypted. SQL server 2008 column encryption Cell level Column encryption is implemented as a services of built-ins and a key management hierarchy Using this encryption is a manual process that requires a rearchitecture of the application to call the encryption and decryption functions. Encrypted data must be stored as varbinary and then re-cast back to the appropriate data type when read Column encryption is available in all SQL server editions Practice encryption :

Create column encrypted data

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Your result

Column / CELL Encryption Steps Create database master key for each database (Note : Service master key was created when the instance was created ) Create a certificates to protect the key Use certificate to create and protect the symmetric key Alter database to hold the encrypted data Open the key Encrypt the data Close the key When decrypt the data
Design by chuotlun4mat@gmail.com 176

please contact chuotlun4mat@gmail.com

Your result

Transparent data encryption Transparent data encryption(TDE) is a special case of encryption using a symmetric key TDE encrypt an entire database using that symmetric key called database encryption key The database encryption key is protected by other keys or certificates which are protected either by the database master key or by an asymmetric key stored in a EKM module TDE is available only in SQL server 2008 enterprise edition and sql server 2008 Developer edition Provide automatic query optimization techniques MSDN Practice

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Transparent Data encryption Steps Create the master key encryption password Create certificates Backup the certificate Create database encryption symmetric key Alter database to set encryption on Monitor encryption process Backup and restore with TDE enabled Take a backup database with TDE enabled

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Full backup

Take backup transaction

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Delete the database object and certificate for TDE Restore database

You get an error

Fix it by

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

And then restore database normally Using snapshot in SQL server 2008 Use command

View snapshots

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

SQL server 2008 High availability options Failover clustering Database mirroring Log shipping Replication Failover clustering Provides high availability for an entire instances of SQL server A combination of one or more servers (called nodes) Two or more shared disks The application service had a virtual name that is independent of the node names , and is referred to as the failover cluster instance name The application does not have to know which node hosts the failover cluster instance A sql server failover cluster instances appears on the networks as a single computer A failover cluster does not protect against disk failure Yu can use failover clustering to reduces system downtime and provide higher application availability Failover clustering is supported in SQL Server enterprise and SQL server Developer and SQL server standard Database mirroring Mirroring involves a principal database and a mirror database The mirror database is in accessible to clients A read-only snapshots of the mirror database can be made available

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Runs with either synchronous operation (high-safety mode ), or asynchronous operation (high-performance mode) High-safety mode with automatic failover involves a third witness server instance , which enables automatic failover Database mirroring partners and witnesses are supported on SQL server standard and sql server enterprise Partners must use the same edition High performance / asynchronous database mirroring in only supported only by SQL server enterprise edition Witnesses are also supported by SQL server workgroup and SQL server express Log shipping Similar to mirroring Operates at the database level Can use the secondary database for limited reporting Can have one or more secondary databases For failover the secondary database must be brought fully up-to-date by manually applying any unrestored log backups Support in SQL server enterprise , standard and workgroup editions Replication Can distribute data to one or more secondary servers (subscribers) Enables real-time availability across multiple servers Support filtering and partitioning of data sent to subscribers Subscribers are online and available for reporting or other function , without query recovery Supported in all edition of SQL server
Design by chuotlun4mat@gmail.com 176

please contact chuotlun4mat@gmail.com

Publishing is not available with SQL server Express or SQL server compact 3.5 SP1 Allow filtering in the database to provide a subset of data at the secondary database because it operates at the database scope Allow more than one redundant copy of the database Allows real-time availability and scalability across multiple databases , supporting partitioned updates Allow complete availability of the secondary databases for reporting or other function , without query recovery Replication and database mirroring Database mirroring can be used in conjunction with replication to provide availability for the publication database Replication failover to a mirror is support for publication database only It is not supported for the distribution database or subscription database Database mirroring is recommended over log shipping for additional fault tolerance in a replication environment Selecting a high availability Solution

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

How to install high availability

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Before install failover cluster Object SQL server virtual server Heartbeat Failover Failback Quorum resource Resource group Cluster resource Dependency Majority node cluster Failover cluster management Cluster witness disk or file share Logical unit number Description The group of clustered servers A UDP packet sent every 500 milliseconds The process of a new node coming online Reverse of the Failover Shared disk that holds cluster configuration Defines the items that failover An application and services A resource that must be online Each node contributes disk to the quorum Used to administer Window cluster Helps determine cluster state Identifies a disk presented to a host

Prerequisites

Two or more identical servers Window server 2008 enterprise or data center edition Two network interface per server Shared disk storage Distributed transaction Coordinator Identical drive letter mapping for shared disk Allow access through window 2008 firewall Window server 2008 Failover clustering in place
Design by chuotlun4mat@gmail.com 176

please contact chuotlun4mat@gmail.com

Separate service accounts for Microsoft Failover cluster server and SQL server services All node must be identical including all software and service pack hotfixes. NETBIOS must be disabled All hardware and software certified by microsoft and be on its window catalog and Hardware Compatibility List Network adapters must be listed in the order they are accessed network services Separate network names and Ipv4 address for each services and application group All server must use DNS for name resolution All server must be the same domain All servers should have the same domain role Practice

Start SQL server Installation center

Choose

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Choose image data

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Database Mirroring

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Mirroring overview Increase data protection

Database mirroring provides complete or almost complete redundancy of the data , depending on whether the operating mode is high-safety or high-performance Increase availability of the database : In the event of a disaster , in high-safety mode with automatic failover , failover quickly brings the standby copy of the database online (without data loss ). Improves the availability during upgrades : You can sequentially upgrade the instance of SQL Server that are participating in the database mirroring session . This is known as a rolling upgrade . You cannot mirror system database : Master , msdb, tempdb , model , or distribution

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Operating mode : High-safety mode or synchronous operation Under high-safety mode changes are committed on both servers with or without automatic failover High-performance or asynchronous operation The principal server does not wait for acknowledgement from the mirror . The mirror may or may not keep up with the log records sent by the principal server Mirroring role: Principal server Server instance that server the database to client Mirror database Second instance that acts as a hot or warm standby server Witness server High-safety mode with automatic failover requires a third server instance , known as a witness

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

The mirror server initiates automatic failover only if the mirror and the witness remain connected to each other after both have been disconnected from the principal server Mirroring service account : When connecting the two instances what get authenticated is the service account For two server instances to communicate in the database mirroring session The login account of each instances requires access to the other instances Each login account requires connect permission to the database mirroring endpoint of the other instance A domain account (DOMAIN\UserName) is recommended PRACTICE: Setting up server engine service account . Join your server SQL server to domain AD . Now your server SQL server with SQL server engine is a user in domain

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Edit your SQL server services:

Choose your SQL server service

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Choose your sql server serivce User : SQL server engine in your domain

restart services sql server and you complete step1 Some topic you must be cover before continue configure Database mirroring session Mirroring occurs within a session

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Database mirroring endpoint an endpoint is a SQL server object that enables SQL server to communicate over the network For database mirroring , a server instances requires its own , dedicated database mirroring endpoint All mirroring connections on a server instances use a single database mirroring endpoint This endpoint is a special-purpose endpoint used exclusively to receive database mirroring connection from other server instances . Client connection to the principal server do not use the database mirroring endpoint Each database mirroring endpoint listen on a unique TCP port number . The database mirroring endpoint of a server instances controls the port on which that listens for database mirroring message from other server instances.

Creating endpoint : Principal server instances:

Mirror server instance:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Witness server instance:

Role switching : Automatic failover : in the presence of a witness , high-safety mode supports automatic failover Automatic failover occurs only on the loss of the principal server when the witness and mirror server are still connected to each other and the database is already synchronized

Manual failover : High-safety mode support manual failover Whenever the database is synchronized , the database owner can initiate a manual failover Manual failover is provider for administrative purpose

For service (with possible data loss) Forcing service is supported in high-safety mode no witness is set and in high-performance mode . On the loss of the principal server , the database server owner can make the database available by forcing service to the mirror server

CONFIGURE ENDPOINTs AND STARTING MIRRORING Take a backup full and transaction log on principal server and restore it to mirroring server . sure with this. On principal server take mirroring

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Configuring security

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Welcome next (@_@) For higher performance choose witness server

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Choose default

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Next step connect to mirroring server and witness server ; you need login by user and pass for these server , or by the way use computer account for SQL server same on these machine (nicely for window ;easy to install ) - leave blank

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Complete

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Do you want to start ?

that s all

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

And this is recommend when you configure : The partner should run on comparable system that can handle identical workloads The path (including the drive letter ) of the mirror database should be identical to the path of the principal database All of the server instances in a mirroring session should use the same collation . Differences will cause mirroring setup to fail Database mirroring can support a maximum of 10 database per server instances Works only with database that use the full recovery model Database mirroring does not support FILESTREAM

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Can not mirror system database .

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Log Shipping

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Log shipping overview : Automatically send transaction log backups from a primary database on a primary server instance to one or more secondary database . Support an optional third server instance known as the monitor server Log shipping consists of three operations: Backup the transaction log at the primary server instance Copy the transaction log file to the secondary server instance Restore the log backup on the secondary server instance The log can be shipped to multiple secondary server instances Does not automatically fail over from the primary server to the secondary server You can use the secondary database for reporting purposes Can configure alerts for your log shipping configuration.

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Edition support : Enterprise Standard Workgroup Web Log shipping servers: Primary server and database : Your production server Hosts the primary database All administration of the log shipping configuration Must use the full or bulk-logged recovery model Secondary server and database: Warm standby copy of your primary database . Can contain backup copies of database from several different primary servers . The secondary database must be initialized by restoring a full backup of primary database . Monitor server (optional) Tacks all of the details of log shipping such as : When the transaction log on the primary database was last backed up When the secondary servers last copies and restored the backup files Information about any backup failure alerts Should be on a server separate from the primary or secondary servers A single monitor server can monitor multiple log shipping configurations

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Log shipping setup ; Choose server for your primary server , secondary server , and optional monitor server Create a file share for the transaction logs backup Choose a backup schedule for the primary database Create a folder for each secondary server into which the transaction log backup files will be copied Configure one or more secondary database Optionally configure a monitor server Share folder permission:

Full control or if you know permission window (-_-) secret by

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

On server of primary database :

Configure backup setting:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Choose your share folder :

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

You can edit schedule by click on Schedule:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Add server instances:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Choose secondary database :

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Choose share folder :

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Choose restore mode:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Hit ok and success:

Status of primary database log shipping:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Status of log shipping:

Primary server tables :

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Secondary server tables:

Monitor server tables :

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

SQL server 2008 replication

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Distributing data and database objects Data redundancy Faster access Server to server replication:

Server to client replication

The SQL server 2008 replication roles : Publisher The data source publisher

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Distributor Store replication data Local Distributor VS Remote Distributor

Subcriber Database instance that receives data

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

The players: SQL server agent the boss

Snapshot agent it is used in all form of replication

Log reader Agent Used in transactional replication Extracts and sends transactions from publishers log

Distribution Agent Dispatcher

Merge agent Use merge Replication

Configure Replication :

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

12-

add computer to domain Create domain account Configure the firewall Install SQL Server and replication Configure Distribution Create the publication Configure the subscriber Create the subscribtion Verify data was replicated at the subsscriber Your computer need to add to domain (your database need to replicate) Create domain account

Create an user account for manage mdm in your domain add this login to SQL server (main + replicate server ) add server roles sysadmin And this is replication User account

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Your user account:

Configure the firewall: Add program SQL server management studio to exception firewall and add port exclude 1433 with name sql server .

Remember all machine to need configure this Install sql server and replication for all machine in your replication

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

This is next step:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Next choosing

Next choosing

next choosing:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Next choosing:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Default for many require and message: and install this

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Complete install

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Configuring Distribution: On main server database source :

Choose this :

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Welcome next

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Choose this or you dont like:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

You need start automatically for SQl server agent

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Choose snapshot folder :

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Choose distribution database :

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Publisher:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

End configure :

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Finish to complete:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Configure complete:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Your system database have a database for distributor:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Configure distribution: Remember many user we created in domain , now you need to add this to SQL server role : Repl_logreader Repl_snapshot Repl_distribution Repl_merge and add user mapping to database :

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

And your database need to replication

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Remember path for replication you install on first step : Find this: Share this to network : Add users and for full control on this folder:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

And add users to security of folder with full control permission:

End of configure for Distribution: Create publication:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Choose this :

Welcome next

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Choose database for publication:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Next on next screen:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Choose table for replication (need primary key)

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Filter tables row if you need:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Create snapshot:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

User for agent :

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Creating

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Finish:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Complete:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Check configure :

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Configure the subscriber:

Welcome next:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Choose publication:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Default on next screen:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Add subscribers:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Configure security:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Add user repl_distribution

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Next

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Schedule:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Start

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Create and finish

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

On secondary database (replication ) You will see your database with name Eastern

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Now some word you need understand : Publisher: Source of the replicated data Distributor: Handles distribution of the data Can be on a separate computer Subscriber: The recipient of the replicated data Article: Data and objects that will be shared or replicated

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Publication : A group of articles just like a newspaper or magazine Subscription: The plan for who gets what publication and when

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Resource governor

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Manage resource utilization Demand for database services will continue to increase. You are always on a path towards disaster The best DBA may go completely unnoticed Can managed Run away process Login priority

Classification :

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

A classifier function : Can classify incoming request based on various criteria : Login Database name Host name Application name Connection properties such as IP address or protocol

Create a classifier function:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Example :

Security for resource governor To change the resource governor configuration , a user requires CONTROL SERVER permission (sysadmin role) To view active configuration , a user requires VIEW SERVER STATE permission (serveradmin role) Enable : ALTER RESOURCE GOVERNOR RECONFIGURE Disable: ALTER RESOURCE GOVERNOR DISABLE Resource pool Pools of system resource are defined and the percentage of those resources is located to the pool Used to minimize the effect of runaway process Groups system resources and access levels Presently only CPU time and memory can be managed

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Create resource pool

Workloads group Workload group server as container for processes running against the database . these container or group are mapped to specified resource pool

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Create resource pool and workloads group

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Performance tuning

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

SQl server profiler Can step through queries for troubleshooting Identify slow queries Capture traces for analysis and relay Provide input for the Database Engine tuning Advisor Find problems related to locks and deadlock situations Pre-built configuration template Database engine tuning Advisor Helps automates SQL server optimization Can suggest Adding / deleting indexes Adding new partition Adding Statistics

Comes with pre-define configuration templates Customizable Generates T-SQL code for recommended changes Can use SQL server Profiler trace as input Can evaluate queries for optimization How to use this ,(@_@) it is a secret

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

SQL server 2008 Integration services

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Integration service Business Intelligence (BI ) The practice of taking raw data and making it useful for supporting business goal and decision Integration Service (SSIS ) Integration of information from various systems Analysis Services (SSAS ) Data analysis tools supporting business decisions Reporting services (SSRS) Reporting tools creating , running and maintaining custom reports Cover in integration services Integration services is a platform for building high performance data integration and workflow solution , including extraction , transformation , and loading (ETL) operations Merging Data from Heterogeneous Data Stores Cleaning and Standardizing Data How to use :

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Set service account;

Set account

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Configure firwall

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Add port :

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Edit file MsDtsSrvr.ini.xml

Edit this file , for more information need an help in microsoft:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

In some case you must edit registry window Import wizard :

Welcome next
Design by chuotlun4mat@gmail.com 176

please contact chuotlun4mat@gmail.com

Choose source data:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Choose data source

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Complete data source:

View data

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Choose destination:

Choose table destination:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

You can edit mapping table:

Choose SSIS package:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Choose save package:

Summary and finish

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Connect integration server:

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Choose run package:

This is complete for ETL (extract , transform and load)

Design by chuotlun4mat@gmail.com

176

please contact chuotlun4mat@gmail.com

Excute for complete data warehouse and BI Its very expensive cost

Design by chuotlun4mat@gmail.com

176

Das könnte Ihnen auch gefallen