{"id":535,"date":"2013-10-23T16:20:58","date_gmt":"2013-10-23T08:20:58","guid":{"rendered":"http:\/\/coderbee.net\/?p=535"},"modified":"2013-10-23T16:23:40","modified_gmt":"2013-10-23T08:23:40","slug":"sqlldr-%e5%af%bc%e6%95%b0%e6%8d%ae","status":"publish","type":"post","link":"https:\/\/coderbee.net\/index.php\/db\/20131023\/535","title":{"rendered":"sqlldr \u5bfc\u6570\u636e"},"content":{"rendered":"<p>sqlldr \u53ef\u4ee5\u628a\u6587\u672c\u6587\u4ef6\u5bfc\u5165\u5230\u6570\u636e\u5e93\u91cc\u3002<\/p>\n<h2>\u7b80<\/h2>\n<p>\u547d\u4ee4\u884c\u547d\u4ee4\uff1a<br \/>\n<code>sqlldr userid=dbUserName\/dbName control=sqlldr.ctl  log=sqlldr.log  bad=sqlldr.bad  bindsize=1048576000  rows=500000 readsize=209715200  multithreading=TRUE  direct=TRUE;<\/code><\/p>\n<p>sqlldr.ctl \u662f\u5bfc\u5165\u7684\u63a7\u5236\u6587\u4ef6\uff1a<\/p>\n<pre><code class=\"sql\">load data                  \ncharacterset UTF8   #   \u9700\u8981\u52a0\u8f7d\u4e2d\u6587\u5b57\u7b26\u65f6\u5e94\u5728\u63a7\u5236\u6587\u4ef6\u91cc\u6307\u5b9a\u5b57\u7b26\u96c6\ninfile csv.txt2           #  \u8981\u5bfc\u5165\u7684\u6570\u636e\u6587\u4ef6\ninto table scott.caiyunlog append          #  \u5bfc\u5165\u7684\u76ee\u6807\u8868\uff0c\u5bfc\u5165\u65b9\u5f0f\u662fappend \u8ffd\u52a0\uff0c\u8fd8\u6709\u5176\u4ed6\u65b9\u5f0f\u89c1\u4e0b\u9762\n(\n        ip terminated  by '|',               #   \u6bcf\u4e2a\u5b57\u6bb5\u53ef\u4ee5\u6307\u5b9a\u81ea\u5df1\u7684\u5206\u9694\u7b26\n        rtime terminated  by '|',\n        method terminated  by '|',\n        uri terminated  by '|',\n        proto terminated  by '|',\n        code terminated  by '|',\n        respsize terminated  by '|',\n        T terminated  by '|',\n        D terminated by  whitespace     #  \u6700\u540e\u7684\u90a3\u4e2a\u5b57\u6bb5\u6ca1\u6709\u5206\u9694\u7b26\uff0c\u5c31\u7528\u7a7a\u767d\u7b26\uff0c\u4ee5\u6700\u540e\u7684\u6362\u884c\u7b26\u4e3a\u5206\u9694\u7b26\u3002\n)\n<\/code><\/pre>\n<h4>\u5bfc\u5165\u65b9\u5f0f<\/h4>\n<ol>\n<li>insert     &#8211;\u4e3a\u7f3a\u7701\u65b9\u5f0f\uff0c\u5728\u6570\u636e\u88c5\u8f7d\u5f00\u59cb\u65f6\u8981\u6c42\u8868\u4e3a\u7a7a<\/li>\n<li>append  &#8211;\u5728\u8868\u4e2d\u8ffd\u52a0\u65b0\u8bb0\u5f55<\/li>\n<li>replace  &#8211;\u5220\u9664\u65e7\u8bb0\u5f55(\u7528 delete from table \u8bed\u53e5)\uff0c\u66ff\u6362\u6210\u65b0\u88c5\u8f7d\u7684\u8bb0\u5f55<\/li>\n<li>truncate &#8211;\u5220\u9664\u65e7\u8bb0\u5f55(\u7528 truncate table \u8bed\u53e5)\uff0c\u66ff\u6362\u6210\u65b0\u88c5\u8f7d\u7684\u8bb0\u5f55<\/li>\n<\/ol>\n<h2>sqlldr\u7528\u6cd5<\/h2>\n<p><strong>\u8981\u6ce8\u610f\u662ferrors\u53c2\u6570\uff0c\u5f53\u9519\u8bef\u7684\u6570\u636e\u884c\u6570\u8fbe\u5230\u8fd9\u4e2a\u53c2\u6570\u7684\u503c\u65f6\u4f1a\u7ec8\u6b62\u5bfc\u5165\u3002<\/strong><\/p>\n<pre>\nUsage: SQLLDR keyword=value [,keyword=value,...]\n\nValid Keywords:\n\n    userid -- ORACLE username\/password           \n   control -- control file name                  \n       log -- log file name                      \n       bad -- bad file name                      \n      data -- data file name                     \n   discard -- discard file name                  \ndiscardmax -- number of discards to allow          (Default all)\n      skip -- number of logical records to skip    (Default 0)\n      load -- number of logical records to load    (Default all)\n    errors -- number of errors to allow            (Default 50)\n      rows -- number of rows in conventional path bind array or between direct path data saves\n               (Default: Conventional path 64, Direct path all)\n  bindsize -- size of conventional path bind array in bytes  (Default 256000)\n    silent -- suppress messages during run (header,feedback,errors,discards,partitions)\n    direct -- use direct path                      (Default FALSE)\n   parfile -- parameter file: name of file that contains parameter specifications\n  parallel -- do parallel load                     (Default FALSE)\n      file -- file to allocate extents from      \nskip_unusable_indexes -- disallow\/allow unusable indexes or index partitions  (Default FALSE)\nskip_index_maintenance -- do not maintain indexes, mark affected indexes as unusable  (Default FALSE)\ncommit_discontinued -- commit loaded rows when load is discontinued  (Default FALSE)\n  readsize -- size of read buffer                  (Default 1048576)\nexternal_table -- use external table for load; NOT_USED, GENERATE_ONLY, EXECUTE  (Default NOT_USED)\ncolumnarrayrows -- number of rows for direct path column array  (Default 5000)\nstreamsize -- size of direct path stream buffer in bytes  (Default 256000)\nmultithreading -- use multithreading in direct path  \nresumable -- enable or disable resumable for current session  (Default FALSE)\nresumable_name -- text string to help identify resumable statement\nresumable_timeout -- wait time (in seconds) for RESUMABLE  (Default 7200)\ndate_cache -- size (in entries) of date conversion cache  (Default 1000)\nno_index_errors -- abort load on any index errors  (Default FALSE)\n\nPLEASE NOTE: Command-line parameters may be specified either by\nposition or by keywords.  An example of the former case is 'sqlldr\nscott\/tiger foo'; an example of the latter is 'sqlldr control=foo\nuserid=scott\/tiger'.  One may specify parameters by position before\nbut not after parameters specified by keywords.  For example,\n'sqlldr scott\/tiger control=foo logfile=log' is allowed, but\n'sqlldr scott\/tiger control=foo log' is not, even though the\nposition of the parameter 'log' is correct.\n\n<\/pre>\n<hr\/>\n<p>\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u5fae\u4fe1\u516c\u4f17\u53f7: <strong>coderbee\u7b14\u8bb0<\/strong>\uff0c\u53ef\u4ee5\u66f4\u53ca\u65f6\u56de\u590d\u4f60\u7684\u8ba8\u8bba\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"258\" height=\"258\" src=\"https:\/\/coderbee.net\/wp-content\/uploads\/2019\/01\/coderbee-note.jpg\" class=\"alignnone size-full wp-image-1707\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>sqlldr \u53ef\u4ee5\u628a\u6587\u672c\u6587\u4ef6\u5bfc\u5165\u5230\u6570\u636e\u5e93\u91cc\u3002 \u7b80 \u547d\u4ee4\u884c\u547d\u4ee4\uff1a sqlldr u &hellip; <a href=\"https:\/\/coderbee.net\/index.php\/db\/20131023\/535\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[99,98],"_links":{"self":[{"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/posts\/535"}],"collection":[{"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/comments?post=535"}],"version-history":[{"count":4,"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/posts\/535\/revisions"}],"predecessor-version":[{"id":539,"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/posts\/535\/revisions\/539"}],"wp:attachment":[{"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/media?parent=535"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/categories?post=535"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/tags?post=535"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}