SQL Server 2005ÖеÄÎļþºÍÎļþ×é
1¡¢ÎļþºÍÎļþ×éµÄº¬ÒåÓë¹Øϵ
ÿ¸öÊý¾Ý¿âÓÐÒ»¸öÖ÷Êý¾ÝÎļþ.ºÍÈô¸É¸ö´ÓÎļþ¡£ÎļþÊÇÊý¾Ý¿âµÄÎïÀíÌåÏÖ¡£ Îļþ×é¿ÉÒÔ°üÀ¨·Ö²¼ÔÚ¶à¸öÂß¼·ÖÇøµÄÎļþ£¬ÊµÏÖ¸ºÔØƽºâ¡£Îļþ×éÔÊÐí¶ÔÎļþ½øÐзÖ×飬ÒÔ±ãÓÚ¹ÜÀíºÍÊý¾ÝµÄ·ÖÅ䣯·ÅÖá£ÀýÈ磬¿ÉÒÔ·Ö±ðÔÚÈý¸öÓ²ÅÌÇý¶¯Æ÷ÉÏ´´½¨Èý¸öÎļþ£¨Data1.ndf¡¢Data2.ndf ºÍ Data3.ndf£©£¬²¢½«ÕâÈý¸öÎļþÖ¸Åɵ½Îļþ×é fgroup1 ÖС£È»ºó£¬¿ÉÒÔÃ÷È·µØÔÚÎļþ×é fgroup1 ÉÏ´´½¨Ò»¸ö±í¡£¶Ô±íÖÐÊý¾ÝµÄ²éѯ½«·ÖÉ¢µ½Èý¸ö´ÅÅÌÉÏ£¬Òò¶øÐÔÄܵÃÒÔÌá¸ß¡£ÔÚ RAID£¨´ÅÅÌÈßÓàÕóÁÐ)Ìõ´ø¼¯ÉÏ´´½¨µ¥¸öÎļþÒ²¿ÉÒÔ»ñµÃÏàͬµÄÐÔÄܸÄÉÆ¡£È»¶ø£¬ÎļþºÍÎļþ×éʹÄúµÃÒÔÔÚдÅÅÌÉÏÇáÒ×µØÌí¼ÓÐÂÎļþ¡£ÁíÍ⣬Èç¹ûÊý¾Ý¿â³¬¹ýµ¥¸ö Microsoft Windows ÎļþµÄ×î´ó´óС£¬Ôò¿ÉÒÔʹÓôÎÒªÊý¾ÝÎļþÔÊÐíÊý¾Ý¿â¼ÌÐøÔö³¤¡£
2¡¢Îļþ¡¢Îļþ×éÔÚʵ¼ùÓ¦ÓÃÖг£¼ûµÄÎÊÌâ
ͨ³£Çé¿öÏÂÎÒÃǹ¹ÔìµÄÊý¾Ý¿â¶¼Ö»ÓÐÁ½¸öÎļþ,mdfÎļþºÍldfÎļþ.µ«ÊÇÕâÑùÓÐÁ½¸öȱµã£º
(Ò»)ÈÝÒ×µ¼ÖÂÎļþ¹ý´ó
ÎÒÃÇÖªµÀ,mdfÎļþÊÇÊý¾Ý¿âÎļþ,ÕâÑùµÄ»°Ò²¾ÍÒâζ×ÅËæ×ÅÊý¾Ý¿âµÄÔö´ómdf¾Í»áÏàÓ¦µÄÔö´ó,ÏÔÈ»ÔÚÏÖÔÚµÄÓ¦ÓÃÖÐÊý¾ÝÅòÕÍÊÇÌ«³£¼ûµÄÊÂÇéÁË,µ±ÄãµÄÓ¦Óñä´óºó,mdfÎļþÒ²»á±ä´ó,È»¶øwindows¶ÔÎļþµÄ´óСÊÇÓÐÒªÇóµÄ,ÕâÑùµÄ»°ºÜÈÝÒ×µ¼ÖÂmdfÎļþ´ïµ½windowsËùÔÊÐíµÄÎļþ´óСµÄ½çÏÞ(ÓÚÊÇÊý¾Ý¿â¾Í±ÀÀ£ÁË)¡£
(¶þ)ûÓÐÀûÓõ½´ÅÅÌÕóÁÐ
´óÐ͵ķþÎñÆ÷ºÃ¶à¶¼ÓдÅÅÌÕóÁÐ,Äã¿ÉÒÔ°Ñ´ÅÅÌÕóÁмòµ¥µÄ¼ÙÏó³Én¸öÒ»¿éת¶¯µÄ´ÅÅÌ,´ÅÅÌÕóÁеÄÉè¼ÆÊÇÏ£Íûͨ¹ý¶à¸ö´ÅÅ̵Ĵ®ÁªÀ´µÃµ½¸ü´óµÄ¶ÁдЧÂÊ.µ«ÊÇÈç¹ûÄãµÄÊý¾Ý¿âÖ»ÓÐÒ»¸ömdfÎļþ(ldfÎļþÔÝʱ²»¿¼ÂÇ),ÄÇôÄã×ÜÊÇÖ»Äܹ»ÀûÓÃÕâ¸ö´ÅÅÌÕóÁÐÀïÃæµÄÒ»¸ö´ÅÅ̶øÒÑ.ÄÇÑùµÄ»°°º¹óµÄ´ÅÅÌÕóÁеÄЧÂʾÍÓɲ¢Áª±ä³É´®ÁªÁË.ÊÔÏëÈç¹ûÎÒÃÇÄܹ»ÈÃmdf·ÖÉ¢³É¶à¸öÎļþ,±ÈÈç˵´ÅÅÌÕóÁÐÉϵÄÿ¸ö´ÅÅÌÖж¼·ÖÅäÒ»¸öÎļþ,È»ºó°ÑmdfÖеÄÊý¾Ý·ÖÉ¢µ½¸÷¸öÎļþÖÐ,ÎÒÔÚ¶ÁÈ¡µÄʱºò¾ÍÊÇ´®ÁªµÄ¶ÁÈ¡ÁË,ÕâÑù¾Í³ä·ÖµÄÀûÓÃÁË´ÅÅÌÕóµÄ´æȡЧÄÜ.
ÕâÁ½¸öÎÊÌâƽ³£ÎÒÃÇûÓÐÓöµ½¹ý(Ìõ¼þ²»¾ß±¸),µ«ÊÇ×ö´óÐ͵ķþÎñ¿ª·¢µÄʱºòÕ⼸ºõÊÇÖÂÃüµÄ.
3¡¢²éѯÎļþ×éºÍÎļþÓï¾ä
ÕâÔÚ2005Ï£¬ÔËÐÐ
SELECT df.[name],
df.physical_name,
df.[size],
df.growth,
f.[name][filegroup],
f.is_default
from sys.database_files df JOIN sys.filegroups f
ON df.data_space_id = f.data_space_id
4¡¢MSDN¹Ù·½½âÊÍ
Á˽âÎļþºÍÎļþ×é
ÿ¸ö SQL Server Êý¾Ý¿âÖÁÉÙ¾ßÓÐÁ½¸ö²Ù×÷ϵͳÎļþ£ºÒ»¸öÊý¾ÝÎļþºÍÒ»¸öÈÕÖ¾Î
Ïà¹ØÎĵµ£º
T-SQL Script
Output format
SELECT CONVERT(VARCHAR(100), GETDATE(), 0)
03 6 2010 4:19PM
SELECT CONVERT(VARCHAR(100), GETDATE(), 1)
03/06/10
SELECT CONVERT(VARCHAR(100), GETDATE(), 2)
10.03.06
SELECT CONVERT(VARCHAR(100), GETDATE(), 3)
06/03/10
SELECT CONVERT(VA ......
@SuppressWarnings("unchecked")
public List<ZxFunction> selectFunctionParentByUserId(final int userId) {
try {
final String sql = "select * from zx_function ......
Óû§¡¢×é»ò½ÇÉ«′sde'ÔÚµ±Ç°Êý¾Ý¿âÖÐÒÑ´æÔÚ
Use dbName
go
sp_change_users_login ‘update_one’
,
‘loginName’
, ‘loginName‘
Õª×Ô:http://www.softbunny.net/post/SQL_Login_User.shtml
......
Óï·¨£º
CREATE [Ë÷ÒýÀàÐÍ] INDEX Ë÷ÒýÃû³Æ
ON ±íÃû(ÁÐÃû)
WITH FILLFACTOR = Ìî³äÒò×ÓÖµ0~100
GO
/*ʵÀý*/
USE ¿âÃû
GO
IF EXISTS
(SELECT * from SYSINDEXES WHERE NAME='IX_TEST_TNAME')--¼ì²âÊÇ·ñÒѾ´æÔÚIX_TEST_TNAMEË÷Òý
DROP INDEX
TEST.IX_TEST_TNAME--Èç¹û´æÔÚÔòɾ³ý
--´´½¨Ë÷Òý
CREATE NONCLUSTER ......