Feed on
Subscription

Technology of SQL Server database (108)

16.3.1 snapshot is duplicate overview
Snapshot duplicates even if undertake to publishing data in some one hour " take a picture " ,The static file that makes state of instantaneous of a data in describing publication database,Database of the person that duplicate its to order in formulary time finally.Snapshot duplicates and do not duplicate to want to monitor ceaselessly in that way like general affairs, the data that dogs to happen in publication database varies,The content that it duplicates is not statement of INSERT, UPDATE, DELETE (the feature with duplicate general affairs) ,Also not be to be confined to those data be modificationed (amalgamative and duplicate feature) .It is the watch break that has level sex to ordering a database actually,Send the data in all publication databases to target database from source data library,is those data that produced change not just.If the paper is very big,The data that should duplicate so is very much,Because this is right network resource demand is higher,Should have rapidder transmission rate not only,And the dependability that should assure to transmit.
Snapshot duplicates is a most simple kind of duplicate type,Can be in publisher and the potential consistency that general affairs assures between the person that order.Snapshot duplicates to be used normally close in the following field:When needing real time data,When if having decision-making support, inquiry,the static state expresses information;Read-only the person that order (incorrect publication data undertakes the person that order revise) ,And do not need the closest data;The to the database modification frequency when using the person that order newlier instantly and data bulk are less.
The execution with duplicate snapshot needs to snapshot acts as agent and distribute a representative only.File of snapshot of snapshot representative preparation (the data file that includes publication list and descriptive file) store its in the snapshot folder of the person that distribute,Besides snapshot representative is in even of the person that distribute synchronous exercise dogs in distributing a database.In distributing a representative to distribute the snapshot work in distributing a database the purpose to server of the person that order to express.Distribute a database to be used at duplicate and including any users to express only.
When representative of every time snapshot is carried out,Should found will be distributed to come the data file of the person that order and descriptive file (also call synchronous gather) .Snapshot representative basically completes this one work through the following paces (16-24 seeing a picture) .

(1) be in to the join of publisher from the person that distribute publication paper was added on all medium watches share a lock.Sharing a lock is to ensure snapshot consistency of data,Because share a lock to will prevent all other users to undertake to the watch,revise.Snapshot acting behoove is carried out during activity of this database be been in by arrangement is less.

(2) snapshot representative is built again to the join of the person that distribute from publisher,In the file of a.sch that describes the watch of each watch the copy to go up to the person that distribute,This filestore is in a subdirectory that distributes database job catalog to fall.If the referenced integrality of index and statement includes in publication,Criterion in the.idx file that snapshot acts as agent to keep all index that are chosen the person that distribute.

(3) snapshot representative carries out snapshot to the data of the publication watch of publisher,Among the one file that keeps these data into the person that distribute to go up.In a subdirectory that this filestore issues in the working list that issues a database,If order person have SQL Server,Criterion snapshot by as.bcp filestore;If the one or more person that order is different compose database source,Criterion snapshot by the filestore of.txt text as character mode synchronous gather includes.sch and.bcp file,Each paper in publication has a synchronous rally.

(4) snapshot representative inserts new travel to the middle of the Msrepl_commands that distributes a database and Msrepl_trnsactions watch.The command that every record in Msrepl_command watch is the position such as demonstrate synchronism gather and publisher,Every record in Msrepl_trnsactions watch is to cite the command of task of synchronism of the person that order.

(5) snapshot representative releases what go up in each paper to share a lock finally.

Every time distributes a representative to issue data and descriptive document the person that order for what snapshot representative moves.Distribute a representative to finish this job through the following paces:
(1) the server that distributes a representative to be in from its establishs link to server of the person that distribute,Order to pushing,Distribute a representative to be located in on server of the person that distribute;Order to pulling,Distribute a representative to be located in on the person that order.

(2) the in distributing a database Msrepl_commands that distributes the person that acting examination is distributed and Msrepl_trnsactions watch are expressed from the first,Read take synchronous aggregate place and read the synchronous job that takes the person that order from these two watches.

(3) the command that in distributing a representative to will apply in the Msrepl_commands that distributes a database and watch of Msrepl _trnsactions in the database that order, discovers,On server of the person that duplicate data file and descriptive file to order thereby.If order person not be database of SQL Server,Distribute a representative to will change data type by the requirement.All papers in publication will be expressed in each by synchronism middleman and guarantor holds general affairs and referenced integrality.
When having the very much person that order,Should let distribute a representative to move on server of the person that order,Although use,pull order.Can reduce load of the person that distribute so,Improve its performance.If use,push order,The person that should order only orders publication or when publication is founded plans time comes,Snapshot representative can be carried out.But when the program time that snapshot representative executes comes,Only those doing not have just is met by the synchronous person that order by synchronism.

16.3.2 founds snapshot duplicate publication In SQL Server,Use Create Publication Wizard to be able to appoint which database to publish a database,The choice is expressed or memory process founds a paper to found duplicate publication thereby.

Notice:Should found duplicate publication must its have Sysadmin server part.Publication cannot cross many users database.

Use SQL Server Enterprise Manager founds duplicate publication to need to implement the following measure:
(1) the SQL Server Enterprise Manager that start,Server of pitch on publisher.
(2) in Tools of the choice in entree sheet,In Replication of next the choice in pulling menu,Choose option of Create And Manage Publications next,Can open Create And Manage Publications On right now ' Publisher ' dialog box.The 16-25 that be like a graph is shown:
(3) the database that chooses to prepare to publish in casing of Databases And Publications should choose option of Create Publication next,Open dialog box of Create Publication Wizard,Pitch on Show Advanced Option In Wizard,The 16-26 that be like a graph is shown.

(4) click " next " ,Open dialog box of Choose Publication Database,The 16-27 that be like a graph is shown.The watch that can choose to will publish which one database from inside Database casing, view or memory process.

(5) after choosing designation publication database,Click " next " ,Open dialog box of Select Publication Type,The 16-28 that be like a graph is shown,The duplicate kind that chooses to use from which.

[1] [2] [3] [4] issues one page

Related:

    收藏到网摘:

    Submit: