Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

SQL ServerÖб¸·ÝÎļþÀÛ»ýµÄÎÊÌâ

Äã´´½¨µÄÿһ¸ö±¸·Ý¶¼ÊÇÒ»¸ö±¸·ÝÉ豸£¬¹ØÓÚËüµÄϸ½ÚÐÅÏ¢¶¼´æ´¢ÔÚmsdb..backupset±íÖС£Ò»¸ö±¸·ÝÉ豸¿ÉÒÔ±»´æ´¢ÔÚµ¥Ò»Îļþ£¬»òÊǶà¸öÎļþÖС£Í¬Ñù£¬Ò»¸öÎļþÒ²¿ÉÒÔ´æ´¢¶à¸ö±¸·ÝÉ豸¡£
ËùÒÔ£¬¼ÙÈçÄãÿ´Î±¸·Ý¶¼Ê¹ÓÃÏàͬµÄÎļþÃû£¬Îļþ¾Í»áÒ»Ö±Ôö³¤¡£Ò»¸öÆÕ±éµÄÎó½âÊÇ£ºÈç¹ûÄãÿ´ÎʹÓÃÏàͬµÄÎļþÃû£¬ÄǾɵı¸·ÝÉ豸¾Í»á±»¸²¸Ç¡£µ«ÊÂʵȴ²»ÊÇÕâÑùµÄ¡£

ÄÇÎÒÃÇÔõô·Ö±æÒ»¸öÎļþÖÐÊÇ·ñ°üÀ¨¶à¸ö±¸·ÝÉ豸ÄØ£¿Äã¿ÉÒÔʹÓÃRESTORE HEADONLYÃüÁîÀ´ÊµÏÖ¡£
ÈçÉÏͼ£¬ÎļþÖеÄËùÓб¸·ÝÉ豸¶¼±»ÁÐÁ˳öÀ´¡£ÄãÔõô»¹Ô­Ò»¸öÖ¸¶¨µÄ±¸·ÝÉ豸ÄØ£¿Äã¿ÉÒÔʹÓÃFILE²ÎÊý£¬ÈçÏ£º
RESTORE DATABASE AdventureWorks from DISK = 'g:\backups\AdventureWorks_full.bak' WITH FILE = 3
ÉÏÃæµÄÃüÁîÊÇ´ÓÎļþÖеĵÚÈý¸ö±¸·ÝÉ豸Öл¹Ô­AdventureWorksÊý¾Ý¿â¡£
Èç¹ûÄ㲻ʹÓÃFILE²ÎÊý»áÈçºÎÄØ£¿SQL Server»áʹÓõÚÒ»¸ö±¸·ÝÉ豸À´»¹Ô­Êý¾Ý¿â¡£
×¢Ò⣺¼ÙÈçÄãµÄÓû§×ÜÊDZ§Ô¹ËûÃÇ»¹Ô­µÄÊý¾Ý¿â²»ÊÇËûÃDZ¸·ÝµÄÄǸö£¬ÄǾÍÓпÉÄÜÊÇÒòΪ±¸·ÝÎļþ°üº¬¶à¸ö±¸·ÝÉ豸£¬ËûÃÇ°Ñ´íµÄÉ豸»¹Ô­ÁË¡£
Äܲ»ÄÜ´ÓÒ»¸öÎļþÖÐɾ³ýij¸öÖ¸¶¨µÄ±¸·ÝÉ豸ÄØ£¿´ð°¸ÊÇNO¡£ÓÐûÓпÉÄÜ×ÜÊÇÏàʹÓÃÏàͬµÄÎļþÀ´±¸·Ý£¬µ«ÊÇÿ´Î¶¼¸²¸Ç¾ÉµÄ±¸·ÝÉ豸£¬ÒÔ±ãʹÎļþ×ÜÊÇÖ»°üÀ¨×îеı¸·ÝÉ豸ÄØ£¿Õ⵱Ȼ¿ÉÒÔ£¬Ö»ÒªÔÚ±¸·ÝʱʹÓÃINITÑ¡ÏÈçÏ£º
BACKUP DATABASE AdventureWorks TO DISK = 'G:\backups\full\AdventureWorks.bak' WITH INIT
¼ÙÈ籸·ÝÉ豸ÔÚ´´½¨Ê±Ê¹ÓÃÁËEXPIREDATE»òÊÇRETAINDAYSÑ¡ÏÄÇôINITÑ¡Ïî¾Í»áÔÚ¸²¸Ç¾É°æ±¾µÄ±¸·ÝÉ豸ʱ·¢Éú´íÎó¡£µ±±¸·ÝÉ豸ÔÚ´´½¨Ê±Ê¹ÓÃÁËEXPIREDATEµÄ»°£¬ÄÇÕâ¸öÈÕÆÚ֮ǰµÄ±¸·ÝÉ豸¾Í²»Äܱ»¸²¸Ç¡£Í¬Ñù£¬µ±Ò»¸ö±¸·ÝÉ豸ÔÚ´´½¨Ê±Ê¹ÓÃÁËRETAINDAYSÑ¡ÏÄǾͰµÊ¾ÔÚËü´´½¨Ö¸¶¨µÄÌìÊýÄÚ£¬Ëü²»Äܱ»¸²¸Ç¡£¼ÙÈçÇ¿ÐÐÒª¸²¸Ç±¸·ÝÉ豸µÄ»°£¬ÀàËƵÄÏûÏ¢»áÏÔʾÈçÏ£º
Server: Msg 4030, Level 16, State 1, Line 1
The medium on device 'e:\temp\testdb.bak' expires on Jun 23 2008 11:28:50:000PM and cannot be overwritten.
Server: Msg 3013, Level 16, State 1, Line 1
BACKUP LOG is terminating abnormally.
Èç¹ûÄãÒÀ¾ÉÏ븲¸ÇÄÇЩʹÓÃÁËEXPIREDATE»òÊÇRETAINDAYS±¸·ÝÉ豸µÄ»°£¬¿ÉÒÔʹÓÃFORMATÑ¡ÏÈçÏ£º
BACKUP DATABASE AdventureWorks TO DISK = 'G:\backups\full\AdventureWorks.bak' WITH FORMAT
±¸·ÝÎļþ»ýÀÛµÄÓÅȱµã£º
Óŵ㣺
Äã¿ÉÒÔ°ÑÒ»Öܵı¸·ÝÉ豸ÕûºÏµ½Ò»¸öµ¥Ò»Îļþ


Ïà¹ØÎĵµ£º

SQL SERVER 2000¸ü¸ÄºÍɾ³ýSaÓû§ÃûºÍÃÜÂë

ÏÖÔÚÓÃMSSQLµÄµØ·½Ì«¶àÁË£¬Óкܶà×ö¼¼ÊõµÄ¸öÈ˵çÄÔÉÏÒ²°²×°SQLרҵ°æ£¬ÒòΪËüÓõĶ࣬µ«ÓõÄÈ˶¼ÖªµÀ£¬SQLÓиö³¬¼¶Óû§sa£¬´ËÓû§Ä¬ÈÏÇé¿öÏ£¬ËüÖ¸Åɸø¹Ì¶¨·þÎñÆ÷½ÇÉ« sysadmin£¬²¢²»ÄܽøÐиü¸Ä¡£Ò»°ã¶®µã°²È«ÎÊÌâµÄ¼¼ÊõÈËÔ±¶¼»á°ÑÕâ¸öÃÜÂëÐ޸ĵô£¬µ«ÐÞ¸ÄÔÙ¸´ÔÓµÄÃÜÂ붼²»ÊǾø¶Ô°²È«µÄ£¬Ò»Ð©±©Á¦ÆƽâÈí¼þ£¬²ËÄñ¶¼»áÓá£
ÄÇ ......

Sql Êý¾Ý¿â±¸·Ý

Êý¾Ý¿â±¸·Ý  ×÷ÒµÖеÄSqlÓï¾ä£º
DECLARE @strPath NVARCHAR(200)
set @strPath = convert(NVARCHAR(19),getdate(),120)
set @strPath = REPLACE(@strPath, ':' , '_')
set @strPath = REPLACE(@strPath, '-' , '_')
set @strPath = REPLACE(@strPath, ' ' , '_')
set @strPath = 'F:\Êý¾Ý¿â±¸·Ý\' + myData_'+@s ......

MS SQL ²éѯÁª½ÓÔËËãϵÁУ­£­¹þÏ£Áª½Ó£¨Hash Join)

¹þÏ£Áª½ÓÊǵÚÈýÖÖÎïÀíÁª½ÓÔËËã·û£¬µ±Ëµµ½¹þÏ£Áª½Óʱ£¬ËüÊÇÈýÖÖÁª½ÓÔËËãÖÐÐÔÄÜ×îºÃµÄ£®Ç¶Ì×Ñ­»·Áª½ÓÊÊÓÃÓÚÏà¶Ô½ÏСµÄÊý¾Ý¼¯£¬¶øºÏ²¢Áª½ÓÊÊÓÃÓÚÖеȹæÄ£µÄÊý¾Ý¼¯£¬¶ø¹þÏ£Áª½ÓÔòÊÊÓÃÓÚ´ó¹æÄ£Áª½ÓµÄÊý¾Ý¼¯£®
¹þÏ£Áª½ÓËã·¨²ÉÓ㢹¹½¨£¢ºÍ£¢Ì½²â£¢Á½²½À´Ö´ÐУ®ÔÚ£¢¹¹½¨£¢½×¶Î£¬ËüÊ×ÏÈ´ÓµÚÒ»¸öÊäÈëÖжÁÈ¡ËùÓÐÐУ¨³£½Ð×ö×ó»ò¹¹½¨Ê ......

SQL Server 2000£«ADO.NETʵÏÖ²¢·¢¿ØÖÆ ×ªÔØ

³£¼û²¢·¢²¢·¢Ò»ÖÂÐÔÎÊÌâ°üÀ¨£º¶ªÊ§µÄÐ޸ġ¢²»¿ÉÖظ´¶Á¡¢¶ÁÔàÊý¾Ý¡¢»ÃÓ°¶Á£¨»ÃÓ°¶ÁÔÚһЩ×ÊÁÏÖÐÍùÍùÓë²»¿ÉÖظ´¶Á¹éΪһÀࣩ¡£
2.2.1.1 ¶ªÊ§ÐÞ¸Ä
ÏÂÃæÎÒÃÇÏÈÀ´¿´Ò»¸öÀý×Ó£¬ËµÃ÷²¢·¢²Ù×÷´øÀ´µÄÊý¾ÝµÄ²»Ò»ÖÂÐÔÎÊÌâ¡£
¿¼ÂÇ·É»ú¶©Æ±ÏµÍ³ÖеÄÒ»¸ö»î¶¯ÐòÁÐ:
¼×ÊÛƱµã£¨¼×ÊÂÎñ£©¶Á³öijº½°àµÄ»úƱÓà¶îA,ÉèA=16.
ÒÒÊÛƱµã£¨ÒÒÊÂÎñ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ