使用Oracle sqlldr遇到ORA-12545: Connect failed... 和 ORA-12154: TNS:could not resolve...报错

背景

在 Oracle 数据库中,有时候需要将表里的记录进行复制或迁移。会用以下几种方法:

  1. A 表的记录导出为一条条分号隔开的 insert 语句,然后执行插入到 B 表中
  2. 建立数据库间的 dblink,然后用 insert into B select * from A@dblink where …
  3. exp A 表,再 imp 到 B 表,exp 时可加查询条件
  4. 程序实现 select from A …,然后 insert into B …,也要分批提交
  5. 再就是使用 Sql Loader(sqlldr) 来导入数据,效果比起逐条 insert 来很明显

操作过程

第一步

先运行cmd,然后输入 sqlldr,执行后看是否有输出结果,结果大概如下:

SQL*Loader: Release 12.2.0.1.0 - Production on ...

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

Usage: SQLLDR keyword=value [,keyword=value,...]

Valid Keywords:

    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          (Default all)
      skip -- number of logical records to skip    (Default 0)
      load -- number of logical records to load    (Default all)
    errors -- number of errors to allow            (Default 50)
      rows -- number of rows in conventional path bind array or between direct path data saves
             
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值