午夜国产狂喷潮在线观看|国产AⅤ精品一区二区久久|中文字幕AV中文字幕|国产看片高清在线

    數(shù)據(jù)批量導(dǎo)入Oracle數(shù)據(jù)庫
    來源:易賢網(wǎng) 閱讀:993 次 日期:2015-03-20 14:23:06
    溫馨提示:易賢網(wǎng)小編為您整理了“數(shù)據(jù)批量導(dǎo)入Oracle數(shù)據(jù)庫”,方便廣大網(wǎng)友查閱!

    SQL*LOADER是大型數(shù)據(jù)

    倉庫選擇使用的加載方法,因為它提供了最快速的途徑(DIRECT,PARALLEL)?,F(xiàn)在,我們拋開其理論不談,用實例來使

    您快速掌握SQL*LOADER的使用方法。

    首先,我們認(rèn)識一下SQL*LOADER。

    在NT下,SQL*LOADER的命令為SQLLDR,在UNIX下一般為sqlldr/sqlload。

    如執(zhí)行:d:oracle>sqlldr

    SQL*Loader: Release 8.1.6.0.0 - Production on 星期二 1月 8 11:06:42 2002

    (c) Copyright 1999 Oracle Corporation. All rights reserved.

    用法: SQLLOAD 關(guān)鍵字 = 值 [,keyword=value,...]

    有效的關(guān)鍵字:

    userid -- ORACLE username/password

    control -- Control file name

    log -- Log file name

    bad -- Bad file name

    data -- Data file name

    discard -- Discard file name

    discardmax -- Number of discards to allow (全部默認(rèn))

    skip -- Number of logical records to skip (默認(rèn)0)

    load -- Number of logical records to load (全部默認(rèn))

    errors -- Number of errors to allow (默認(rèn)50)

    rows -- Number of rows in conventional path bind array or between direct p

    ath data saves

    (默認(rèn): 常規(guī)路徑 64, 所有直接路徑)

    bindsize -- Size of conventional path bind array in bytes(默認(rèn)65536)

    silent -- Supdivss messages during run (header,feedback,errors,discards,part

    itions)

    direct -- use direct path (默認(rèn)FALSE)

    parfile -- parameter file: name of file that contains parameter specification

    s

    parallel -- do parallel load (默認(rèn)FALSE)

    file -- File to allocate extents from

    skip_unusable_indexes -- disallow/allow unusable indexes or index partitions(默認(rèn)FALSE)

    skip_index_maintenance -- do not maintain indexes, mark affected indexes as unusable(默認(rèn)FALSE)

    commit_discontinued -- commit loaded rows when load is discontinued(默認(rèn)FALSE)

    readsize -- Size of Read buffer (默認(rèn)1048576)

    PLEASE NOTE: 命令行參數(shù)可以由位置或關(guān)鍵字指定。

    前者的例子是 'sqlload scott/tiger foo';

    后者的例子是 'sqlload control=foo userid=scott/tiger'.

    位置指定參數(shù)的時間必須早于但不可遲于由關(guān)鍵字指定的參數(shù)。例如,

    'SQLLOAD SCott/tiger control=foo logfile=log',

    但'不允許 sqlload scott/tiger control=foo log',

    即使允許參數(shù) 'log' 的位置正確。

    d:oracle>

    我們可以從中看到一些基本的幫助信息,這里,我用到的是中文的WIN2000 ADV SERVER。

    我們知道,SQL*LOADER只能導(dǎo)入純文本,所以我們現(xiàn)在開始以實例來講解其用法。

    一、已存在數(shù)據(jù)源result.csv,欲倒入ORACLE中FANCY用戶下。

    result.csv內(nèi)容:

    1,默認(rèn) Web 站點,192.168.2.254:80:,RUNNING

    2,other,192.168.2.254:80:test.com,STOPPED

    3,third,192.168.2.254:81:thirdabc.com,RUNNING

    從中,我們看出4列,分別以逗號分隔,為變長字符串。

    二、制定控制文件result.ctl

    result.ctl內(nèi)容:

    load data

    infile 'result.csv'

    into table resultxt

    (resultid char terminated by ',',

    website char terminated by ',',

    ipport char terminated by ',',

    status char terminated by whitespace)

    說明:

    infile 指數(shù)據(jù)源文件 這里我們省略了默認(rèn)的 discardfile result.dsc badfile result.bad

    into table resultxt 默認(rèn)是INSERT,也可以into table resultxt APPEND為追加方式,或REPLACE

    terminated by ',' 指用逗號分隔

    terminated by whitespace 結(jié)尾以空白分隔

    三、此時我們執(zhí)行加載:

    D:>sqlldr userid=fancy/testpass control=result.ctl log=resulthis.out

    SQL*Loader: Release 8.1.6.0.0 - Production on 星期二 1月 8 10:25:42 2002

    (c) Copyright 1999 Oracle Corporation. All rights reserved.

    SQL*Loader-941: 在描述表RESULTXT時出現(xiàn)錯誤

    ORA-04043: 對象 RESULTXT 不存在

    提示出錯,因為數(shù)據(jù)庫沒有對應(yīng)的表。

    四、在數(shù)據(jù)庫建立表

    create table resultxt

    (resultid varchar2(500),

    website varchar2(500),

    ipport varchar2(500),

    status varchar2(500))

    /

    更多信息請查看IT技術(shù)專欄

    更多信息請查看數(shù)據(jù)庫
    易賢網(wǎng)手機(jī)網(wǎng)站地址:數(shù)據(jù)批量導(dǎo)入Oracle數(shù)據(jù)庫
    由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!

    2025國考·省考課程試聽報名

    • 報班類型
    • 姓名
    • 手機(jī)號
    • 驗證碼
    關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機(jī)站點 | 投訴建議
    工業(yè)和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網(wǎng)安備53010202001879號 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號
    云南網(wǎng)警備案專用圖標(biāo)
    聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號:hfpxwx
    咨詢QQ:1093837350(9:00—18:00)版權(quán)所有:易賢網(wǎng)
    云南網(wǎng)警報警專用圖標(biāo)