SQL Server±¸·ÝÊÂÎñÈÕÖ¾½áβ(Tail)
ÊÂÎñÈÕÖ¾½áβ¾³£Ìá½»Êý¾Ý¿âδ±¸·ÝµÄÊÂÎñÈÕÖ¾ÄÚÈÝ¡£»ù±¾ÉÏ£¬Ã¿Ò»´ÎÄãÖ´ÐÐÊÂÎñÈÕÖ¾±¸·Ýʱ£¬Ä㶼ÔÚÖ´ÐÐÊÂÎñÈÕÖ¾½áβµÄ±¸·Ý¡£
ÄÇΪʲô»áÕâôÉè¼ÆÄØ£¿ÒòΪҲÐíÓÉÓÚ½éÖʵÄË𻵣¬µ±Êý¾Ý¿âÒѾ²»ÔÙ¿ÉÓÃʱ£¬Âé·³¾ÍÀ´ÁË¡£Èç¹ûÏÂÒ»¸öÂß¼²½ÖèÕýºÃ¾ÍÊÇÒª±¸·Ýµ±Ç°ÊÂÎñÈÕÖ¾µÄ»°£¬¿ÉÒÔÓ¦ÓÃÕâ¸ö±¸·ÝÀ´Ê¹Êý¾Ý¿â´¦Óڵȴý(Standby)״̬¡£ÄãÉõÖÁ¿ÉÒÔÔÚÊý¾Ý¿âÎļþ²»¿ÉÓõÄ״̬ÏÂʹÓÃNO_TRUNCATEÀ´±¸·ÝÊÂÎñÈÕÖ¾£¬ÀýÈ磺
BACKUP LOG AdventureWorks TO DISK = 'G:\Backups\AdventureWorks_log_tail.bak' WITH NO_TRUNCATE
È»ºó£¬Äã¿ÉÒÔʹÓñ¸·ÝÈÕÖ¾µÄ½á¹û°Ñ´¦Óڵȴý״̬µÄÊý¾Ý“´ø»Ø”µ½·¢Éú´íÎó֮ǰµÄ״̬¡£
×¢Ò⣺ÕâÒ²ÊÇÁíÒ»¸öÈÃÄã°ÑÊÂÎñÈÕÖ¾ÎļþͬÊý¾ÝÎļþ·ÅÔÚ²»Í¬´ÅÅÌÉϵÄÔÒò¡£Èç¹ûËüÃÇÔÚͬһ¸ö´ÅÅÌÉϵĻ°£¬´ÅÅÌËð»µÁË£¬Äã¾Í²»ÄÜ´Ó´ÅÅÌÉÏÔÙÈ¡µ½ÊÂÎñÈÕÖ¾µÄ±¸·ÝÁË¡£
ÁíÒ»¸öÎÊÌâÊÇ£¬µ±ÄãµÄÊý¾ÝʹÓÃÅúÁ¿ÈÕÖ¾»Ö¸´Ä£ÐÍʱ£¬µ±Ç°µÄÊÂÎñÈÕÖ¾Ö»°üÀ¨×îС»¯µÄÈÕÖ¾ÊÂÎñ¡£ÔÚÕâÖÖÇé¿öÏ£¬Ò»¸öÊÂÎñÈÕÖ¾±¸·ÝÐèÒª´æ´¢Êý¾ÝÒ³µÄÐ޸ġ£Èç¹ûÄãµÄÊý¾ÝÎļþ²»¿ÉÓÃÁË£¬ÄãÒ²¾Í²»Äܱ¸·ÝÊÂÎñÁË£¬ÉõÖÁÊÇ´øNO_TRUNCATEÑ¡ÏîÒ²²»ÐС£
×îºó£¬Èç¹ûÄãʹÓõÄÊÇSQL Server 2005»òÒÔÉÏ°æ±¾£¬Ã¿´ÎÄãÒª»Ö¸´µÄÊý¾Ý¿â¶¼ÊÇÒѾ´æÔÚµÄÊý¾Ý¿â£¬¶øÇÒÊÇÍêÕû»òÊÇÅúÁ¿ÈÕÖ¾»Ö¸´Ä£ÐÍ£¬¶øÇÒÊÂÎñÈÕÖ¾°üÀ¨»î¶¯ÊÂÎñµÄ»°£¬ÄÇ»áÊÕµ½ºÍÏÂÃæÀàËƵĴíÎóÐÅÏ¢£º
Server: Msg 3159, Level 16, State 1, Line 1
The tail of the log for the database "AdventureWorks" has not been backed up. Use BACKUP LOG WITH NORECOVERY to backup the log if it contains work you do not want to lose. Use the WITH REPLACE or WITH STOPAT clause of the RESTORE statement to just overwrite the contents of the log.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
ÉÏÃæµÄÐÅÏ¢¾ÍÊÇSQL ServerÔÚ¸æËßÄ㣬ÊÂÎñÈÕÖ¾ÖÐÓÐЩÈÕÖ¾¼Ç¼»¹Ã»Óб»±¸·Ý¡£¼ÙÈ統ǰÊÂÎñÈÕÖ¾¿ÉÒÔ±»¶ªÆúµÄ»°£¬Äã¿ÉÒÔʹÓÃREPLACEÑ¡ÏîÀ´ÈÃSQL ServerºöÂÔµ±Ç°µÄÊÂÎñÈÕÖ¾¡£ÈçÏ£º
RESTORE DATABASE AdventureWorks from DISK = 'G:\Backups\AdventureWorks_full.bak' WITH REPLACE
±¾ÎÄ·Òë×Ôsqlbackuprestore£¬¸ü¶à¾«²ÊÄÚÈÝÇëä¯ÀÀhttp://www.sqlbackuprestore.com
Ïà¹ØÎĵµ£º
µ±SQL Server½Ø¶ÏÊÂÎñÈÕ־ʱ£¬Ëü½ö½öÊÇÔÚÐéÄâÈÕÖ¾ÎļþÖÐ×ö¸ö±ê¼Ç£¬ÒԱ㲻ÔÙʹÓÃËü£¬È»ºó×¼±¸ÒÔÖØÓÃÐÎʽÀ´×ö±¸·Ý(¼ÙÈçÔËÔØÔÚÍêÕû»òÊÇÅúÁ¿ÈÕÖ¾»Ö¸´Ä£ÐÍ)¡£Ò²¾ÍÊÇ˵£¬ÔÚʹÓüòµ¥»Ö¸´Ä£ÐÍʱ£¬ÊÂÎñÈÕÖ¾°üÀ¨ÈçϵÄÈÕÖ¾¼Ç¼£º
µ±checkpoint·¢Éúʱ£¬ÐéÄâÈÕÖ¾Îļþ1¡¢2²»ÔÙ±»Ê¹Óã¬ÒòΪÊÂÎñ1¡¢2ÒѾ±»Ìá½»ÁË£¬¶øÇÒÈÕÖ¾¼Ç¼Ҳ²»ÔÙÐ ......
Introduction
Microsoft SQL Server 2008 R2 is the latest release of SQL Server. This article will introduce the top 10 features and benefits of SQL Server 2008 R2. The “R2” tag indicates this is an intermediate release of SQL Server and not a major revision. However, there are a number o ......
1.¼¯ºÏ²Ù×÷
ѧϰoracle
Öм¯ºÏ²Ù×÷µÄÓйØÓï¾ä£¬
ÕÆÎÕunion,union
all,minus,interestµÄʹÓÃ,Äܹ»ÃèÊö½áºÏÔËË㣬²¢ÇÒÄܹ»½«¶à¸ö²éѯ×éºÏµ½Ò»¸ö²éѯÖÐÈ¥£¬Äܹ»¿ØÖÆÐзµ»ØµÄ˳Ðò¡£
°üº¬¼¯ºÏÔËËãµÄ
²éѯ³ÆΪ¸´ºÏ²éѯ¡£¼û±í¸ñ1-1
±í1-1
Operator Returns &nb ......
SQLÓï¾äµÄ´¦Àí
ps£ºMSDNÕª
ÓÅ»¯ ÔÚ»ù´¡±íÉÏ£¨²»ÒýÓÃÊÓͼ»òÔ¶³Ì±í£©µÄ SELECT Óï¾ä:SELECT Óï¾äÊǷdzÌÐòÐÔµÄ,ÕâÒâζ×ÅÊý¾Ý¿â·þÎñÆ÷±ØÐë·ÖÎöÓï¾ä£¬ÒÔ¾ö¶¨ÌáÈ¡ËùÇëÇóÊý¾ÝµÄ×îÓÐЧ·½·¨
´¦ÀíÉÏÃæ²½ÖèµÄ×é¼þ³ÆΪ“²éѯÓÅ»¯Æ÷”£º
ÊäÈ룺²éѯ¡¢Êý¾Ý¿â·½°¸£¨±íºÍË÷ÒýµÄ¶¨Ò壩ÒÔ¼°Êý¾Ý¿âͳ¼ÆÐÅÏ¢
& ......