SQL * Loader-128:无法开始会话

时间:2016-05-27 10:45:51

标签: oracle unix sql-loader

我尝试使用SQL Loader从csv文件加载表格中的数据。

< --- load.sh - >

ORACLE_HOME=/oracle/OraHome11g
export ORACLE_HOME
PATH=/oracle/OraHome11g/bin
export PATH
$ORACLE_HOME/bin/lsnrctl start
sqlldr RETAIL_FIN/RETAIL_FIN$123@ERDEV control=LBR.ctl

< --- load.ctl - >

  load data
    infile '/home/tclfin/LBR.ctl'
    into table LOAN_BALANCE_MASTER_INT
    fields terminated by ',' optionally enclosed by '"'
    (ACCOUNT_NO,CUSTOMER_NAME,LIMIT)

执行脚本后,我收到以下错误:

LSNRCTL for IBM/AIX RISC System/6000: Version 11.2.0.2.0 - Production on 27-MAY-2016 16:14:34

Copyright (c) 1991, 2010, Oracle.  All rights reserved.

TNS-01106: Listener using listener name LISTENER has already been started

SQL*Loader: Release 11.2.0.2.0 - Production on Fri May 27 16:14:34 2016

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

SQL*Loader-128: unable to begin a session
ORA-01017: invalid username/password; logon denied

由于

1 个答案:

答案 0 :(得分:6)

密码中的$被视为环境变量引用,或者在这种情况下$1作为脚本的第一个参数 - 可能为null。实际使用的密码是RETAIL_FIN23,而不是RETAIL_FIN$123

您的脚本需要转义$ sign:

sqlldr RETAIL_FIN/RETAIL_FIN\$123@ERDEV control=LBR.ctl

您可以非常简单地看到相同的效果:

$ echo sqlldr RETAIL_FIN/RETAIL_FIN$123@ERDEV control=LBR.ctl
sqlldr RETAIL_FIN/RETAIL_FIN23@ERDEV control=LBR.ctl
$ echo sqlldr RETAIL_FIN/RETAIL_FIN\$123@ERDEV control=LBR.ctl
sqlldr RETAIL_FIN/RETAIL_FIN$123@ERDEV control=LBR.ctl