SQL Server ѹËõÈÕÖ¾¿Õ¼ä
ʹÓÃÁËÒ»¶Îʱ¼äºó£¬SQL Server µÄ LDFÎļþÌå»ý¾Þ´ó.
ÈçºÎ´¦ÀíàÏ, ¶ÔÓÚ SQL Server 2005 ¼°Ö®Ç°µÄ°æ±¾£¬¿ÉÒÔʹÓÃÈçÏ SQL£º
declare @name varchar(50)
set @name='dbname
'
backup
log @name
with truncate_only
dbcc shrinkdatabase (@name,20)
¿ÉÊÇÔÚ SQL Server 2008 ¿ªÊ¼£¬Ö´ÐÐÉÏÃæµÄÓï¾ä»á±¨´í:
'truncate_only' is not a recognized BACKUP option.
ËùÒª»»Ò»ÖÖ·½Ê½:
Ê×ÏÈÒªÓÒ¼ü DB ÊôÐÔÖÐÉèÖà Option µÄ Recovery model Ϊ Simple,
ÔÙÖ´ÐÐÈçÏ SQL (ºì×Ö²¿·ÖÌæ»»³Éʵ¼ÊµÄ Files µÄÈÕÖ¾ÎļþµÄ Âß¼Ãû³Æ(Logical Name))
DBCC SHRINKFILE (N'agsr_log
' , 1)
GO
Ö´ÐÐÍêºó£¬ldf Îļþ±ä³É 1M µÄÄÚÈÝ.
Ïà¹ØÎĵµ£º
1,ÏÔʾÓαêµÄ²Ù×÷
(1) ¶¨ÒåÓαê
¸ù¾Ý²éѯµÄÊý¾ÝÇé¿ö£¬ÔÚPL/SQL¿éµÄÉùÃ÷²¿·Ö¶¨ÒåÓα꣬Ó﷨Ϊ£º
cursor cursor_name is select_statement;
×¢Ò⣺
Óαê±ØÐëÔÚPL/SQL¿éµÄÉùÃ÷²¿·Ö½øÐж¨Ò壻
......
ÎÒÃÇÔÚÊý¾Ý¿âÖÐʹÓñíµÄʱºò,¾³£»áÓöµ½Á½ÖÖʹÓñíµÄ·½·¨,·Ö±ð¾ÍÊÇʹÓÃÁÙʱ±í¼°±í±äÁ¿¡£ÔÚʵ¼ÊʹÓõÄʱºò£¬ÎÒÃÇÈçºÎÁé»îµÄÔÚ´æ´¢¹ý³ÌÖÐÔËÓÃËüÃÇ£¬ËäÈ»ËüÃÇʵÏֵŦÄÜ»ù±¾ÉÏÊÇÒ»ÑùµÄ£¬¿ÉÈçºÎÔÚÒ»¸ö´æ´¢¹ý³ÌÖÐÓÐʱºòȥʹÓÃÁÙʱ±í¶ø²»Ê¹Óñí±äÁ¿£¬ÓÐʱºòȥʹÓñí±äÁ¿¶ø²»Ê¹ÓÃÁÙʱ±íÄØ?
¡¡¡¡ÁÙʱ±í
¡¡¡¡ÁÙʱ±íÓëÓÀ¾Ã±íÏàËÆ£ ......
/*
±êÌ⣺һ¸öÏîÄ¿Éæ¼°µ½µÄ50¸öSqlÓï¾ä(ÕûÀí°æ)
×÷Õߣº°®Ð¾õÂÞ.ع»ª(Ê®°ËÄê·çÓ꣬ÊصñùɽѩÁ«»¨¿ª)
ʱ¼ä£º2010-05-10
µØµã£ºÖØÇ캽ÌìְҵѧԺ
˵Ã÷£ºÒÔÏÂÎåÊ®¸öÓï¾ä¶¼°´ÕÕ²âÊÔÊý¾Ý½øÐйý²âÊÔ£¬×îºÃÿ´ÎÖ»µ¥¶ÀÔËÐÐÒ»¸öÓï¾ä¡£
ÎÊÌâ¼°ÃèÊö£º
--1.ѧÉú±í
Student(S#,Sname,Sage,Ssex) --S# ѧÉú±àºÅ,Sname ѧÉúÐÕÃû,S ......