CSV 檔案內容
portal,,
ex portal,,
,,
i_id,i_name,risk
1,a,aa
2,b,bb
3,c,cc
4,d,dd
5,e,ee
6,f,ff
7,g,gg
8,h,hh
9,i,ii
10,j,jj
控制檔案內容
options (
skip=4,
PARALLEL=true,
DIRECT=true
)
LOAD DATA
INFILE 'E:\sqlloader\testfile.csv'
APPEND
INTO TABLE LOADER_TAB
FIELDS TERMINATED BY ","
(
i_id,
i_name,
risk
)
我得到物件不存在但表名確實存在于模式系統中
select tab.owner, tab.STATUS
from dba_tables tab
where tab.TABLE_NAME = 'LOADER_TAB';
也嘗試通過給出 scema_name.table_name 但沒有運氣。
options (
skip=4,
PARALLEL=true,
DIRECT=true
)
LOAD DATA
INFILE 'E:\sqlloader\testfile.csv'
APPEND
INTO TABLE SYSTEM.LOADER_TAB
FIELDS TERMINATED BY ","
(
i_id,
i_name,
risk
)
有人可以幫我解決這個問題嗎?我已經搜索了答案并做了所有可能的方法,但沒有得到解決方案。
uj5u.com熱心網友回復:
您就快完成了 - 這是代碼的自上而下運行,唯一的變化是我創建了一個架構來保存表格和 CSV 檔案的路徑名。因此,請按照下面的演示進行操作,如果您沒有得到相同的結果,請使用類似于下面的完整輸出來編輯問題。此外,如果您仍然遇到問題,請在不使用 DIRECT/PARALLEL 的情況下嘗試它,這將有助于我們深入研究“為什么”。
SQL> create user myuser identified by mypassword;
User created.
SQL> alter user myuser quota unlimited on users;
User altered.
SQL> grant connect, resource to myuser;
Grant succeeded.
SQL> create table myuser.LOADER_TAB(i_id number(10),i_name varchar2(30),risk varchar2(30));
Table created.
x:\tmp>sqlldr userid=myuser/mypassword@db19_pdb1 control=loader.ctl
SQL*Loader: Release 19.0.0.0.0 - Production on Tue Nov 2 11:38:58 2021
Version 19.12.0.0.0
Copyright (c) 1982, 2021, Oracle and/or its affiliates. All rights reserved.
Path used: Direct
Load completed - logical record count 10.
Table LOADER_TAB:
10 Rows successfully loaded.
Check the log file:
loader.log
for more information about the load.
x:\tmp>sqlplus myuser/mypassword@db19_pdb1
SQL*Plus: Release 19.0.0.0.0 - Production on Tue Nov 2 11:39:21 2021
Version 19.12.0.0.0
Copyright (c) 1982, 2021, Oracle. All rights reserved.
Last Successful login time: Tue Nov 02 2021 11:38:58 08:00
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.12.0.0.0
SQL> select * from loader_tab;
I_ID I_NAME RISK
---------- ------------------------------ ------------------------------
1 a aa
2 b bb
3 c cc
4 d dd
5 e ee
6 f ff
7 g gg
8 h hh
9 i ii
10 j jj
10 rows selected.
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/346930.html
標籤:甲骨文 sql-loader
