我现在要将一个.txt文本文件导入到数据库只定的表里面,用了sqlloader的方法,首先创建了result.csv ,然后再创建result.ctl 。(我创建的方法都是在txt文本里面写好内容,然后改后缀)
接下来。。我运行了如下的命令
D:\>sqlldr userid=用户名/密码 control=result.ctl
(前面提到的2个文件都在D盘下面,并且oracle安装路径也在D:\oracle) 运行后,总是导入数据不成功,提示的错误如下SQL*Loader: Release 9.0.1.1.1 - Production on Tue Aug 17 13:30:48 2004(c) Copyright 2001 Oracle Corporation. All rights reserved.SQL*Loader-704: Internal error: ulconnect: OCIServerAttach [0]
ORA-12560: TNS:protocol adapter error 请各位高手指点。。谢谢
另外顺便问一下,要将txt文件导入到oracle表里面,还有其他什么办法
接下来。。我运行了如下的命令
D:\>sqlldr userid=用户名/密码 control=result.ctl
(前面提到的2个文件都在D盘下面,并且oracle安装路径也在D:\oracle) 运行后,总是导入数据不成功,提示的错误如下SQL*Loader: Release 9.0.1.1.1 - Production on Tue Aug 17 13:30:48 2004(c) Copyright 2001 Oracle Corporation. All rights reserved.SQL*Loader-704: Internal error: ulconnect: OCIServerAttach [0]
ORA-12560: TNS:protocol adapter error 请各位高手指点。。谢谢
另外顺便问一下,要将txt文件导入到oracle表里面,还有其他什么办法
解决方案 »
- 怎么样解决PLS-00302: 必须声明 组件这个错误请大侠不吝赐教
- Oracle导入imp时,报错:IMP-00016: 不支持要求的字符集转换(从类型31到852)
- oracle 备份 基础
- Excle数据导入oracle出错,数据只有2千多条,在线等救命呀。
- 新人报道 请大家多关照
- 请问一个最简单的问题:用java连接oracle怎么连接啊?
- ORA-01172: 线程1的恢复停止在块8103(在文件2中)
- 在oracle里面怎么能看所有的表,还有怎么能看某一个表的结构呢,谢谢
- 如何修改SID?
- 为什么建reverse key 索引的表插入的速度比建普通索引的表要慢很多?
- 在Oracle中插入java代码??
- 请问在记录数为5万条时,select * from table order by id desc,是查询耗时还是排序耗时?
D:\>sqlldr userid=用户名/密码 control=D:\result.ctl
将txt文件导入到oracle表里面---可以用SQL Server中的DTS工具
sqlldr usserid=userid/password@ser4vername ....
我的数据库确实不在本地,而且服务器上用不同的Oracle 9i的数据库。。
我这里用了你交给我的方法
D:\>sqlldr userid=用户名/密码@服务器名 control=D:\result.ctl
可是还是有错。如下:
************************************************************************
SQL*Loader: Release 9.0.1.1.1 - Production on Tue Aug 17 16:11:14 2004(c) Copyright 2001 Oracle Corporation. All rights reserved.SQL*Loader-704: Internal error: ulconnect: OCIServerAttach [0]
ORA-12514: TNS:listener could not resolve SERVICE_NAME given in connect descriptor
************************************************************************
我用PL-SQL 和TOAD都可以连接上数据库没问题。to: freddy2003()
DTS工具好像只支持到Oracle 7.3.1 再高的版本不支持??
第一个result.csv 就是将从SQL Server 导出的txt文件更改了后缀名而成
第二个result.ctl 我也是先在一个txt文件里面写如下:
load data
infile 'result.csv'
into table AAA
(col1 char terminated by ',',
col2 char terminated by ',',
col3 char terminated by ',',
col4 char terminated by ',',
col5 char terminated by whitespace)
然后在更改后缀名为.ctl不知道这样建立控制文件可以嘛。谢谢大家。。
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 指数据源文件 这里我们省略了默认的 discardfile result.dsc badfile result.bad
into table resultxt 默认是INSERT,也可以into table resultxt APPEND为追加方式,或REPLACE
terminated by ',' 指用逗号分隔
terminated by whitespace 结尾以空白分隔
ORA-12514: TNS:listener could not resolve SERVICE_NAME given in connect descriptor
************************************************************************
我用PL-SQL 和TOAD都可以连接上数据库没问题。>>用sqlplus可以连接上吗?(命令行的sqlplus)
Sorry 我用SQL Plus连接服务器。是连接不上。
我想知道这是什么原因,为什么PL-SQL TOAD都可以连接上非本地的数据库,那么是不是就是这个原因导致我sqlloader时,出现上面的问题??
谢谢
用SQL Plus连接,输入用户名密码,在输入Host String。可以连接上