Dab tsi yog xauv hauv SQL?
Dab tsi yog xauv hauv SQL?

Video: Dab tsi yog xauv hauv SQL?

Video: Dab tsi yog xauv hauv SQL?
Video: Data Science with Python! Analyzing File Types from Avro to Stata 2024, Kaum ib hlis
Anonim

Xauv : Xauv yog ib tug mechanism los xyuas kom meej cov ntaub ntawv sib xws. SQL ntawv Server xauv khoom thaum qhov kev sib pauv pib. Thaum qhov kev hloov pauv tiav lawm, SQL ntawv Server tso tawm cov kaw khoom. Tshwj xeeb (X) Locks : Thaum no xauv hom tshwm sim, nws tshwm sim los tiv thaiv lwm yam kev hloov pauv lossis nkag mus rau a kaw khoom.

Kuj nug, dab tsi yog database xauv?

A database xauv yog siv rau " xauv "Qee cov ntaub ntawv hauv a database yog li ntawd ib leeg xwb database tus neeg siv / ntu tuaj yeem hloov kho cov ntaub ntawv tshwj xeeb. Locks feem ntau yog tso tawm los ntawm ROLLBACK lossis COMMIT SQL nqe lus.

Dab tsi yog hom xauv hauv SQL Server? SQL neeg rau zaub mov muaj ntau dua 20 ntau hom kev ntsuas phoo tab sis tam sim no cia peb tsom mus rau qhov tseem ceeb tshaj plaws.

  • Shared locks (S). Cov xauv no tau txais los ntawm cov neeg nyeem thaum nyeem cov haujlwm xws li SELECT.
  • Exclusive xauv (X).
  • Hloov tshiab xauv (U).
  • Lub hom phiaj xauv (IS, IX, IU, thiab lwm yam).

Tom qab ntawd, qhov ntsuas phoo yog dab tsi thiab feem ntau nws ua haujlwm li cas?

A xauv yog ib tug mechanism siv nyob rau hauv concurrency tswj los lav qhov tshwj xeeb kev siv ntawm ib cov ntaub ntawv keeb rau cov lw uas yog tus tswv xauv . Piv txwv li, yog cov ntaub ntawv keeb X tam sim no kaw los ntawm kev hloov pauv T1, kev hloov pauv T2 yuav tsis muaj kev nkag mus rau cov ntaub ntawv keeb X kom txog thaum T1 tso nws xauv.

Vim li cas xauv qhov tseem ceeb hauv SQL?

SQL ntawv Server xauv yog cov qhov tseem ceeb ib feem ntawm qhov yuav tsum tau cais tawm thiab nws ua haujlwm rau xauv cov khoom cuam tshuam los ntawm kev lag luam. Thaum cov khoom muaj kaw , SQL ntawv Server yuav tiv thaiv lwm yam kev hloov pauv los ntawm kev hloov pauv ntawm cov ntaub ntawv khaws cia hauv cov khoom cuam tshuam los ntawm kev yuam xauv.

Pom zoo: