Lm th? no ? c?ng c? t?p tin v?t l? v ?i tn tn t?p tin h?p l? trong SQL Server 2000 v trong SQL Server 2005

D?ch tiu ? D?ch tiu ?
ID c?a bi: 814576 - Xem s?n ph?m m bi ny p d?ng vo.
Bung t?t c? | Thu g?n t?t c?

? Trang ny

TM T?T

Trong Microsoft SQL Server 2000 v trong MicrosoftSQL Server 2005, b?n c th? thm, xa, v ?i tn cc d? li?u t?p tin v cc t?p tin log giao d?ch. Bi ny gi?i thch lm th? no ? c?ng c? v?t l? t?p v lm th? no ? ?i tn tn t?p tin h?p l? trong SQL Server nm 2000 v trong SQL Server 2005.

THNG TIN THM


C?ng c? t?p tin v?t l?

B?n c th? c ? c?ng c? cc t?p tin ho?c gi?m thi?u s? l?ng v?t l? t?p tin cho m?t my ch? ang ch?y SQL Server 2000 ho?c SQL Server 2005. ? gi?m cc s? t?p tin v?t l?, b?n c th? xa cc t?p tin. C?ng c? cc t?p tin, b?n c th? d?n s?ch cc giao d?ch khng ho?t ?ng.

Xa cc t?p tin

ang xa b? d? li?u m?t ho?c m?t t?p s? ghi c?a giao d?ch lo?i b? cc t?p tin t? c s? d? li?u. Tuy nhin, b?n khng th? lo?i b? m?t t?p tin t? c s? d? li?u n?u t?p tin ch?a cc thng tin ng nh?p d? li?u ho?c giao d?ch. B?n ch? c th? lo?i b? m?t t?p tin n?u cc t?p tin l c s?n ph?m no. N?u b?n c d? li?u m b?n mu?n gi? l?i, b?n c th? di chuy?n d? li?u t? m?t t?p tin d? li?u cho cc t?p tin khc trong cng m?t filegroup. Di chuy?n d? li?u, b?n c th? s? d?ng m?t tuyn b? DBCC SHRINKFILE v xc ?nh cc kho?n EMPTYFILE. Sau , SQL H? ph?c v? khng c?n cho php d? li?u ? ?c chn vo trong t?p tin, v b?n c th? xo cc t?p tin b?ng cch s? d?ng m?t tuyn b? lm thay ?i c s? d? li?u.

B?n khng th? di chuy?n cc giao d?ch ng nh?p d? li?u t? t?p tin ng nh?p m?t trong nh?ng khc ? xa m?t b?n ghi c?a giao d?ch t?p tin.

ang d?n d?p cc giao d?ch khng ho?t ?ng

? t?y khng ho?t ?ng giao d?ch t? m?t t?p s? ghi c?a giao d?ch, b?n ph?i truncate hay sao lu cc b?n ghi c?a giao d?ch. Khi m?t giao d?ch ng nh?p t?p tin khng c c?n ch?a b?t k? giao d?ch ho?t ?ng ho?c khng ho?t ?ng, b?n c th? lo?i b? cc ng nh?p t?p tin t? c s? d? li?u. ? lo?i b? t?p s? ghi c s? d? li?u, s? d?ng cc th? b?c sau:
  • Thu h?p d? li?u hay thng tin trong m?t t?p tin v ? lm cho cc t?p r?ng, ch?y cu Transact-SQL sau y:
    DBCC SHRINKFILE ('<logical file name>', EMPTYFILE ) 
  • ? xa m?t t?p tin t? c s? d? li?u, ch?y sau y SQL giao d?ch n?i dung:
    ALTER DATABASE <Database name>  REMOVE FILE <logical file name> 
    

QUAN TR?NG Sau khi b?n thm ho?c xa cc t?p tin, t?o b?n sao lu c s? d? li?u ngay l?p t?c. B?n c?n ph?i t?o m?t b?n sao lu c s? d? li?u ?y ? tr?c khi b?n t?o m?t giao d?ch ng nh?p sao lu.

?i tn h?p l? tn t?p tin

? s?a ?i h?p l? tn t?p tin d? li?u ho?c m?t t?p s? ghi, ch? ?nh tn h?p l? t?p b?n mu?n ?i tn b?ng cch s? d?ng cc Tn tham s?, v sau ch? ?nh h?p l? tn m?i cho t?p b?i b?ng cch s? d?ng cc NewName tham s?. e oi ten tap tin h?p l?, ch?y sau y SQL giao d?ch n?i dung:
ALTER DATABASE <Database name>  MODIFY FILE  ( NAME = <current_logical_name>, NEWNAME = <new_logical_name>)

THAM KH?O

? bi?t thm chi ti?t, h?y truy c?p trang Web Microsoft sau y cc trang web:

Thm v xo b? d? li?u v t?p tin ng nh?p c?a giao d?ch

DBCC SHRINKFILE

V?t l? c s? d? li?u t?p tin v Filegroups

THAY ?I C S? D? LI?U

M? r?ng c s? d? li?u

Thu h?p l?i c s? d? li?u

Cho thm thng tin, b?m s? bi vi?t sau y ? xem cc bi vi?t trong cc C s? ki?n th?c Microsoft:
324432PRB: DBCC SHRINKFILE v SHRINKDATABASE l?nh c th? khng lm vi?c v? cng dn c tha th?t vn b?n, Ntext, hay h?nh ?nh c?t

Thu?c tnh

ID c?a bi: 814576 - L?n xem xt sau cng: 28 Thang Tam 2011 - Xem xt l?i: 2.0
p d?ng
  • Microsoft SQL Server 2000 Standard Edition
  • Microsoft SQL Server 2005 Developer Edition
  • Microsoft SQL Server 2005 Enterprise Edition
  • Microsoft SQL Server 2005 Express Edition
  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Workgroup Edition
T? kha:
kbsysadmin kbinfo kbhowto kbfaq kbmt KB814576 KbMtvi
My d?ch
QUAN TRONG: Bi vi?t ny ?c d?ch b?ng ph?n m?m d?ch my c?a Microsoft ch? khng ph?i do con ng?i d?ch. Microsoft cung c?p cc bi vi?t do con ng?i d?ch v c? cc bi vi?t do my d?ch ? b?n c th? truy c?p vo t?t c? cc bi vi?t trong C s? Ki?n th?c c?a chng ti b?ng ngn ng? c?a b?n. Tuy nhin, bi vi?t do my d?ch khng ph?i lc no c?ng hon h?o. Lo?i bi vi?t ny c th? ch?a cc sai st v? t? v?ng, c php ho?c ng? php, gi?ng nh m?t ng?i n?c ngoi c th? m?c sai st khi ni ngn ng? c?a b?n. Microsoft khng ch?u trch nhi?m v? b?t k? s? thi?u chnh xc, sai st ho?c thi?t h?i no do vi?c d?ch sai n?i dung ho?c do ho?t ?ng s? d?ng c?a khch hng gy ra. Microsoft c?ng th?ng xuyn c?p nh?t ph?n m?m d?ch my ny.
Nh?p chu?t vo y ? xem b?n ti?ng Anh c?a bi vi?t ny:814576

Cung cp Phan hi

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com