SQL Loader
Oracle µÄSQL*LOADER¿ÉÒÔ½«ÍⲿÊý¾Ý¼ÓÔص½Êý¾Ý¿â±íÖС£ÏÂÃæÊÇSQL*LOADERµÄ»ù±¾Ìص㣺
1£©ÄÜ×°È벻ͬÊý¾ÝÀàÐÍÎļþ¼°¶à¸öÊý¾ÝÎļþµÄÊý¾Ý
2£©¿É×°Èë¹Ì¶¨¸ñʽ£¬×ÔÓɶ¨½çÒÔ¼°¿É¶È³¤¸ñʽµÄÊý¾Ý
3£©¿ÉÒÔ×°Èë¶þ½øÖÆ£¬Ñ¹ËõÊ®½øÖÆÊý¾Ý
4£©Ò»´Î¿É¶Ô¶à¸ö±í×°ÈëÊý¾Ý
5£©Á¬½Ó¶à¸öÎïÀí¼Ç¼װµ½Ò»¸ö¼Ç¼ÖÐ
6£©¶ÔÒ»µ¥¼Ç¼·Ö½âÔÙ×°Èëµ½±íÖÐ
7£©¿ÉÒÔÓà Êý¶ÔÖƶ¨ÁÐÉú³ÉΨһµÄKEY
8£©¿É¶Ô´ÅÅÌ»ò ´Å´øÊý¾ÝÎļþ×°ÈëÖƱíÖÐ
9£©ÌṩװÈë´íÎ󱨸æ
10£©¿ÉÒÔ½«ÎļþÖеÄÕûÐÍ×Ö·û´®£¬×Ô¶¯×ª³ÉѹËõÊ®½øÖƲ¢×°ÈëÁбíÖС£
1.2¿ØÖÆÎļþ
¿ØÖÆÎļþÊÇÓÃÒ»ÖÖÓïÑÔдµÄÎı¾Îļþ£¬Õâ¸öÎı¾ÎļþÄܱ»SQL*LOADERʶ±ð¡£SQL*LOADER¸ù¾Ý¿ØÖÆÎļþ¿ÉÒÔÕÒµ½ÐèÒª¼ÓÔصÄÊý¾Ý¡£²¢ÇÒ·ÖÎöºÍ½âÊÍÕâЩÊý¾Ý¡£¿ØÖÆÎļþÓÉÈý¸ö²¿·Ö×é³É£º
l È«¾ÖÑ¡¼þ£¬ÐУ¬Ìø¹ýµÄ¼Ç¼ÊýµÈ£»
l INFILE×Ó¾äÖ¸¶¨µÄÊäÈëÊý¾Ý£»
l Êý¾ÝÌØÐÔ˵Ã÷¡£
1.3ÊäÈëÎļþ
¶ÔÓÚ SQL*Loader, ³ý¿ØÖÆÎļþÍâ¾ÍÊÇÊäÈëÊý¾Ý¡£SQL*Loader¿É´ÓÒ»¸ö»ò¶à¸öÖ¸¶¨µÄÎļþÖжÁ³öÊý¾Ý¡£Èç¹û
Êý¾ÝÊÇÔÚ¿ØÖÆÎļþÖÐÖ¸¶¨£¬¾ÍÒªÔÚ¿ØÖÆÎļþÖÐд³É INFILE * ¸ñʽ¡£µ±Êý¾Ý¹Ì¶¨µÄ¸ñʽ£¨³¤¶ÈÒ»Ñù£©Ê±ÇÒÊÇÔÚÎļþÖеõ½Ê±£¬ÒªÓÃINFILE
"fix n"
load data
infile 'example.dat' "fix 11"
into table example
fields terminated by ',' optionally enclosed by '"'
(col1 char(5),
col2 char(7))
example.dat:
001, cd, 0002,fghi,
00003,lmn,
1, "pqrs",
0005,uvwx,
µ±Êý¾ÝÊǿɱä¸ñʽ£¨³¤¶È²»Ò»Ñù£©Ê±ÇÒÊÇÔÚÎļþÖеõ½Ê±£¬ÒªÓÃINFILE "var n"¡£È磺
load data
infile 'example.dat' "var 3"
into table example
fields terminated by ',' optionally enclosed by '"'
(col1 char(5),
col2 char(7))
example.dat:
009hello,cd,010world,im,
012my,name is,
1.4»µÎļþ
»µÎļþ°üº¬ÄÇЩ±»SQL*Loader¾Ü¾øµÄ¼Ç¼¡£±»¾Ü¾øµÄ¼Ç¼¿ÉÄÜÊDz»·ûºÏÒªÇóµÄ¼Ç¼¡£
»µÎļþµÄÃû×ÖÓÉ SQL*LoaderÃüÁîµÄBADFILE ²ÎÊýÀ´¸ø¶¨¡£
1.5ÈÕÖ¾Îļþ¼°ÈÕÖ¾ÐÅÏ¢
µ±SQL*Loader ¿ªÊ¼Ö´Ðкó£¬Ëü¾Í×Ô¶¯½¨Á¢ ÈÕÖ¾Îļþ¡£ÈÕÖ¾Îļþ°üº¬ÓмÓÔصÄ×ܽᣬ¼ÓÔØÖеĴíÎóÐÅÏ¢µÈ¡£
¿ØÖÆÎļþÓï·¨
¿ØÖÆÎļþµÄ¸ñʽÈçÏ£º
OPTIONS £¨ { [SKIP=integer] [ LOAD = integer ]
[ERRORS = integer] [ROWS=integer]
[BINDSIZE=integer] [SILENT=(ALL|FEEDBACK|ERROR|DISCARD) ] )
LOAD[DATA]
[ { INFILE | INDDN } {file | * }
Ïà¹ØÎĵµ£º
ʹÓÃTranact-SQL ±àд´úÂëÀ´´´½¨Ò»¸öÐÂ±í£º
USE [OnlineJudge]
GO
/****** Object: Table [dbo].[User1] Script Date: 05/17/2010 14:05:06 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[User2](/*notice convert the tablename*/
[num] [int]IDENTITY(1,1) NOT N ......
Èç¹ûÔÚSQL Server ÀïÐèÒª¶¨Ê±»òÕßÿ¸ôÒ»¶Îʱ¼äÖ´ÐÐij¸ö´æ´¢¹ý³Ì»ò3200×Ö·ûÒÔÄÚµÄSQLÓï¾äʱ, ¿ÉÒÔÓùÜÀí->SQL Server´úÀí->×÷ÒµÀ´ÊµÏÖ¡£
¡¡¡¡1¡¢¹ÜÀí->SQL Server´úÀí->×÷Òµ(°´Êó±êÓÒ¼ü)->н¨×÷Òµ
¡¡¡¡2¡¢Ð½¨×÷ÒµÊôÐÔ(³£¹æ)->Ãû³Æ[×Ô¶¨Òå±¾´Î×÷ÒµµÄÃû³Æ]->ÆôÓõķ½¿òÄÚÊǹ´ºÅ->
·ÖÀà´¦¿ ......
Ò»´ÎProjectÏîĿƽ̨(PWA)ÒâÍâÍ£»úÇÒÅäÖÃÊý¾Ý¿âSharePoint_Config µÄLDF±»ÒâÍâɾ³ý,Èç¹ûÖ±½Ó¸½¼ÓMDFÎļþÔòÎÞ·¨¸½¼Ó.
Ïȳ¢ÊÔsp_attach_single_file_db»Ö¸´,Ö´ÐÐÈçÏÂ:
sp_attach_single_file_db 'SharePoint_Config','D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\SharePoint_Config.mdf'
³öÏÖ´íÎóÌáʾ:
......
¹«¸æ£º±¾²©¿ÍΪ΢ÈíÔƼÆËãÖÐÎIJ©¿ÍµÄ¾µÏñ²©¿Í£¬²¢²»±£Ö¤Á´½Ó¿ÉÓÃÐÔ£¬ÎªÁ˱£Ö¤ÔĶÁÌåÑ飬Çë·ÃÎÊhttp://blogs.msdn.com/azchina¡£
SQL Azure vs. SQL Server
¸ÅÒª
SQL Azure Database ÊÇÒ»¸öÀ´×Ô΢ÈíµÄ£¬»ùÓÚÔƵĹØϵÐÍÊý¾Ý¿â·þÎñ¡£SQL Azure Ìṩ¹ØϵÐÍÊý¾Ý¿â¹¦ÄÜÀ´×÷Ϊ¹«Ó÷þÎñ¡£»ùÓÚÔƵÄÊý¾Ý¿â½â¾ö·½°¸ ......